[asterisk-commits] branch oej/test-this-branch r15430 - /team/oej/test-this-branch/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Mar 27 18:14:49 MST 2006


Author: oej
Date: Mon Mar 27 19:14:48 2006
New Revision: 15430

URL: http://svn.digium.com/view/asterisk?rev=15430&view=rev
Log:
Fix problem with peer that does not want to be registered any more.

Modified:
    team/oej/test-this-branch/channels/chan_sip.c

Modified: team/oej/test-this-branch/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_sip.c?rev=15430&r1=15429&r2=15430&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_sip.c (original)
+++ team/oej/test-this-branch/channels/chan_sip.c Mon Mar 27 19:14:48 2006
@@ -1059,9 +1059,9 @@
 static int restart_monitor(void);
 static char *generate_random_string(char *buf, size_t size);
 static void set_device_defaults(struct sip_peer *peer);
-static struct sip_peer *temp_peer(const char *name);
 static int sip_send_mwi_to_peer(struct sip_peer *peer);
 static int sip_scheddestroy(struct sip_pvt *p, int ms);
+static void sip_registry_destroy(struct sip_registry *reg);
 
 /*------ T38 Support --------- */
 #ifdef T38_DEBUG
@@ -1832,6 +1832,8 @@
 	device->auth = (struct sip_auth *) NULL;
 	if (device->dnsmgr)
 		ast_dnsmgr_release(device->dnsmgr);
+	if (device->registry)
+		ASTOBJ_UNREF(device->registry,sip_registry_destroy);
 	free(device);
 }
 
@@ -13436,8 +13438,12 @@
 	ASTOBJ_UNMARK(peer);
 	ast_free_ha(oldha);
 	/* Start registration if needed */
-	if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_PEER_REGISTER))
+	if (ast_test_flag((&peer->flags[1]), SIP_PAGE2_PEER_REGISTER)) {
 		sip_register(NULL, register_lineno, peer);
+	} else if (peer->registry) {
+		/* We have a peer that does not want to register any more */
+		ASTOBJ_UNREF(peer->registry,sip_registry_destroy);
+	}
 
 	return peer;
 }



More information about the asterisk-commits mailing list