[asterisk-commits] twilson: branch 1.6.2 r315672 - in /branches/1.6.2: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 26 17:52:31 CDT 2011


Author: twilson
Date: Tue Apr 26 17:52:25 2011
New Revision: 315672

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=315672
Log:
Merged revisions 315671 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r315671 | twilson | 2011-04-26 15:47:56 -0700 (Tue, 26 Apr 2011) | 11 lines
  
  Make sure unregistering a peer unlinks it from the peer container
  
  Instead of mostly copying the code from expire_register, just use the function
  that "does the right thing".
  
  (closes issue #16033)
  Reported by: kkm
  Patches: 
        016033-tilgman-fixed-refcount.diff uploaded by kkm (license 888)
  Tested by: kkm, tilghman, twilson
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_sip.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=315672&r1=315671&r2=315672
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Tue Apr 26 17:52:25 2011
@@ -12797,25 +12797,10 @@
 		return PARSE_REGISTER_QUERY;
 	} else if (!strcasecmp(curi, "*") || !expire) {	/* Unregister this peer */
 		/* This means remove all registrations and return OK */
-		memset(&peer->addr, 0, sizeof(peer->addr));
-		set_socket_transport(&peer->socket, peer->default_outbound_transport);
-
 		AST_SCHED_DEL_UNREF(sched, peer->expire,
 				unref_peer(peer, "remove register expire ref"));
-
-		destroy_association(peer);
-
-		register_peer_exten(peer, FALSE);	/* Remove extension from regexten= setting in sip.conf */
-		ast_string_field_set(peer, fullcontact, "");
-		ast_string_field_set(peer, useragent, "");
-		peer->sipoptions = 0;
-		peer->lastms = 0;
-		peer->portinuri = 0;
-		pvt->expiry = 0;
-
 		ast_verb(3, "Unregistered SIP '%s'\n", peer->name);
-
-		manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Unregistered\r\n", peer->name);
+		expire_register(ref_peer(peer,"add ref for explicit expire_register"));
 		return PARSE_REGISTER_UPDATE;
 	}
 




More information about the asterisk-commits mailing list