From e6472033b1ca69d4f9456905fbab95f26c17319d Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Wed, 23 Apr 2003 21:39:34 +0000 Subject: Process audio stuff in audio mode and then switch back to clear git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@893 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_zap.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 7df1faebe..d976245bd 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -1455,17 +1455,16 @@ static int zt_hangup(struct ast_channel *ast) index = zt_get_index(ast, p, 1); if (p->sig == SIG_PRI) { - x = 0; + x = 1; ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0); } + x = 0; + zt_confmute(p, 0); restore_gains(p); - if (p->dsp) - ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax); + ast_dsp_digitmode(p->dsp,DSP_DIGITMODE_DTMF | p->dtmfrelax); - x = 0; - zt_confmute(p, 0); ast_log(LOG_DEBUG, "Hangup: channel: %d index = %d, normal = %d, callwait = %d, thirdcall = %d\n", p->channel, index, p->subs[SUB_REAL].zfd, p->subs[SUB_CALLWAIT].zfd, p->subs[SUB_THREEWAY].zfd); @@ -1654,6 +1653,13 @@ static int zt_hangup(struct ast_channel *ast) p->dialing = 0; strcpy(p->rdnis, ""); update_conf(p); + /* Restore data mode */ + if (p->sig == SIG_PRI) { + x = 0; + ast_channel_setoption(ast,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0); + } + + if (p->dsp) restart_monitor(); } @@ -3528,11 +3534,6 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int #ifdef ZAPATA_PRI /* Assume calls are not idle calls unless we're told differently */ i->isidlecall = 0; - if (i->sig == SIG_PRI) { - /* Set to audio mode at this poitn mode */ - x = 1; - ast_channel_setoption(tmp,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0); - } #endif /* Assure there is no confmute on this channel */ zt_confmute(i, 0); @@ -5529,6 +5530,9 @@ static void *pri_dchannel(void *vpri) if (strlen(pri->pvt[chan]->exten) && ast_exists_extension(NULL, pri->pvt[chan]->context, pri->pvt[chan]->exten, 1, pri->pvt[chan]->callerid)) { /* Setup law */ int law; + /* Set to audio mode at this poitn mode */ + law = 1; + ast_channel_setoption(tmp,AST_OPTION_AUDIO_MODE,&x,sizeof(char),0); if (e->ring.layer1 == PRI_LAYER_1_ALAW) law = ZT_LAW_ALAW; else -- cgit v1.2.3