[svn-commits] oej: trunk r61689 - in /trunk: ./ channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Apr 20 01:41:27 MST 2007


Author: oej
Date: Fri Apr 20 03:41:24 2007
New Revision: 61689

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61689
Log:
Use the last line in the SDP, even if it has no CRLF. Remember Jon Postel :-)

This code exists in 1.2 and 1.4 but was removed from trunk for some unknown reason.

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

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

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=61689&r1=61688&r2=61689
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Apr 20 03:41:24 2007
@@ -4960,6 +4960,16 @@
 			dst[i] = c + 1; /* record start of next line */
 		}
         }
+	/* Check for last header without CRLF. The RFC for SDP requires CRLF,
+	   but since some devices send without, we'll be generous in what we accept.
+	*/
+	if (!ast_strlen_zero(dst[i])) {
+		if (sipdebug && option_debug > 3)
+			ast_log(LOG_DEBUG, "%7s %2d [%3d]: %s\n",
+				req->headers < 0 ? "Header" : "Body",
+				i, (int)strlen(dst[i]), dst[i]);
+		i++;
+	}
 	/* update count of header or body lines */
 	if (req->headers >= 0)	/* we are in the body */
 		req->lines = i;
@@ -15098,6 +15108,9 @@
 	else if (ast_strlen_zero(p->context))
 		ast_string_field_set(p, context, default_context);
 
+	/* Get full contact header - this needs to be used as a request URI in NOTIFY's */
+	parse_ok_contact(p, req);
+
 	build_contact(p);
 	if (gotdest) {
 		transmit_response(p, "404 Not Found", req);



More information about the svn-commits mailing list