[svn-commits] oej: branch 1.2 r53090 - /branches/1.2/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Feb 1 14:12:53 MST 2007


Author: oej
Date: Thu Feb  1 15:12:52 2007
New Revision: 53090

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53090
Log:
- Make sure we release call from call counter before we destroy call (maybe #7744 and more)
- Backported by accident from 1.4

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?view=diff&rev=53090&r1=53089&r2=53090
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Thu Feb  1 15:12:52 2007
@@ -567,8 +567,7 @@
 #define SIP_CALL_LIMIT		(1 << 29)
 /* Remote Party-ID Support */
 #define SIP_SENDRPID		(1 << 30)
-/* Did this connection increment the counter of in-use calls? */
-#define SIP_INC_COUNT (1 << 31)
+#define SIP_INC_COUNT		(1 << 31)	/* Did this connection increment the counter of in-use calls? */
 
 #define SIP_FLAGS_TO_COPY \
 	(SIP_PROMISCREDIR | SIP_TRUSTRPID | SIP_SENDRPID | SIP_DTMF | SIP_REINVITE | \
@@ -2123,6 +2122,12 @@
 	if (sip_debug_test_pvt(p))
 		ast_verbose("Destroying call '%s'\n", p->callid);
 
+	if (ast_test_flag(p, SIP_INC_COUNT)) {
+		update_call_counter(p, DEC_CALL_LIMIT);
+		if (option_debug)
+			ast_log(LOG_DEBUG, "Call did not properly clean up call counter. Call ID %s\n", p->callid);
+	}
+
 	if (dumphistory)
 		sip_dump_history(p);
 
@@ -2249,8 +2254,10 @@
 		/* incoming and outgoing affects the inUse counter */
 		case DEC_CALL_LIMIT:
 			if ( *inuse > 0 ) {
-			         if (ast_test_flag(fup,SIP_INC_COUNT))
+				if (ast_test_flag(fup, SIP_INC_COUNT)) {
 				         (*inuse)--;
+					ast_clear_flag(fup, SIP_INC_COUNT);
+				}
 			} else {
 				*inuse = 0;
 			}



More information about the svn-commits mailing list