[asterisk-commits] mmichelson: trunk r151428 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 21 18:27:46 CDT 2008


Author: mmichelson
Date: Tue Oct 21 18:27:45 2008
New Revision: 151428

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151428
Log:
If a peer uses any transport other than UDP, then MWI will
fail for that peer since sip_alloc will allocate a sip_pvt with
a default transport of UDP. This change resets the socket type
immediately after allocating the sip_pvt in sip_send_mwi_from_peer,
so that the proceeding call to create_addr_from_peer does not fail
right away. The socket data from the peer is properly copied to
the sip_pvt in create_addr_from_peer.

(closes issue #13710)
Reported by: andrew53
Patches:
      sip_notify_use_tcp.patch uploaded by andrew53 (license 519)


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=151428&r1=151427&r2=151428
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Oct 21 18:27:45 2008
@@ -20260,6 +20260,11 @@
 		/* Build temporary dialog for this message */
 		if (!(p = sip_alloc(NULL, NULL, 0, SIP_NOTIFY))) 
 			return -1;
+		/* If we don't set the socket type to 0, then create_addr_from_peer will fail immediately if the peer
+		 * uses any transport other than UDP. We set the type to 0 here and then let create_addr_from_peer copy 
+		 * the peer's socket information to the sip_pvt we just allocated
+		 */
+		p->socket.type = 0;
 		if (create_addr_from_peer(p, peer)) {
 			/* Maybe they're not registered, etc. */
 			dialog_unlink_all(p, TRUE, TRUE);




More information about the asterisk-commits mailing list