|
|
@ -2773,6 +2773,72 @@ static float parse_gain_value(char *gain_type, char *value)
|
|
|
|
return gain;
|
|
|
|
return gain;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int unload_module()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
struct vpb_pvt *p;
|
|
|
|
|
|
|
|
/* First, take us out of the channel loop */
|
|
|
|
|
|
|
|
if (use_ast_ind == 1){
|
|
|
|
|
|
|
|
ast_channel_unregister(&vpb_tech_indicate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
ast_channel_unregister(&vpb_tech);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_mutex_lock(&iflock); {
|
|
|
|
|
|
|
|
/* Hangup all interfaces if they have an owner */
|
|
|
|
|
|
|
|
p = iflist;
|
|
|
|
|
|
|
|
while(p) {
|
|
|
|
|
|
|
|
if (p->owner)
|
|
|
|
|
|
|
|
ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
|
|
|
|
|
|
|
|
p = p->next;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
iflist = NULL;
|
|
|
|
|
|
|
|
} ast_mutex_unlock(&iflock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_mutex_lock(&monlock); {
|
|
|
|
|
|
|
|
if (mthreadactive > -1) {
|
|
|
|
|
|
|
|
pthread_cancel(monitor_thread);
|
|
|
|
|
|
|
|
pthread_join(monitor_thread, NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mthreadactive = -2;
|
|
|
|
|
|
|
|
} ast_mutex_unlock(&monlock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_mutex_lock(&iflock); {
|
|
|
|
|
|
|
|
/* Destroy all the interfaces and free their memory */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(iflist) {
|
|
|
|
|
|
|
|
p = iflist;
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->lock);
|
|
|
|
|
|
|
|
pthread_cancel(p->readthread);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->owner_lock);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->record_lock);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->play_lock);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->play_dtmf_lock);
|
|
|
|
|
|
|
|
p->readthread = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vpb_close(p->handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iflist = iflist->next;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
free(p);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
iflist = NULL;
|
|
|
|
|
|
|
|
} ast_mutex_unlock(&iflock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_mutex_lock(&bridge_lock); {
|
|
|
|
|
|
|
|
memset(bridges, 0, sizeof bridges);
|
|
|
|
|
|
|
|
} ast_mutex_unlock(&bridge_lock);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&bridge_lock);
|
|
|
|
|
|
|
|
for(int i = 0; i < max_bridges; i++ ) {
|
|
|
|
|
|
|
|
ast_mutex_destroy(&bridges[i].lock);
|
|
|
|
|
|
|
|
ast_cond_destroy(&bridges[i].cond);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
free(bridges);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int load_module()
|
|
|
|
int load_module()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct ast_config *cfg;
|
|
|
|
struct ast_config *cfg;
|
|
|
@ -2969,72 +3035,6 @@ int load_module()
|
|
|
|
return error;
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int unload_module()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
struct vpb_pvt *p;
|
|
|
|
|
|
|
|
/* First, take us out of the channel loop */
|
|
|
|
|
|
|
|
if (use_ast_ind == 1){
|
|
|
|
|
|
|
|
ast_channel_unregister(&vpb_tech_indicate);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
ast_channel_unregister(&vpb_tech);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_mutex_lock(&iflock); {
|
|
|
|
|
|
|
|
/* Hangup all interfaces if they have an owner */
|
|
|
|
|
|
|
|
p = iflist;
|
|
|
|
|
|
|
|
while(p) {
|
|
|
|
|
|
|
|
if (p->owner)
|
|
|
|
|
|
|
|
ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
|
|
|
|
|
|
|
|
p = p->next;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
iflist = NULL;
|
|
|
|
|
|
|
|
} ast_mutex_unlock(&iflock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_mutex_lock(&monlock); {
|
|
|
|
|
|
|
|
if (mthreadactive > -1) {
|
|
|
|
|
|
|
|
pthread_cancel(monitor_thread);
|
|
|
|
|
|
|
|
pthread_join(monitor_thread, NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mthreadactive = -2;
|
|
|
|
|
|
|
|
} ast_mutex_unlock(&monlock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_mutex_lock(&iflock); {
|
|
|
|
|
|
|
|
/* Destroy all the interfaces and free their memory */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while(iflist) {
|
|
|
|
|
|
|
|
p = iflist;
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->lock);
|
|
|
|
|
|
|
|
pthread_cancel(p->readthread);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->owner_lock);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->record_lock);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->play_lock);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&p->play_dtmf_lock);
|
|
|
|
|
|
|
|
p->readthread = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vpb_close(p->handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
iflist = iflist->next;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
free(p);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
iflist = NULL;
|
|
|
|
|
|
|
|
} ast_mutex_unlock(&iflock);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ast_mutex_lock(&bridge_lock); {
|
|
|
|
|
|
|
|
memset(bridges, 0, sizeof bridges);
|
|
|
|
|
|
|
|
} ast_mutex_unlock(&bridge_lock);
|
|
|
|
|
|
|
|
ast_mutex_destroy(&bridge_lock);
|
|
|
|
|
|
|
|
for(int i = 0; i < max_bridges; i++ ) {
|
|
|
|
|
|
|
|
ast_mutex_destroy(&bridges[i].lock);
|
|
|
|
|
|
|
|
ast_cond_destroy(&bridges[i].cond);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
free(bridges);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int usecount()
|
|
|
|
int usecount()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return usecnt;
|
|
|
|
return usecnt;
|
|
|
|