[asterisk-commits] mjordan: trunk r340166 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 10 15:39:43 CDT 2011


Author: mjordan
Date: Mon Oct 10 15:39:39 2011
New Revision: 340166

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

................
  r340165 | mjordan | 2011-10-10 15:30:18 -0500 (Mon, 10 Oct 2011) | 20 lines
  
  Merged revisions 340164 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r340164 | mjordan | 2011-10-10 15:23:48 -0500 (Mon, 10 Oct 2011) | 13 lines
    
    Updated chan_sip to place calls on hold if SDP address in INVITE is ANY
    
    This patch fixes the case where an INVITE is received with c=0.0.0.0 or ::.
    In this case, the call should be placed on hold.  Previously, we checked for
    the address being null; this patch keeps that behavior but also checks for
    the ANY IP addresses.
    
    Review: https://reviewboard.asterisk.org/r/1504/
    
    (closes issue ASTERISK-18086)
    Reported by: James Bottomley
    Tested by: Matt Jordan
  ........
................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=340166&r1=340165&r2=340166
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Oct 10 15:39:39 2011
@@ -8666,6 +8666,17 @@
 	return 0;
 }
 
+/*! \internal
+ * \brief Returns whether or not the address is null or ANY / unspecified (0.0.0.0 or ::)
+ * \retval TRUE if the address is null or any
+ * \retval FALSE if the address it not null or any
+ * \note In some circumstances, calls should be placed on hold if either of these conditions exist.
+ */
+static int sockaddr_is_null_or_any(const struct ast_sockaddr *addr)
+{
+	return ast_sockaddr_isnull(addr) || ast_sockaddr_is_any(addr);
+}
+
 /*! \brief Process SIP SDP offer, select formats and activate RTP channels
 	If offer is rejected, we will not change any properties of the call
  	Return 0 on success, a negative value on errors.
@@ -9283,7 +9294,7 @@
 		/* Activate a re-invite */
 		ast_queue_frame(p->owner, &ast_null_frame);
 		change_hold_state(p, req, FALSE, sendonly);
-	} else if ((ast_sockaddr_isnull(sa) && ast_sockaddr_isnull(vsa) && ast_sockaddr_isnull(tsa) && ast_sockaddr_isnull(isa)) || (sendonly && sendonly != -1)) {
+	} else if ((sockaddr_is_null_or_any(sa) && sockaddr_is_null_or_any(vsa) && sockaddr_is_null_or_any(tsa) && sockaddr_is_null_or_any(isa)) || (sendonly && sendonly != -1)) {
 		ast_queue_control_data(p->owner, AST_CONTROL_HOLD,
 				       S_OR(p->mohsuggest, NULL),
 				       !ast_strlen_zero(p->mohsuggest) ? strlen(p->mohsuggest) + 1 : 0);




More information about the asterisk-commits mailing list