Recently encountered this assertion failure in sip_request_create() when
preparing to build an INVITE request and the request-URI is of the form:
<user>@<host>:<port> SIP/2.0
The following request-URIs do not have a problem:
<user>@<host> SIP/2.0
<user>@<host>;<any text> SIP/2.0
It is just the port specifier that sofia seems to be having trouble
parsing, even though it looks to be valid according to RFC-3261 spec.
After some digging we found that it fails in _url_d() at:
/* Check that port is really numeric or wildcard */
/* Port can be *digit, empty string or "*" */
while (*port >= '0' && *port <= '9')
port++;
if (port != url->url_port) {
if (port[0] != '\0')
return -1;
}
At this point in time, port == "<port> SIP/2.0" . The while loop skips
over the digits and stops at the space before SIP/2.0. The next two
conditionals pass and function returns -1 which leads to the assertion
failure.
A working fix for us was to change,
if (port[0] != '\0')
to,
if (port[0] != '\0' && port[0] != ' ' && port[0] != ';')
This was in sofia v.1.12.12 . I also cloned the git repo for freeswitch
and found that the same issue looks to exist in the sofia code that is help
there.
-T
--
This e-mail transmission, and any documents, files or previous e-mail
messages attached to it, may contain confidential information. If you are
not the intended recipient, or a person responsible for delivering it to
the intended recipient, you are hereby notified that any disclosure,
distribution, review, copy or use of any of the information contained in or
attached to this message is STRICTLY PROHIBITED. If you have received this
transmission in error, please immediately notify the sender by reply
e-mail, and destroy the original transmission and its attachments without
reading them or saving them to disk.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel