[asterisk-bugs] [JIRA] (ASTERISK-27963) res_pjsip: ignore Path header on INVITE

Yury Kirsanov (JIRA) noreply at issues.asterisk.org
Wed Jun 8 03:44:49 CDT 2022


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27963?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=259422#comment-259422 ] 

Yury Kirsanov commented on ASTERISK-27963:
------------------------------------------

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 at mytrunk,30)

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

[Jun  8 18:31:43]     -- Executing [s at sip-trunk-844-151:7] Dial("PJSIP/792543-00000045", "PJSIP/1008 at T273842,30") in new stack
[Jun  8 18:31:43]     -- Called PJSIP/1008 at 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 at 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 at 103.242.182.172>;tag=caca7af2-f20b-4a67-a929-c0cb56dd5cbc
[Jun  8 18:31:43] To: <sip:1008 at 185.97.201.93;rinstance=97f9c0e29d88ed2e>
[Jun  8 18:31:43] Contact: <sip:asterisk at 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 at 185.97.201.93:3766;transport=TCP;rinstance=97f9c0e29d88ed2e","qualify_frequency":"15","user_agent":"Zoiper rv2.10.8.2","expiration_time":"1654678226","outbound_proxy":""}

> res_pjsip: ignore Path header on INVITE
> ---------------------------------------
>
>                 Key: ASTERISK-27963
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27963
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip
>    Affects Versions: 15.3.0
>         Environment: fedora server 27
>            Reporter: Slava Bendersky
>              Labels: pjsip
>
> 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 at 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 at 10.30.100.27>;tag=31e196f7-7997-4bc1-ab3b-1013c5f33811
> To: <sip:101-1033 at 192.168.1.150;rinstance=13DAEF9D>
> Contact: <sip:101-1033 at 10.30.100.27:5080>
> Call-ID: 4d4146b5-a0ce-4057-9d52-dc3ef3d4a526
> CSeq: 1826 OPTIONS
> Supported: path
> Route: <sip:101-1033 at 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 at 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 at 10.30.100.27>;tag=da646822-7ac1-48de-88a9-8efb44ab5a60
> To: <sip:101-1033 at 192.168.1.150;rinstance=13DAEF9D>
> Contact: <sip:asterisk at 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}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list