[asterisk-commits] rizzo: branch rizzo/astobj2 r77652 - /team/rizzo/astobj2/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 28 18:39:26 CDT 2007


Author: rizzo
Date: Sat Jul 28 18:39:25 2007
New Revision: 77652

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77652
Log:
diff reduction with trunk

Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=77652&r1=77651&r2=77652
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Sat Jul 28 18:39:25 2007
@@ -2466,7 +2466,7 @@
 	return AST_SUCCESS;
 }
 
-/*! \brief Kill a SIP dialog (called by scheduler)
+/*! \brief Kill a SIP dialog (called only by the scheduler)
  * The scheduler has a reference to this dialog when p->autokillid != -1,
  * and we are called using that reference. So if the event is not
  * rescheduled, we need to call dialog_unref().
@@ -2505,7 +2505,7 @@
 		append_history(p, "AutoDestroy", "%s", p->callid);
 		ast_debug(3, "Auto destroying SIP dialog '%s'\n", p->callid);
 		sip_destroy(p);	/* Go ahead and destroy dialog. All attempts to recover is done */
-		/* also absorbs the reference we have */
+		/* sip_destroy also absorbs the reference we have */
 	}
 	return 0;
 }
@@ -2528,7 +2528,10 @@
 	p->autokillid = ast_sched_add(sched, ms, __sip_autodestruct, dialog_ref(p));
 }
 
-/*! \brief Cancel destruction of SIP dialog */
+/*! \brief Cancel destruction of SIP dialog.
+ * Be careful as this also absorbs the reference - if you call it
+ * from within the scheduler, this might be the last reference.  
+ */
 static void sip_cancel_destroy(struct sip_pvt *p)
 {
 	if (p->autokillid > -1) {
@@ -3092,6 +3095,7 @@
 		peer->is_realtime = 1;
 	}
 	ast_variables_destroy(var);
+	ast_variables_destroy(varregs);
 
 	return peer;
 }
@@ -4896,7 +4900,6 @@
 {
 	snprintf(tagbuf, len, "as%08lx", ast_random());
 }
-
 
 /*! \brief Allocate sip_pvt structure, set defaults and link in the container.
  * Returns a reference to the object so whoever uses it later must
@@ -8081,7 +8084,7 @@
 	return map_x_s(regstatestrings, regstate, "Unknown");
 }
 
-/*! Update registration with SIP Proxy.
+/*! \brief Update registration with SIP Proxy.
  * Called from the scheduler when the previous registration expires,
  * so we don't have to cancel the pending event.
  * We assume the reference so the sip_registry is valid, since it
@@ -8777,7 +8780,7 @@
 
 		destroy_association(peer);
 		
-		register_peer_exten(peer, 0);	/* Add extension from regexten= setting in sip.conf */
+		register_peer_exten(peer, FALSE);	/* Add extension from regexten= setting in sip.conf */
 		peer->fullcontact[0] = '\0';
 		peer->useragent[0] = '\0';
 		peer->sipoptions = 0;
@@ -9208,7 +9211,7 @@
 	if (p->subscribed != NONE)	/* Only send state NOTIFY if we know the format */
 		transmit_state_notify(p, state, 1, FALSE);
 
-	ast_verb(1, "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
+	ast_verb(2, "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
 
 	sip_pvt_unlock(p);
 
@@ -9317,7 +9320,7 @@
 			if (!(res = check_auth(p, req, peer->name, peer->secret, peer->md5secret, SIP_REGISTER, uri, XMIT_UNRELIABLE, req->ignore))) {
 				sip_cancel_destroy(p);
 
-				/* We have a succesful registration attempt with proper authentication,
+				/* We have a successful registration attempt with proper authentication,
 				   now, update the peer */
 				switch (parse_register_contact(p, peer, req)) {
 				case PARSE_REGISTER_FAILED:




More information about the asterisk-commits mailing list