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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Nov 8 06:53:01 MST 2006


Author: rizzo
Date: Wed Nov  8 07:53:01 2006
New Revision: 47317

URL: http://svn.digium.com/view/asterisk?rev=47317&view=rev
Log:
merge from team/rizzo/astobj2 rev.47246

Same as for peers and users, replace ASTOBJ_UNREF(r, sip_registry_destroy)
with unref_registry(r);

Approved By: oej


Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=47317&r1=47316&r2=47317&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Nov  8 07:53:01 2006
@@ -1606,6 +1606,11 @@
 	ASTOBJ_UNREF(user, sip_destroy_user);
 }
 
+static void unref_registry(struct sip_registry *reg)
+{
+	ASTOBJ_UNREF(reg, sip_registry_destroy);
+}
+
 /*! \brief Interface structure with callbacks used to connect to UDPTL module*/
 static struct ast_udptl_protocol sip_udptl = {
 	type: "SIP",
@@ -2981,7 +2986,7 @@
 	if (p->registry) {
 		if (p->registry->call == p)
 			p->registry->call = NULL;
-		ASTOBJ_UNREF(p->registry, sip_registry_destroy);
+		unref_registry(p->registry);
 	}
 
 	/* Unlink us from the owner if we have one */
@@ -4512,7 +4517,7 @@
 	reg->callid_valid = FALSE;
 	reg->ocseq = INITIAL_CSEQ;
 	ASTOBJ_CONTAINER_LINK(&regl, reg);	/* Add the new registry entry to the list */
-	ASTOBJ_UNREF(reg,sip_registry_destroy);
+	unref_registry(reg);
 	return 0;
 }
 
@@ -7070,7 +7075,7 @@
 
 	r->expire = -1;
 	__sip_do_register(r);
-	ASTOBJ_UNREF(r, sip_registry_destroy);
+	unref_registry(r);
 	return 0;
 }
 
@@ -7102,7 +7107,7 @@
 		   in the single SIP manager thread. */
 		p = r->call;
 		if (p->registry)
-			ASTOBJ_UNREF(p->registry, sip_registry_destroy);
+			unref_registry(p->registry);
 		r->call = NULL;
 		ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);	
 		/* Pretend to ACK anything just in case */
@@ -7121,7 +7126,7 @@
 		res=transmit_register(r, SIP_REGISTER, NULL, NULL);
 	}
 	manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelDriver: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
-	ASTOBJ_UNREF(r, sip_registry_destroy);
+	unref_registry(r);
 	return 0;
 }
 
@@ -12021,7 +12026,7 @@
 
 		/* Schedule re-registration before we expire */
 		r->expire=ast_sched_add(sched, expires_ms, sip_reregister, r); 
-		ASTOBJ_UNREF(r, sip_registry_destroy);
+		unref_registry(r);
 	}
 	return 1;
 }



More information about the asterisk-commits mailing list