[asterisk-commits] oej: branch 1.4 r53085 - /branches/1.4/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Feb 1 14:05:35 MST 2007


Author: oej
Date: Thu Feb  1 15:05:34 2007
New Revision: 53085

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53085
Log:
- Clean INC_COUNT flag when we decrement call counter
- If it's still set at time of dialog destruction, make sure we decrement the device call counter properly
  before we destroy the dialog

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=53085&r1=53084&r2=53085
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Thu Feb  1 15:05:34 2007
@@ -2885,6 +2885,12 @@
 	if (sip_debug_test_pvt(p) || option_debug > 2)
 		ast_verbose("Really destroying SIP dialog '%s' Method: %s\n", p->callid, sip_methods[p->method].text);
 
+	if (ast_test_flag(&p->flags[0], SIP_INC_COUNT)) {
+		update_call_counter(p, DEC_CALL_LIMIT);
+		if (option_debug > 1)
+			ast_log(LOG_DEBUG, "This call did not properly clean up call limits. Call ID %s\n", p->callid);
+	}
+
 	/* Remove link from peer to subscription of MWI */
 	if (p->relatedpeer && p->relatedpeer->mwipvt)
 		p->relatedpeer->mwipvt = NULL;
@@ -3020,8 +3026,10 @@
 	/* incoming and outgoing affects the inUse counter */
 	case DEC_CALL_LIMIT:
 		if ( *inuse > 0 ) {
-			if (ast_test_flag(&fup->flags[0], SIP_INC_COUNT))
+			if (ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) {
 				(*inuse)--;
+				ast_clear_flag(&fup->flags[0], SIP_INC_COUNT);
+			}
 		} else {
 			*inuse = 0;
 		}



More information about the asterisk-commits mailing list