[asterisk-bugs] [JIRA] (ASTERISK-26955) pjsip: SIP Packets with Via "received=" Containing IPv6 Address Delimited by "[]" Rejected
Sean Bright (JIRA)
noreply at issues.asterisk.org
Thu Jan 16 10:51:26 CST 2020
[ https://issues.asterisk.org/jira/browse/ASTERISK-26955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249433#comment-249433 ]
Sean Bright edited comment on ASTERISK-26955 at 1/16/20 10:50 AM:
------------------------------------------------------------------
I have [a tentative patch against Asterisk 16 for this on Gerrit|https://gerrit.asterisk.org/c/asterisk/+/13599] but I am unable to test it. It is basically the suggestion made before by [~peterdoo]. If someone could test it and report back results, that would be great.
was (Author: seanbright):
I have [a tentative patch against Asterisk 16 for this on Gerrit|https://gerrit.asterisk.org/c/asterisk/+/13599] but I am unable to test it. It is basically the suggestion made before by [~peteroo]. If someone could test it and report back results, that would be great.
> pjsip: SIP Packets with Via "received=" Containing IPv6 Address Delimited by "[]" Rejected
> ------------------------------------------------------------------------------------------
>
> Key: ASTERISK-26955
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-26955
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: pjproject/pjsip
> Affects Versions: 14.3.0
> Environment: using Asterisk on Debian 8.7, built with
> ./configure --with-pjproject-bundled
> Reporter: Peter Sokolov
> Assignee: Peter Sokolov
> Severity: Minor
>
> When using PJSIP and a SIP packet containing Via "received" with an IPv6 address delimited by "[" and "]" is received, PJSIP drops such a packet complaining about the "[" and "]". No calls can be established.
> Via: SIP/2.0/UDP [2001:db8::9:1];received=[2001:db8::9:255];branch=z9hG4bKas3-111
> RFC5118 sais that even though this is not a valid request based on a strict interpretation of the grammar in [RFC3261], robust implementations must nonetheless be able to parse the topmost Via header field and continue processing the request. I assume that Asterisk should be treated as a robust implementation.
> Channel SIP has no problems with SIP packets containing Via received= with the IPv6 address in brackets.
> Here is the relevant part of the log. Nothing comes after that. Just like the packet had not been received at all:
> {noformat}
> [Feb 4 23:21:19] ERROR[26339]: pjproject:0 <?>: sip_transport. Error processing 503 bytes packet from UDP 2a00:130:1093:2:d7ff:fe39:b8d7:123:5060 : PJSIP syntax error exception when parsing 'Via' header on line 2 col 119:
> SIP/2.0 100 Trying
> Via: SIP/2.0/UDP [2a00:123:c17:1c3f::5]:5060;rport=5060;branch=z9hG4bKPjb636b737-5c82-4238-b5ba-0d98dbe86f27;received=[2a00:123:c17:1c3f::5]
> From: "Phone 202" <sip:202@[2a00:123:c17:1c3f::5]>;tag=98eb3897-57dd-45c8-a9f2-4909c812f0a9
> To: <sip:203@[2a00:130:1093:2:d7ff:fe39:b8d7:123];uniq=C09040DC74C0F2A9D6039136CB478>
> Call-ID: d82b4318-108b-4b46-8ec9-b4e4e2200a98
> CSeq: 1012 INVITE
> User-Agent: AVM FRITZ!Box 7330 107.06.50 (Apr 1 2016)
> Content-Length: 0
> {noformat}
> In the file src/asterisk/third-party/pjproject/source/pjsip/src/pjsip/sipparser.c no brackets are included in pconst.pjsip_VIA_PARAM_SPEC and pconst.pjsip_VIA_PARAM_SPEC_ESC. Adding both brackets to both of them using pj_cis_add_str, Asterisk starts accepting SIP packets that include Via: lines as the one mentioned above, however I do not know whether that is a correct solution.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list