[asterisk-commits] branch oej/sipdiversion r27929 - in /team/oej/sipdiversion: ./ channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 17 12:51:39 MST 2006


Author: oej
Date: Wed May 17 14:51:39 2006
New Revision: 27929

URL: http://svn.digium.com/view/asterisk?rev=27929&view=rev
Log:
Update to trunk (forced)

Modified:
    team/oej/sipdiversion/   (props changed)
    team/oej/sipdiversion/channels/chan_sip.c

Propchange: team/oej/sipdiversion/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/oej/sipdiversion/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 17 14:51:39 2006
@@ -1,1 +1,1 @@
-/trunk:1-27916
+/trunk:1-27928

Modified: team/oej/sipdiversion/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sipdiversion/channels/chan_sip.c?rev=27929&r1=27928&r2=27929&view=diff
==============================================================================
--- team/oej/sipdiversion/channels/chan_sip.c (original)
+++ team/oej/sipdiversion/channels/chan_sip.c Wed May 17 14:51:39 2006
@@ -6071,19 +6071,26 @@
 static int expire_register(void *data)
 {
 	struct sip_peer *peer = data;
+	
+	if (!peer)		/* Hmmm. We have no peer. Weird. */
+		return 0;
 
 	memset(&peer->addr, 0, sizeof(peer->addr));
 
-	destroy_association(peer);
+	destroy_association(peer);	/* remove registration data from storage */
 	
 	manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "Peer: SIP/%s\r\nPeerStatus: Unregistered\r\nCause: Expired\r\n", peer->name);
-	register_peer_exten(peer, FALSE);
+	register_peer_exten(peer, FALSE);	/* Remove regexten */
 	peer->expire = -1;
 	ast_device_state_changed("SIP/%s", peer->name);
+
+	/* Do we need to release this peer from memory? 
+		Only for realtime peers and autocreated peers
+	*/
 	if (ast_test_flag(&peer->flags[1], SIP_PAGE2_SELFDESTRUCT) ||
 	    ast_test_flag(&peer->flags[1], SIP_PAGE2_RTAUTOCLEAR)) {
-		peer = ASTOBJ_CONTAINER_UNLINK(&peerl, peer);
-		ASTOBJ_UNREF(peer, sip_destroy_peer);
+		peer = ASTOBJ_CONTAINER_UNLINK(&peerl, peer);	/* Remove from peer list */
+		ASTOBJ_UNREF(peer, sip_destroy_peer);		/* Remove from memory */
 	}
 
 	return 0;



More information about the asterisk-commits mailing list