[asterisk-commits] rmudgett: trunk r312868 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 5 10:40:45 CDT 2011


Author: rmudgett
Date: Tue Apr  5 10:40:38 2011
New Revision: 312868

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

........
  r312866 | rmudgett | 2011-04-05 10:38:14 -0500 (Tue, 05 Apr 2011) | 15 lines
  
  Responding to OPTIONS packet with 404 because Asterisk not looking for "s" extension.
  
  The get_destination() function was not using the "s" extension when the
  request URI did not specify an extension.  This is a regression caused
  when the URI parsing code was extracted into parse_uri().
  
  Made get_destination() substitute the "s" extension when the parsed URI
  results in an empty string.
  
  (closes issue #18348)
  Reported by: shmaize
  Patches:
        issue18348_v1.8.patch uploaded by rmudgett (license 664)
  Tested by: shmaize
........

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

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-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=312868&r1=312867&r2=312868
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Apr  5 10:40:38 2011
@@ -14656,16 +14656,20 @@
 	return 0;
 }
 
-/*! \brief Find out who the call is for.
-	We use the request uri as a destination.
-	This code assumes authentication has been done, so that the
-	device (peer/user) context is already set.
-	\return 0 on success (found a matching extension), non-zero on failure
-
-  \note If the incoming uri is a SIPS: uri, we are required to carry this across
-	the dialplan, so that the outbound call also is a sips: call or encrypted
-	IAX2 call. If that's not available, the call should FAIL.
-*/
+/*!
+ * \brief Find out who the call is for.
+ *
+ * \details
+ * We use the request uri as a destination.
+ * This code assumes authentication has been done, so that the
+ * device (peer/user) context is already set.
+ *
+ * \return 0 on success (found a matching extension), non-zero on failure
+ *
+ * \note If the incoming uri is a SIPS: uri, we are required to carry this across
+ * the dialplan, so that the outbound call also is a sips: call or encrypted
+ * IAX2 call. If that's not available, the call should FAIL.
+ */
 static enum sip_get_dest_result get_destination(struct sip_pvt *p, struct sip_request *oreq, int *cc_recall_core_id)
 {
 	char tmp[256] = "", *uri, *domain, *dummy = NULL;
@@ -14691,6 +14695,14 @@
 
 	SIP_PEDANTIC_DECODE(domain);
 	SIP_PEDANTIC_DECODE(uri);
+	if (ast_strlen_zero(uri)) {
+		/*
+		 * Either there really was no extension found or the request
+		 * URI had encoded nulls that made the string "empty".  Use "s"
+		 * as the extension.
+		 */
+		uri = "s";
+	}
 
 	ast_string_field_set(p, domain, domain);
 




More information about the asterisk-commits mailing list