[svn-commits] branch bweschke/bug_6047 - r7689 /team/bweschke/bug_6047/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Dec 31 11:30:51 CST 2005


Author: bweschke
Date: Sat Dec 31 11:30:50 2005
New Revision: 7689

URL: http://svn.digium.com/view/asterisk?rev=7689&view=rev
Log:
 Small patch after some unit testing to make this functional. Ya! It works! 


Modified:
    team/bweschke/bug_6047/channels/chan_sip.c

Modified: team/bweschke/bug_6047/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/bweschke/bug_6047/channels/chan_sip.c?rev=7689&r1=7688&r2=7689&view=diff
==============================================================================
--- team/bweschke/bug_6047/channels/chan_sip.c (original)
+++ team/bweschke/bug_6047/channels/chan_sip.c Sat Dec 31 11:30:50 2005
@@ -6312,10 +6312,12 @@
 	struct sip_pvt *p = NULL;
 	int firststate = hmgrp->state;
 
-	/* Verify first that the SIP session is still around after having waited 15 secs */
+	/* Verify first that the SIP session is still around after having waited 5 secs */
 	if (hmgrp->p) {
 		p = hmgrp->p;
-                if ((firststate = ast_extension_state(NULL, hmgrp->context, hmgrp->exten)) < 0) {
+		p->stateid = ast_extension_state_add(p->context, p->exten, cb_extensionstate, p);
+		ast_log(LOG_DEBUG, "ast_extension_state on %s@%s is %d\n", p->exten, p->context, ast_extension_state(NULL, p->context, p->exten));
+                if ((firststate = ast_extension_state(NULL, p->context, p->exten)) < 0) {
                         ast_log(LOG_DEBUG, "Still cannot retrieve state on %s@%s. Time to throw in the towel.\n", p->exten, p->context);
 			if (p->autokillid > -1)
 				sip_cancel_destroy(p);         /* Remove subscription expiry for renewals */
@@ -6326,7 +6328,6 @@
 			append_history(p, "Subscribestatus", hmgrp->state == AST_EXTENSION_REMOVED ? "HintRemoved" : "Deactivated");
 			transmit_state_notify(p, hmgrp->state, 1, 1);
                 } else {
-			p->stateid = ast_extension_state_add(hmgrp->context, hmgrp->exten, cb_extensionstate, p);
 			if (option_debug > 1)
 				ast_verbose(VERBOSE_PREFIX_1 "Extension State Resync %s new state %s for Notify User %s\n", hmgrp->exten, ast_extension_state2str(firststate), p->username);
                         transmit_state_notify(p, firststate, 1, 1);     /* Send current notification */



More information about the svn-commits mailing list