]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
allow ALERTING even after PROCEEDING (bug #3963)
authorRussell Bryant <russell@russellbryant.com>
Tue, 10 May 2005 01:39:50 +0000 (01:39 +0000)
committerRussell Bryant <russell@russellbryant.com>
Tue, 10 May 2005 01:39:50 +0000 (01:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5614 65c4cc65-6c06-0410-ace0-fbb531ad65f3

CHANGES
channels/chan_zap.c

diff --git a/CHANGES b/CHANGES
index 858c648ad7e452354d861639d6b1ed1c0bebea85..1cdc02fcdf448365957fca0970e250245002926c 100755 (executable)
--- 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.
index d66f1148348a8dbd2d15aa572d366ce5b1fd2295..fb899d45fe9bcae220aabbadbc7a3130f92f421e 100755 (executable)
@@ -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);