]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Never released PRI channels when using Busy() or Congestion() dialplan apps.
authorRichard Mudgett <rmudgett@digium.com>
Fri, 16 Oct 2009 20:25:23 +0000 (20:25 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 16 Oct 2009 20:25:23 +0000 (20:25 +0000)
When the Busy() or Congestion() application is used towards ISDN (an ISDN
progress is sent), the responding ISDN Disconnect or Release may contain
the ISDN cause user busy or one of the congestion causes.  In chan_dahdi.c
these causes will only set the needbusy or needcongestion flags and not
activate the softhangup procedure.  Unfortunately only the latter can
interrupt the endless wait loop of Busy()/Congestion().

Result: PRI channels staying in state busy for the rest of asterisk life
or until the other end times out and forces the call to clear.

(in issue 0014292)
Reported by: tomaso
Patches:
      disc_rel_userbusy.patch uploaded by tomaso (license 564)
      (This patch is unrelated to the issue.)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@224260 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index 6e5e8994c75e85659f6446ff6882cdd2fdbe596c..ff6756af5e08b23f0c34b45dc9da869f6c938128 100644 (file)
@@ -9743,9 +9743,12 @@ static void *pri_dchannel(void *vpri)
                                                        else if (pri->pvts[chanpos]->owner) {
                                                                /* Queue a BUSY instead of a hangup if our cause is appropriate */
                                                                pri->pvts[chanpos]->owner->hangupcause = e->hangup.cause;
-                                                               if (pri->pvts[chanpos]->owner->_state == AST_STATE_UP)
+                                                               switch (pri->pvts[chanpos]->owner->_state) {
+                                                               case AST_STATE_BUSY:
+                                                               case AST_STATE_UP:
                                                                        pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
-                                                               else {
+                                                                       break;
+                                                               default:
                                                                        switch (e->hangup.cause) {
                                                                                case PRI_CAUSE_USER_BUSY:
                                                                                        pri->pvts[chanpos]->subs[SUB_REAL].needbusy =1;
@@ -9761,6 +9764,7 @@ static void *pri_dchannel(void *vpri)
                                                                                default:
                                                                                        pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
                                                                        }
+                                                                       break;
                                                                }
                                                        }
                                                        if (option_verbose > 2) 
@@ -9814,9 +9818,12 @@ static void *pri_dchannel(void *vpri)
                                                        pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
                                                else if (pri->pvts[chanpos]->owner) {
                                                        pri->pvts[chanpos]->owner->hangupcause = e->hangup.cause;
-                                                       if (pri->pvts[chanpos]->owner->_state == AST_STATE_UP)
+                                                       switch (pri->pvts[chanpos]->owner->_state) {
+                                                       case AST_STATE_BUSY:
+                                                       case AST_STATE_UP:
                                                                pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
-                                                       else {
+                                                               break;
+                                                       default:
                                                                switch (e->hangup.cause) {
                                                                        case PRI_CAUSE_USER_BUSY:
                                                                                pri->pvts[chanpos]->subs[SUB_REAL].needbusy =1;
@@ -9832,6 +9839,7 @@ static void *pri_dchannel(void *vpri)
                                                                        default:
                                                                                pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
                                                                }
+                                                               break;
                                                        }
                                                        if (option_verbose > 2) 
                                                                ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup request, cause %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span, e->hangup.cause);