diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-20 08:41:24 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-20 08:41:24 +0000 |
commit | f011109cce0aff92037ddb70c688543980474a0c (patch) | |
tree | 7aa45171f94d75fa9be361c8d24e7129f123e29f /channels | |
parent | 9cc6c9ed4f1b3caca77f2f6700659036403df584 (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: http://svn.digium.com/svn/asterisk/trunk@61689 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 13 |
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); |