mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 16:21:01 +00:00
Fixed more stuff for clearchannel mode in app_dial
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -63,6 +63,7 @@ static char *descrip =
|
|||||||
" 'r' -- indicate ringing to the calling party, pass no audio until answered.\n"
|
" 'r' -- indicate ringing to the calling party, pass no audio until answered.\n"
|
||||||
" 'm' -- provide hold music to the calling party until answered.\n"
|
" 'm' -- provide hold music to the calling party until answered.\n"
|
||||||
" 'd' -- data-quality (modem) call (minimum delay).\n"
|
" 'd' -- data-quality (modem) call (minimum delay).\n"
|
||||||
|
" 'c' -- clear-channel data call (PRI-PRI only).\n"
|
||||||
" 'H' -- allow caller to hang up by hitting *.\n"
|
" 'H' -- allow caller to hang up by hitting *.\n"
|
||||||
" 'C' -- reset call detail record for this call.\n"
|
" 'C' -- reset call detail record for this call.\n"
|
||||||
" 'P[(x)]' -- privacy mode, using 'x' as database if provided.\n"
|
" 'P[(x)]' -- privacy mode, using 'x' as database if provided.\n"
|
||||||
@@ -82,6 +83,7 @@ struct localuser {
|
|||||||
int ringbackonly;
|
int ringbackonly;
|
||||||
int musiconhold;
|
int musiconhold;
|
||||||
int dataquality;
|
int dataquality;
|
||||||
|
int clearchannel;
|
||||||
int allowdisconnect;
|
int allowdisconnect;
|
||||||
struct localuser *next;
|
struct localuser *next;
|
||||||
};
|
};
|
||||||
@@ -427,6 +429,9 @@ static int dial_exec(struct ast_channel *chan, void *data)
|
|||||||
if (strchr(transfer, 'H'))
|
if (strchr(transfer, 'H'))
|
||||||
tmp->allowdisconnect = 1;
|
tmp->allowdisconnect = 1;
|
||||||
else tmp->allowdisconnect = 0;
|
else tmp->allowdisconnect = 0;
|
||||||
|
if (strchr(transfer, 'c'))
|
||||||
|
tmp->clearchannel = 1;
|
||||||
|
else tmp->clearchannel = 0;
|
||||||
}
|
}
|
||||||
strncpy(numsubst, number, sizeof(numsubst)-1);
|
strncpy(numsubst, number, sizeof(numsubst)-1);
|
||||||
/* If we're dialing by extension, look at the extension to know what to dial */
|
/* If we're dialing by extension, look at the extension to know what to dial */
|
||||||
@@ -543,18 +548,14 @@ static int dial_exec(struct ast_channel *chan, void *data)
|
|||||||
if (!strcmp(chan->type,"Zap"))
|
if (!strcmp(chan->type,"Zap"))
|
||||||
{
|
{
|
||||||
int x = 2;
|
int x = 2;
|
||||||
if (tmp->dataquality) x = 0;
|
if (tmp->dataquality | tmp->clearchannel) x = 0;
|
||||||
ast_channel_setoption(chan,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
|
ast_channel_setoption(chan,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
|
||||||
x = 0;
|
|
||||||
ast_channel_setoption(chan,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
|
||||||
}
|
}
|
||||||
if (!strcmp(peer->type,"Zap"))
|
if (!strcmp(peer->type,"Zap"))
|
||||||
{
|
{
|
||||||
int x = 2;
|
int x = 2;
|
||||||
if (tmp->dataquality) x = 0;
|
if (tmp->dataquality) x = 0;
|
||||||
ast_channel_setoption(peer,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
|
ast_channel_setoption(peer,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
|
||||||
x = 0;
|
|
||||||
ast_channel_setoption(chan,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
|
||||||
}
|
}
|
||||||
hanguptree(outgoing, peer);
|
hanguptree(outgoing, peer);
|
||||||
outgoing = NULL;
|
outgoing = NULL;
|
||||||
@@ -577,7 +578,19 @@ static int dial_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", url);
|
ast_log(LOG_DEBUG, "app_dial: sendurl=%s.\n", url);
|
||||||
ast_channel_sendurl( peer, url );
|
ast_channel_sendurl( peer, url );
|
||||||
} /* /JDG */
|
} /* /JDG */
|
||||||
res = ast_bridge_call(chan, peer, allowredir, allowdisconnect | tmp->dataquality);
|
if (tmp->clearchannel)
|
||||||
|
{
|
||||||
|
int x = 0;
|
||||||
|
ast_channel_setoption(chan,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
||||||
|
ast_channel_setoption(peer,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
||||||
|
}
|
||||||
|
res = ast_bridge_call(chan, peer, allowredir, allowdisconnect | tmp->clearchannel);
|
||||||
|
if (tmp->clearchannel)
|
||||||
|
{
|
||||||
|
int x = 1;
|
||||||
|
ast_channel_setoption(chan,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
||||||
|
ast_channel_setoption(peer,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
||||||
|
}
|
||||||
ast_hangup(peer);
|
ast_hangup(peer);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
@@ -1433,6 +1433,9 @@ static int zt_hangup(struct ast_channel *ast)
|
|||||||
|
|
||||||
index = zt_get_index(ast, p, 1);
|
index = zt_get_index(ast, p, 1);
|
||||||
|
|
||||||
|
x = 1;
|
||||||
|
ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
||||||
|
|
||||||
restore_gains(p);
|
restore_gains(p);
|
||||||
|
|
||||||
if (p->dsp)
|
if (p->dsp)
|
||||||
@@ -1617,8 +1620,6 @@ static int zt_hangup(struct ast_channel *ast)
|
|||||||
x = 0;
|
x = 0;
|
||||||
ast_channel_setoption(ast,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
|
ast_channel_setoption(ast,AST_OPTION_TONE_VERIFY,&x,sizeof(char),0);
|
||||||
ast_channel_setoption(ast,AST_OPTION_TDD,&x,sizeof(char),0);
|
ast_channel_setoption(ast,AST_OPTION_TDD,&x,sizeof(char),0);
|
||||||
x = 1;
|
|
||||||
ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0);
|
|
||||||
p->didtdd = 0;
|
p->didtdd = 0;
|
||||||
p->cidspill = NULL;
|
p->cidspill = NULL;
|
||||||
p->callwaitcas = 0;
|
p->callwaitcas = 0;
|
||||||
@@ -1864,6 +1865,7 @@ int x;
|
|||||||
{
|
{
|
||||||
ast_log(LOG_DEBUG, "Set option AUDIO MODE, value: OFF(0) on %s\n",chan->name);
|
ast_log(LOG_DEBUG, "Set option AUDIO MODE, value: OFF(0) on %s\n",chan->name);
|
||||||
x = 0;
|
x = 0;
|
||||||
|
zt_disable_ec(p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -5461,10 +5463,10 @@ static void *pri_dchannel(void *vpri)
|
|||||||
ast_verbose(VERBOSE_PREFIX_2 "Restart on requested on entire span %d\n", pri->span);
|
ast_verbose(VERBOSE_PREFIX_2 "Restart on requested on entire span %d\n", pri->span);
|
||||||
for (x=1;x <= pri->channels;x++)
|
for (x=1;x <= pri->channels;x++)
|
||||||
if ((x != pri->dchannel) && pri->pvt[x]) {
|
if ((x != pri->dchannel) && pri->pvt[x]) {
|
||||||
ast_pthread_mutex_lock(&pri->pvt[chan]->lock);
|
ast_pthread_mutex_lock(&pri->pvt[x]->lock);
|
||||||
if (pri->pvt[x]->owner)
|
if (pri->pvt[x]->owner)
|
||||||
pri->pvt[x]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
|
pri->pvt[x]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
|
||||||
ast_pthread_mutex_unlock(&pri->pvt[chan]->lock);
|
ast_pthread_mutex_unlock(&pri->pvt[x]->lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user