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
1.6.0
Olle Johansson 18 years ago
parent 438beb3a1b
commit 49af71c100

@ -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);

Loading…
Cancel
Save