[Home]

Summary:ASTERISK-27963: res_pjsip: ignore Path header on INVITE
Reporter:Slava Bendersky (volga629)Labels:pjsip
Date Opened:2018-07-15 21:26:55Date Closed:2020-01-14 11:13:57.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:15.3.0 Frequency of
Occurrence
Constant
Related
Issues:
is related toASTERISK-25666 chan_sip: Path header is ignored
is related toASTERISK-30100 res_pjsip: Path is ignored on INVITE to endpoint
Environment:fedora server 27Attachments:
Description:PJSIP stack  INVITE not honoring Path header and not adding Route header to it. That cause send call to wrong directions. That quite critical issue
Tested on asterisk version 15.3.

{noformat}
<--- Transmitting SIP request (560 bytes) to UDP:10.30.100.41:5060 --->
OPTIONS sip:101-1033@192.168.1.150:54642;transport=tls;rinstance=13DAEF9D SIP/2.0
Via: SIP/2.0/UDP 10.30.100.27:5080;rport;branch=z9hG4bKPj99e2c53c-e091-46b1-80bc-894e989cf727
From: <sip:101-1033@10.30.100.27>;tag=31e196f7-7997-4bc1-ab3b-1013c5f33811
To: <sip:101-1033@192.168.1.150;rinstance=13DAEF9D>
Contact: <sip:101-1033@10.30.100.27:5080>
Call-ID: 4d4146b5-a0ce-4057-9d52-dc3ef3d4a526
CSeq: 1826 OPTIONS
Supported: path
Route: <sip:101-1033@10.30.100.41;transport=udp;lr> ---> Follow PATH header ( correct )
Max-Forwards: 70
User-Agent: Asterisk PBX 15.3.0
Content-Length: 0

{noformat}

The Route header is missing in the outgoing INVITE:
{noformat}
<--- Transmitting SIP request (967 bytes) to UDP:192.168.1.150:55089 --->  
INVITE sip:101-1033@192.168.1.150:55089;transport=tls;rinstance=13DAEF9D SIP/2.0
Via: SIP/2.0/UDP 10.30.100.27:5080;rport;branch=z9hG4bKPj90c1d0eb-a580-407d-add1-fe167790b687
From: "4039143" <sip:4039143@10.30.100.27>;tag=da646822-7ac1-48de-88a9-8efb44ab5a60
To: <sip:101-1033@192.168.1.150;rinstance=13DAEF9D>
Contact: <sip:asterisk@10.30.100.27:5080>
Call-ID: f1be92ad-f51d-43ec-ada3-7064cb1bf513
CSeq: 30947 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, path
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 15.3.0
Content-Type: application/sdp
Content-Length: 235

v=0
o=- 779031891 779031891 IN IP4 10.30.100.27
s=Asterisk
c=IN IP4 10.30.100.27
t=0 0
m=audio 14202 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
{noformat}
Comments:By: Asterisk Team (asteriskteam) 2018-07-15 21:26:58.387-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Slava Bendersky (volga629) 2018-07-15 21:34:32.861-0500

Steps to reproduce.

1. Create PJSIP extension
2. On top level proxy or sbc  in REGISTRAR supply Path header with Supported header:
3 Enable pjsip logger from cli
4. Astrerisk will generate Route header to OPTIONS and NOTIFY, but not for INVITE.

By: Joshua C. Colp (jcolp) 2018-07-17 04:50:05.245-0500

Are you using PJSIP_DIAL_CONTACTS? What is the complete console output?

By: Asterisk Team (asteriskteam) 2018-07-31 12:00:01.906-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines

By: Yury Kirsanov (lt_flash) 2022-06-08 03:44:26.657-0500

Hi,
Same issue with Asterisk 18.7.0 and 18.12.1, when dialing to SIP trunk Asterisk ignores PATH header and sends INVITE directly to the contact. I'm not using PJSIP_DIAL_CONTACTS, I was doing:

exten => n,1,Dial(PJSIP/12345678@mytrunk,30)

No Route: headers were added and request went straight to Contact's R-URI.

[Jun  8 18:31:43]     -- Executing [s@sip-trunk-844-151:7] Dial("PJSIP/792543-00000045", "PJSIP/1008@T273842,30") in new stack
[Jun  8 18:31:43]     -- Called PJSIP/1008@T273842
[Jun  8 18:31:43]   == Using SIP RTP Audio TOS bits 184
[Jun  8 18:31:43]   == Using SIP RTP Audio TOS bits 184 in TCLASS field.
[Jun  8 18:31:43]   == Using SIP RTP Audio CoS mark 5
[Jun  8 18:31:43] <--- Transmitting SIP request (1061 bytes) to TCP:185.97.201.93:3766 --->
[Jun  8 18:31:43] INVITE sip:1008@185.97.201.93:3766;transport=TCP;rinstance=97f9c0e29d88ed2e SIP/2.0
[Jun  8 18:31:43] Via: SIP/2.0/TCP 103.242.182.172:7060;rport;branch=z9hG4bKPja75858f5-3c01-4270-a281-6d321d12af76;alias
[Jun  8 18:31:43] From: "3" <sip:1006@103.242.182.172>;tag=caca7af2-f20b-4a67-a929-c0cb56dd5cbc
[Jun  8 18:31:43] To: <sip:1008@185.97.201.93;rinstance=97f9c0e29d88ed2e>
[Jun  8 18:31:43] Contact: <sip:asterisk@103.242.182.172:7060;transport=TCP>
[Jun  8 18:31:43] Call-ID: 2acded7f-d758-4149-9f90-8cae79a5fec8
[Jun  8 18:31:43] CSeq: 5950 INVITE
[Jun  8 18:31:43] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[Jun  8 18:31:43] Supported: 100rel, replaces, norefersub, histinfo
[Jun  8 18:31:43] Max-Forwards: 70
[Jun  8 18:31:43] User-Agent: mPBX/1.9.21
[Jun  8 18:31:43] Content-Type: application/sdp
[Jun  8 18:31:43] Content-Length:   349
[Jun  8 18:31:43]
[Jun  8 18:31:43] v=0
[Jun  8 18:31:43] o=mPBX/1.9.21 259858751 259858751 IN IP4 103.242.182.172
[Jun  8 18:31:43] s=mPBX/1.9.21
[Jun  8 18:31:43] c=IN IP4 103.242.182.172
[Jun  8 18:31:43] t=0 0
[Jun  8 18:31:43] m=audio 16734 RTP/AVP 0 8 9 18 101
[Jun  8 18:31:43] a=rtpmap:0 PCMU/8000
[Jun  8 18:31:43] a=rtpmap:8 PCMA/8000
[Jun  8 18:31:43] a=rtpmap:9 G722/8000
[Jun  8 18:31:43] a=rtpmap:18 G729/8000
[Jun  8 18:31:43] a=fmtp:18 annexb=no
[Jun  8 18:31:43] a=rtpmap:101 telephone-event/8000
[Jun  8 18:31:43] a=fmtp:101 0-16
[Jun  8 18:31:43] a=ptime:20
[Jun  8 18:31:43] a=maxptime:150
[Jun  8 18:31:43] a=sendrecv

Database contains correct contact:

/registrar/contact/T273842;@a1886a275e520d115781af8c62e6a7db: {"via_addr":"192.168.1.107","qualify_timeout":"3.000000","call_id":"ulFj_sEMIZ3ASt4t2M7udA..","reg_server":"au-mpbx-dev-cluster2","prune_on_boot":"no","path":"<sip:10.22.23.160;r2=on;lr>,<sip:103.242.182.180:7060;transport=tcp;r2=on;lr>","endpoint":"T273842","via_port":"63450","authenticate_qualify":"yes","uri":"sip:T273842@185.97.201.93:3766;transport=TCP;rinstance=97f9c0e29d88ed2e","qualify_frequency":"15","user_agent":"Zoiper rv2.10.8.2","expiration_time":"1654678226","outbound_proxy":""}

By: Yury Kirsanov (lt_flash) 2022-06-08 03:47:04.065-0500

Can you please re-open the issue or do I need to create another ticket?

By: Joshua C. Colp (jcolp) 2022-06-08 03:52:01.334-0500

A new issue should be created, along with providing complete console output and configuration.