summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2007-04-20 08:41:24 +0000
committerOlle Johansson <oej@edvina.net>2007-04-20 08:41:24 +0000
commit49af71c100bb7ed62e1ccf4d235ccdb5579ee7d2 (patch)
tree7aa45171f94d75fa9be361c8d24e7129f123e29f /channels/chan_sip.c
parent438beb3a1bef36b135d321ee912f416beaf86abf (diff)
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 28ae6a386..b2c775124 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4960,6 +4960,16 @@ static void parse_request(struct sip_request *req)
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 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
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);