From: Russell Bryant Date: Tue, 10 May 2005 01:39:50 +0000 (+0000) Subject: allow ALERTING even after PROCEEDING (bug #3963) X-Git-Tag: 1.0.11.1~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d1e5adfdce18613ca02129f2760f4690ead4700;p=thirdparty%2Fasterisk.git allow ALERTING even after PROCEEDING (bug #3963) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5614 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/CHANGES b/CHANGES index 858c648ad7..1cdc02fcdf 100755 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,8 @@ -- Asterisk will now also look in the regular context for the fax extension while executing a macro. Previously, for this to work, the fax extension would have to be included in the macro definition. + -- On some systems, ALERTING will be sent after PROCEEDING, so code has been + added to account for this case. -- chan_sip -- We no longer send a "to" tag on "100 Trying" messages, as it is inappropriate to do so. diff --git a/channels/chan_zap.c b/channels/chan_zap.c index d66f114834..fb899d45fe 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -558,6 +558,7 @@ static struct zt_pvt { int logicalspan; int alreadyhungup; int proceeding; + int alerting; int setup_ack; /* wheter we received SETUP_ACKNOWLEDGE or not */ #endif #ifdef ZAPATA_R2 @@ -2087,6 +2088,7 @@ static int zt_hangup(struct ast_channel *ast) p->onhooktime = time(NULL); #ifdef ZAPATA_PRI p->proceeding = 0; + p->alerting = 0; p->setup_ack = 0; #endif if (p->dsp) { @@ -2577,7 +2579,6 @@ static int zt_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, if (flags & (AST_BRIDGE_DTMF_CHANNEL_0 | AST_BRIDGE_DTMF_CHANNEL_1)) return -2; - ast_mutex_lock(&c0->lock); ast_mutex_lock(&c1->lock); @@ -4231,7 +4232,7 @@ static int zt_indicate(struct ast_channel *chan, int condition) break; case AST_CONTROL_RINGING: #ifdef ZAPATA_PRI - if ((p->proceeding < 2) && p->sig==SIG_PRI && p->pri && !p->outgoing) { + if ((!p->alerting) && p->sig==SIG_PRI && p->pri && !p->outgoing && (chan->_state != AST_STATE_UP)) { if (p->pri->pri) { if (!pri_grab(p, p->pri)) { pri_acknowledge(p->pri->pri,p->call, PVT_TO_CHANNEL(p), 1); @@ -4240,7 +4241,7 @@ static int zt_indicate(struct ast_channel *chan, int condition) else ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span); } - p->proceeding=2; + p->alerting=1; } #endif res = tone_zone_play_tone(p->subs[index].zfd, ZT_TONE_RINGTONE);