[asterisk-commits] rizzo: trunk r77648 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 28 11:38:08 CDT 2007


Author: rizzo
Date: Sat Jul 28 11:38:07 2007
New Revision: 77648

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77648
Log:
more dialog_ref()/dialog_unref() calls

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=77648&r1=77647&r2=77648
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Sat Jul 28 11:38:07 2007
@@ -8045,7 +8045,7 @@
 			build_callid_registry(r, internip.sin_addr, default_fromdomain);
 			r->callid_valid = TRUE;
 		}
-		/* Allocate SIP packet for registration */
+		/* Allocate SIP dialog for registration */
 		if (!(p = sip_alloc( r->callid, NULL, 0, SIP_REGISTER))) {
 			ast_log(LOG_WARNING, "Unable to allocate registration transaction (memory or socket error)\n");
 			return 0;
@@ -8078,7 +8078,7 @@
 		else 	/* Set registry port to the port set from the peer definition/srv or default */
 			r->portno = ntohs(p->sa.sin_port);
 		ast_set_flag(&p->flags[0], SIP_OUTGOING);	/* Registration is outgoing call */
-		r->call=p;			/* Save pointer to SIP packet */
+		r->call = dialog_ref(p);		/* Save pointer to SIP dialog */
 		p->registry = registry_addref(r);	/* Add pointer to registry in packet */
 		if (!ast_strlen_zero(r->secret))	/* Secret (password) */
 			ast_string_field_set(p, peersecret, r->secret);
@@ -13323,7 +13323,7 @@
 		|| was_reachable != is_reachable;
 
 	peer->lastms = pingtime;
-	peer->call = NULL;
+	peer->call = dialog_unref(peer->call);
 	if (statechanged) {
 		const char *s = is_reachable ? "Reachable" : "Lagged";
 
@@ -14311,7 +14311,7 @@
 	sip_pvt_unlock(p);	/* Unlock SIP structure */
 
 	/* The call should be down with no ast_channel, so hang it up */
-	c->tech_pvt = NULL;
+	c->tech_pvt = dialog_unref(c->tech_pvt);
 	ast_hangup(c);
 	return 0;
 }
@@ -14450,7 +14450,7 @@
 
 		if (p->refer->refer_call == p) {
 			ast_log(LOG_NOTICE, "INVITE with replaces into it's own call id (%s == %s)!\n", replace_id, p->callid);
-			p->refer->refer_call = NULL;
+			p->refer->refer_call = dialog_unref(p->refer->refer_call);
 			transmit_response(p, "400 Bad request", req);	/* The best way to not not accept the transfer */
 			error = 1;
 		}




More information about the asterisk-commits mailing list