Pjsip asterisk 16 + pjsip - ip rtp wrong multi internet link


#1

Hello, I have a situation with Asterisk 16 + PJSIP

I have two transports UDP

[transport-udp]
allow_reload=yes
type=transport
protocol=udp
external_media_address=131.196.196.1
external_signaling_address=131.196.196.1
bind=131.196.196.1

[transport-udp2]
allow_reload=yes
type=transport
protocol=udp
external_media_address=191.240.240.1
external_signaling_address=191.240.240.1
bind=191.240.240.1

When I sending “register” for transport udp its OK, if sending to transport-udp2 its ok too
So for registers is perfect. I can “register” Endpoints with first IP or second IP. This a perfect transation.

This example sending “register” to transport-udp. this Ips its perfects.

2019/02/09 22:04:56.331787 191.183.200.106:30809 -> 131.196.196.1:5060
REGISTER sip:131.196.196.1 SIP/2.0
Via: SIP/2.0/UDP 191.183.200.106:30809;branch=z9hG4bKPj9cd1qIH5G53nYxT71AODfLOnXnoeEhua;rport
Call-ID: 5NLrIlvmZpxKdav3WbczsBRcj2iveV5b
From: "9301"sip:9301@131.196.196.1;tag=-t3aVx2ucGZnAKFoQ.zez7jNmY.dxIT2
To: "9301"sip:9301@131.196.196.1
CSeq: 64469 REGISTER
Max-Forwards: 70
User-Agent: Telephone 1.4
Contact: "9301"sip:9301@191.183.200.106:30809;ob
Expires: 300
Allow: PRACK,INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Content-Length: 0

2019/02/09 22:04:56.332359 131.196.196.1:5060 -> 191.183.200.106:30809
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 191.183.200.106:30809;rport=30809;received=191.183.200.106;branch=z9hG4bKPj9cd1qIH5G53nYxT71AODfLOnXnoeEhua
Call-ID: 5NLrIlvmZpxKdav3WbczsBRcj2iveV5b
From: “9301” sip:9301@131.196.196.1;tag=-t3aVx2ucGZnAKFoQ.zez7jNmY.dxIT2
To: “9301” sip:9301@131.196.196.1;tag=z9hG4bKPj9cd1qIH5G53nYxT71AODfLOnXnoeEhua
CSeq: 64469 REGISTER
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1549757096/12d8a4a264d6fbf922f3ab5fcad9812f”,opaque=“45eeacac462e24e4”,algorithm
d5,qop=“auth”
Server: Asterisk
Content-Length: 0

2019/02/09 22:04:56.351582 191.183.200.106:30809 -> 131.196.196.1:5060
REGISTER sip:131.196.196.1 SIP/2.0
Via: SIP/2.0/UDP 191.183.200.106:30809;branch=z9hG4bKPjN0aakl-I.ECVDNZN4tOL.DNT4Bi6k4b2;rport
Call-ID: 5NLrIlvmZpxKdav3WbczsBRcj2iveV5b
From: "9301"sip:9301@131.196.196.1;tag=-t3aVx2ucGZnAKFoQ.zez7jNmY.dxIT2
To: "9301"sip:9301@131.196.196.1
CSeq: 64470 REGISTER
Max-Forwards: 70
User-Agent: Telephone 1.4
Contact: "9301"sip:9301@191.183.200.106:30809;ob
Expires: 300
Allow: PRACK,INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Authorization: Digest username=“9301”,realm=“asterisk”,nonce=“1549757096/12d8a4a264d6fbf922f3ab5fcad9812f”,uri=“sip:131.196.196.1”
esponse=“01fc436c5d62f77f70047687b695e239”,algorithm=MD5,cnonce=“FRvrEugChXCpgpuJpPGIe3tL3WyGuzQ.”,opaque=“45eeacac462e24e4”,qo
auth,nc=00000001
Content-Length: 0

2019/02/09 22:04:56.352856 131.196.196.1:5060 -> 191.183.200.106:30809
SIP/2.0 200 OK
Via: SIP/2.0/UDP 191.183.200.106:30809;rport=30809;received=191.183.200.106;branch=z9hG4bKPjN0aakl-I.ECVDNZN4tOL.DNT4Bi6k4b2
Call-ID: 5NLrIlvmZpxKdav3WbczsBRcj2iveV5b
From: “9301” sip:9301@131.196.196.1;tag=-t3aVx2ucGZnAKFoQ.zez7jNmY.dxIT2
To: “9301” sip:9301@131.196.196.1;tag=z9hG4bKPjN0aakl-I.ECVDNZN4tOL.DNT4Bi6k4b2
CSeq: 64470 REGISTER
Date: Sun, 10 Feb 2019 00:04:56 GMT
Contact: sip:9301@191.240.154.236:30809;ob;expires=299
Expires: 300
Server: Asterisk
Content-Length: 0

Now When I make a call in 200OK the asterisk sending wrong IP
Look the 200 OK, have wrong IP. Have IP from transport-udp2 191.240.240.1 and not 131.196.196.1,

100 trying , invite all its correct , but 200 OK change IP for RTP.

2019/02/09 22:09:18.084801 191.183.200.106:30809 -> 131.196.196.1:5060
INVITE sip:*570@131.196.196.1 SIP/2.0
Via: SIP/2.0/UDP 191.183.200.106:30809;branch=z9hG4bKPj86WtUXyJ4oVBhxoyjLWJL488O0Qy8uWt;rport
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
From: "9301"sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
To: sip:*570@131.196.196.1
CSeq: 32125 INVITE
Max-Forwards: 70
Contact: "9301"sip:9301@191.183.200.106:30809;ob
Allow: PRACK,INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Supported: replaces,100rel,norefersub
User-Agent: Telephone 1.4
Content-Length: 550
Content-Type: application/sdp

v=0
o=- 3758746158 3758746158 IN IP4 191.183.200.106
s=pjmedia
b=AS:117
t=0 0
a=X-nat:0
m=audio 30950 RTP/AVP 103 102 104 125 109 3 8 0 9 101
c=IN IP4 191.183.200.106
b=TIAS:96000
a=rtcp:4001 IN IP4 100.66.137.102
a=sendrecv
a=rtpmap:103 speex/16000
a=rtpmap:102 speex/8000
a=rtpmap:104 speex/32000
a=rtpmap:125 opus/48000/2
a=fmtp:125 useinbandfec=1
a=rtpmap:109 iLBC/8000
a=fmtp:109 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16

2019/02/09 22:09:18.085380 131.196.196.1:5060 -> 191.183.200.106:30809
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 191.183.200.106:30809;rport=30809;received=191.183.200.106;branch=z9hG4bKPj86WtUXyJ4oVBhxoyjLWJL488O0Qy8uWt
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
From: “9301” sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
To: sip:*570@131.196.196.1;tag=z9hG4bKPj86WtUXyJ4oVBhxoyjLWJL488O0Qy8uWt
CSeq: 32125 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1549757358/cbf38390366b32b8f1fc5ea5767124f4”,opaque=“3bfdc0a57b7db867”,algorithm
d5,qop=“auth”
Server: Asterisk
Content-Length: 0

2019/02/09 22:09:18.100727 191.183.200.106:30809 -> 131.196.196.1:5060
ACK sip:*570@131.196.196.1 SIP/2.0
Via: SIP/2.0/UDP 191.183.200.106:30809;branch=z9hG4bKPj86WtUXyJ4oVBhxoyjLWJL488O0Qy8uWt;rport
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
From: "9301"sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
To: sip:*570@131.196.196.1;tag=z9hG4bKPj86WtUXyJ4oVBhxoyjLWJL488O0Qy8uWt
CSeq: 32125 ACK
Max-Forwards: 70
Content-Length: 0

2019/02/09 22:09:18.106888 191.183.200.106:30809 -> 131.196.196.1:5060
INVITE sip:*570@131.196.196.1 SIP/2.0
Via: SIP/2.0/UDP 191.183.200.106:30809;branch=z9hG4bKPjpV3fzj5XHXAbJkYs3R0X5T.IJlKjbzya;rport
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
From: "9301"sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
To: sip:*570@131.196.196.1
CSeq: 32126 INVITE
Max-Forwards: 70
Contact: "9301"sip:9301@191.183.200.106:30809;ob
Allow: PRACK,INVITE,ACK,BYE,CANCEL,UPDATE,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,OPTIONS
Supported: replaces,100rel,norefersub
User-Agent: Telephone 1.4
Authorization: Digest username=“9301”,realm=“asterisk”,nonce=“1549757358/cbf38390366b32b8f1fc5ea5767124f4”,uri=“sip:*570@131.196.2
.2”,response=“d881c96da3d2e23736517902b023d743”,algorithm=MD5,cnonce=“v4Uz0THMfODAXG6MO4P8g.qaoMOCuS.l”,opaque="3bfdc0a57b7db86
,qop=auth,nc=00000001
Content-Length: 550
Content-Type: application/sdp
v=0
o=- 3758746158 3758746158 IN IP4 191.183.200.106
s=pjmedia
b=AS:117
t=0 0
a=X-nat:0
m=audio 30950 RTP/AVP 103 102 104 125 109 3 8 0 9 101
c=IN IP4 191.183.200.106
b=TIAS:96000
a=rtcp:4001 IN IP4 100.66.137.102
a=sendrecv
a=rtpmap:103 speex/16000
a=rtpmap:102 speex/8000
a=rtpmap:104 speex/32000
a=rtpmap:125 opus/48000/2
a=fmtp:125 useinbandfec=1
a=rtpmap:109 iLBC/8000
a=fmtp:109 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16

2019/02/09 22:09:18.107849 131.196.196.1:5060 -> 191.183.200.106:30809
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 191.183.200.106:30809;rport=30809;received=191.183.200.106;branch=z9hG4bKPjpV3fzj5XHXAbJkYs3R0X5T.IJlKjbzya
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
From: “9301” sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
To: sip:*570@131.196.196.1
CSeq: 32126 INVITE
Server: Asterisk
Content-Length: 0

2019/02/09 22:09:18.109945 131.196.196.1:5060 -> 191.183.200.106:30809
SIP/2.0 200 OK
Via: SIP/2.0/UDP 191.183.200.106:30809;rport=30809;received=191.183.200.106;branch=z9hG4bKPjpV3fzj5XHXAbJkYs3R0X5T.IJlKjbzya
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
From: “9301” sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
To: sip:*570@131.196.196.1;tag=ff6dfa6a-4606-4ae0-a459-efb23916d8da
CSeq: 32126 INVITE
Server: Asterisk
Contact: sip:131.196.196.1:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE, REFER
Supported: timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 274

v=0
o=- 3758746158 3758746160 IN IP4 191.240.240.1
s=Asterisk_asterisk
c=IN IP4 191.240.240.1
t=0 0
m=audio 16232 RTP/AVP 8 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

2019/02/09 22:09:18.126025 191.183.200.106:30809 -> 131.196.196.1:5060
ACK sip:131.196.196.1:5060 SIP/2.0
Via: SIP/2.0/UDP 191.183.200.106:30809;branch=z9hG4bKPjv0S-ogU4oXLDEw2ZSbwrQHGFTQSSl1lK;rport
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
From: "9301"sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
To: sip:*570@131.196.196.1;tag=ff6dfa6a-4606-4ae0-a459-efb23916d8da
CSeq: 32126 ACK
Max-Forwards: 70
Content-Length: 0

2019/02/09 22:09:21.578746 131.196.196.1:5060 -> 191.183.200.106:30809
BYE sip:9301@191.183.200.106:30809;ob SIP/2.0
Via: SIP/2.0/UDP 131.196.196.1:5060;rport;branch=z9hG4bKPj36dae498-6a57-44c9-ac23-c2cd17a97303
From: sip:*570@131.196.196.1;tag=ff6dfa6a-4606-4ae0-a459-efb23916d8da
To: “9301” sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
CSeq: 19658 BYE
Reason: Q.850;cause=16
Max-Forwards: 70
User-Agent: Asterisk
Content-Length: 0

2019/02/09 22:09:21.596087 191.183.200.106:30809 -> 131.196.196.1:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP 131.196.196.1:5060;branch=z9hG4bKPj36dae498-6a57-44c9-ac23-c2cd17a97303;received=131.196.196.1;rport=5060
Call-ID: Fw9.9Oc9xNnP4-FuLtAnnrmVe.kI7sC8
From: sip:*570@131.196.196.1;tag=ff6dfa6a-4606-4ae0-a459-efb23916d8da
To: "9301"sip:9301@131.196.196.1;tag=SNs-tcdNv4E-W6RJhE6GHgfs4YlXz-7f
CSeq: 19658 BYE
Content-Length: 0