[asterisk-bugs] [JIRA] (ASTERISK-29194) PJSIP

Mark Murawski (JIRA) noreply at issues.asterisk.org
Thu Dec 3 15:28:16 CST 2020


Mark Murawski created ASTERISK-29194:
----------------------------------------

             Summary: PJSIP
                 Key: ASTERISK-29194
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29194
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Channels/chan_pjsip
    Affects Versions: 16.15.0
            Reporter: Mark Murawski
            Severity: Blocker


In certain situations PJSIP does not respect local_net settings

Given the following setup:

21005            | endpoint/force_rport            | yes
21005            | endpoint/log_subscription_error | no
21005            | endpoint/rewrite_contact        | yes
21005            | endpoint/rtp_symmetric          | yes


[transport-udp-lo]
type                       = transport
protocol                   = udp
bind                       = 127.0.0.1:5060
external_media_address     = 127.0.0.1
external_signaling_address = 127.0.0.1
external_signaling_port    = 5060
allow_reload               = yes
tos                        = cs3
cos                        = 3

[transport-udp-tun0]
type                       = transport
protocol                   = udp
bind                       = 10.1.2.20:5060
external_media_address     = 10.1.2.20
external_signaling_address = 10.1.2.20
external_signaling_port    = 5060
allow_reload               = yes
tos                        = cs3
cos                        = 3
local_net                  = 10.1.2.0/24

[transport-udp-tun1]
type                       = transport
protocol                   = udp
bind                       = 10.3.2.20:5060
external_media_address     = 10.3.2.20
external_signaling_address = 10.3.2.20
external_signaling_port    = 5060
allow_reload               = yes
tos                        = cs3
cos                        = 3
local_net                  = 10.3.2.0/24


And traffic coming into transport-udp-tun1
15:36:45.656238 IP 10.3.2.1.5060 > 10.3.2.20.5060: SIP: INVITE sip:*1234 at 10.3.2.20:5060;user=phone SIP/2.0
E`..B%..>...
...
...........INVITE sip:*1234 at 10.3.2.20:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.50.206;branch=z9hG4bKe661cfb7BD8F7712
From: "21005" <sip:21005 at 10.3.2.20>;tag=9BA63BB1-914B7CEC
To: <sip:*1234 at 10.3.2.20;user=phone>
CSeq: 1 INVITE
Call-ID: cfd9c5fd-64b01f78-fa86f683 at 192.168.50.206
Contact: <sip:21005 at 192.168.50.206>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_550-UA/4.0.15.1009
Accept-Language: en
Supported: 100rel,replaces
Allow-Events: conference,talk,hold
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 298

v=0
o=- 1607027804 1607027804 IN IP4 192.168.50.206
s=Polycom IP Phone
c=IN IP4 192.168.50.206
t=0 0
a=sendrecv
m=audio 2228 RTP/AVP 9 0 8 18 127
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:127 telephone-event/8000

15:36:45.657358 IP 10.3.2.20.5060 > 10.3.2.1.5060: SIP: SIP/2.0 401 Unauthorized
E`.Ry. at .@...
...
........>"#SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.50.206;rport=5060;received=10.3.2.1;branch=z9hG4bKe661cfb7BD8F7712
Call-ID: cfd9c5fd-64b01f78-fa86f683 at 192.168.50.206
From: "21005" <sip:21005 at 10.3.2.20>;tag=9BA63BB1-914B7CEC
To: <sip:*1234 at 10.3.2.20;user=phone>;tag=z9hG4bKe661cfb7BD8F7712
CSeq: 1 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1607027805/57d9f055573ea588c2beb1f03c8e2bca",opaque="345e83785480fbf0",algorithm=md5,qop="auth"
Server: Asterisk PBX 16.15.0
Content-Length:  0


15:36:45.698544 IP 10.3.2.1.5060 > 10.3.2.20.5060: SIP: ACK sip:*1234 at 10.3.2.20:5060;user=phone SIP/2.0
E`.GB&..>. .
...
........3j.ACK sip:*1234 at 10.3.2.20:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.50.206;branch=z9hG4bKe661cfb7BD8F7712
From: "21005" <sip:21005 at 10.3.2.20>;tag=9BA63BB1-914B7CEC
To: <sip:*1234 at 10.3.2.20;user=phone>;tag=z9hG4bKe661cfb7BD8F7712
CSeq: 1 ACK
Call-ID: cfd9c5fd-64b01f78-fa86f683 at 192.168.50.206
Contact: <sip:21005 at 192.168.50.206>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_550-UA/4.0.15.1009
Accept-Language: en
Max-Forwards: 70
Content-Length: 0


15:36:45.698568 IP 10.3.2.1.5060 > 10.3.2.20.5060: SIP: INVITE sip:*1234 at 10.3.2.20:5060;user=phone SIP/2.0
E`..B'..>..n
...
..........6INVITE sip:*1234 at 10.3.2.20:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.50.206;branch=z9hG4bK3302ce1eA5B33949
From: "21005" <sip:21005 at 10.3.2.20>;tag=9BA63BB1-914B7CEC
To: <sip:*1234 at 10.3.2.20;user=phone>
CSeq: 2 INVITE
Call-ID: cfd9c5fd-64b01f78-fa86f683 at 192.168.50.206
Contact: <sip:21005 at 192.168.50.206>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_550-UA/4.0.15.1009
Accept-Language: en
Supported: 100rel,replaces
Allow-Events: conference,talk,hold
Authorization: Digest username="21005", realm="asterisk", nonce="1607027805/57d9f055573ea588c2beb1f03c8e2bca", qop=auth, cnonce="hTWM3tpAkuCZjNC", nc=00000001, opaque="345e83785480fbf0", uri="sip:*1234 at 10.3.2.20:5060;user=phone", response="7e4d360452dbfdf02c7297786403e104", algorithm=MD5
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 298

v=0
o=- 1607027804 1607027804 IN IP4 192.168.50.206
s=Polycom IP Phone
c=IN IP4 192.168.50.206
t=0 0
a=sendrecv
m=audio 2228 RTP/AVP 9 0 8 18 127
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:127 telephone-event/8000

15:36:45.701474 IP 10.3.2.20.5060 > 10.3.2.1.5060: SIP: SIP/2.0 100 Trying
E`..y3 at .@...
...
...........SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.50.206;rport=5060;received=10.3.2.1;branch=z9hG4bK3302ce1eA5B33949
Call-ID: cfd9c5fd-64b01f78-fa86f683 at 192.168.50.206
From: "21005" <sip:21005 at 10.3.2.20>;tag=9BA63BB1-914B7CEC
To: <sip:*1234 at 10.3.2.20;user=phone>
CSeq: 2 INVITE
Server: Asterisk PBX 16.15.0
Content-Length:  0


15:36:45.716260 IP 10.3.2.20.5060 > 10.3.2.1.5060: SIP: SIP/2.0 200 OK
E`..y4 at .@...
...
.........v.SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.50.206;rport=5060;received=10.3.2.1;branch=z9hG4bK3302ce1eA5B33949
Call-ID: cfd9c5fd-64b01f78-fa86f683 at 192.168.50.206
From: "21005" <sip:21005 at 10.3.2.20>;tag=9BA63BB1-914B7CEC
To: <sip:*1234 at 10.3.2.20;user=phone>;tag=9e82c96e-4b35-4ac9-a055-21970e96c5fd
CSeq: 2 INVITE
Server: Asterisk PBX 16.15.0
Contact: <sip:1.2.3.4:5060>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length:   255

v=0
o=- 1607027804 1607027806 IN IP4 10.3.2.20
s=Asterisk
c=IN IP4 10.3.2.20
t=0 0
m=audio 16430 RTP/AVP 0 8 127
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:127 telephone-event/8000
a=fmtp:127 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

------------------

The following occurs:
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030925, ts 006080, len 000160)
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030926, ts 006240, len 000160)
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030927, ts 006400, len 000160)
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030928, ts 006560, len 000160)
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030929, ts 006720, len 000160)
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030930, ts 006880, len 000160)
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030931, ts 007040, len 000160)
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030932, ts 007200, len 000160)
Sent RTP packet to      192.168.50.206:2228 (type 00, seq 030933, ts 007360, len 000160)

Instead of sending to the expected rewrite_contact of 10.3.2.1



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



More information about the asterisk-bugs mailing list