[svn-commits] russell: trunk r70398 - in /trunk: ./ channels/chan_zap.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Jun 20 13:48:35 CDT 2007


Author: russell
Date: Wed Jun 20 13:48:34 2007
New Revision: 70398

URL: http://svn.digium.com/view/asterisk?view=rev&rev=70398
Log:
Merged revisions 70397 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r70397 | russell | 2007-06-20 13:46:49 -0500 (Wed, 20 Jun 2007) | 13 lines

Merged revisions 70396 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r70396 | russell | 2007-06-20 13:45:38 -0500 (Wed, 20 Jun 2007) | 5 lines

Fix a problem where an established call would not be properly disconnected
when a PRI disconnect is received depending on which cause code was received.
(issue #9588, original patch by softins, updated patch from jtexter3, and some
 additional feedback from mhardeman)

........

................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_zap.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=70398&r1=70397&r2=70398
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Wed Jun 20 13:48:34 2007
@@ -10085,25 +10085,29 @@
 							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;
-								switch(e->hangup.cause) {
-								case PRI_CAUSE_USER_BUSY:
-									pri->pvts[chanpos]->subs[SUB_REAL].needbusy =1;
-									break;
-								case PRI_CAUSE_CALL_REJECTED:
-								case PRI_CAUSE_NETWORK_OUT_OF_ORDER:
-								case PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION:
-								case PRI_CAUSE_SWITCH_CONGESTION:
-								case PRI_CAUSE_DESTINATION_OUT_OF_ORDER:
-								case PRI_CAUSE_NORMAL_TEMPORARY_FAILURE:
-									pri->pvts[chanpos]->subs[SUB_REAL].needcongestion =1;
-									break;
-								default:
+								if (pri->pvts[chanpos]->owner->_state == AST_STATE_UP)
 									pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
+								else {
+									switch (e->hangup.cause) {
+									case PRI_CAUSE_USER_BUSY:
+										pri->pvts[chanpos]->subs[SUB_REAL].needbusy =1;
+										break;
+									case PRI_CAUSE_CALL_REJECTED:
+									case PRI_CAUSE_NETWORK_OUT_OF_ORDER:
+									case PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION:
+									case PRI_CAUSE_SWITCH_CONGESTION:
+									case PRI_CAUSE_DESTINATION_OUT_OF_ORDER:
+									case PRI_CAUSE_NORMAL_TEMPORARY_FAILURE:
+										pri->pvts[chanpos]->subs[SUB_REAL].needcongestion =1;
+										break;
+									default:
+										pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
+									}
 								}
 							}
 							if (option_verbose > 2) 
-								ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup\n", 
-									pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span);
+								ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup, cause %d\n", 
+									pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, e->hangup.cause);
 						} else {
 							pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
 							pri->pvts[chanpos]->call = NULL;
@@ -10149,23 +10153,27 @@
 							pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
 						else if (pri->pvts[chanpos]->owner) {
 							pri->pvts[chanpos]->owner->hangupcause = e->hangup.cause;
-							switch(e->hangup.cause) {
-							case PRI_CAUSE_USER_BUSY:
-								pri->pvts[chanpos]->subs[SUB_REAL].needbusy =1;
-								break;
-							case PRI_CAUSE_CALL_REJECTED:
-							case PRI_CAUSE_NETWORK_OUT_OF_ORDER:
-							case PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION:
-							case PRI_CAUSE_SWITCH_CONGESTION:
-							case PRI_CAUSE_DESTINATION_OUT_OF_ORDER:
-							case PRI_CAUSE_NORMAL_TEMPORARY_FAILURE:
-								pri->pvts[chanpos]->subs[SUB_REAL].needcongestion =1;
-								break;
-							default:
+							if (pri->pvts[chanpos]->owner->_state == AST_STATE_UP)
 								pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
+							else {
+								switch (e->hangup.cause) {
+									case PRI_CAUSE_USER_BUSY:
+										pri->pvts[chanpos]->subs[SUB_REAL].needbusy =1;
+										break;
+									case PRI_CAUSE_CALL_REJECTED:
+									case PRI_CAUSE_NETWORK_OUT_OF_ORDER:
+									case PRI_CAUSE_NORMAL_CIRCUIT_CONGESTION:
+									case PRI_CAUSE_SWITCH_CONGESTION:
+									case PRI_CAUSE_DESTINATION_OUT_OF_ORDER:
+									case PRI_CAUSE_NORMAL_TEMPORARY_FAILURE:
+										pri->pvts[chanpos]->subs[SUB_REAL].needcongestion =1;
+										break;
+									default:
+										pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
+								}
 							}
 							if (option_verbose > 2) 
-								ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup request\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
+								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);
 							if (e->hangup.aoc_units > -1)
 								if (option_verbose > 2)
 									ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",




More information about the svn-commits mailing list