[SR-Users] Kamailio + Asterisk + Voip SIP Trunk = Incorrect IP on ACK
Luciano Motti
luciano.motti at gmail.com
Thu Apr 7 21:27:37 CEST 2022
Hello!
I have the following architecture:
- Kamailio with RTPEngine (with public access on IP *YY.YY.42.207*)
- Asterisk (with no public access, internal IP *172.31.69.198*)
I am using a Voip SIP (with public access on IP *54.XXX.XXX.44*) configured
as a Trunk on Kamailio using UAC Module.
The issue I am facing is that the SIP messages replies I get from the VOIP
provider are being destined to Kamailio's public IP (YY.YY.42.207) instead
of Asterisk's IP (as sent on the message).
For example, this is the 200 message I sent to the VOIP provider (I clearly
state that the contact is Asterisk sip:172.31.69.198:5080):
2022/04/07 14:17:19.260864 172.31.32.7:5060 -> 54.XXX.XXX.44:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.0
Record-Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
CSeq: 50116727 INVITE
Server: Asterisk PBX 18.11.0
*Contact: <sip:172.31.69.198:5080 <http://172.31.69.198:5080>>*
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: 239
v=0
o=- 1649321756 1649321759 IN IP4 172.31.69.198
s=Asterisk
c=IN IP4 172.31.69.198
t=0 0
m=audio 10010 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
But the ACK I get from them is destined to Kamailio instead of Asterisk:
2022/04/07 14:17:19.263469 54.XXX.XXX.44:5060 -> 172.31.32.7:5060
*ACK sip:YY.YY.42.207:5060 SIP/2.0*
Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;branch=z9hG4bK90b6.f7a6b0a4.2
Max-Forwards: 69
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
CSeq: 50116727 ACK
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Content-Length: 0
This causes Kamailio to not know where to forward the message to...
Asterisk never gets the reply.
This is happening to one of the SIP Trunks I am using, with the other,
everything is fine.
Is there anything I can do to work around it (other than contacting the
provider to fix on their end)?
Thanks!
ps: I have attached the full SIP messages trail to help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220407/146e801d/attachment.htm>
-------------- next part --------------
2022/04/07 14:17:19.044923 54.XXX.XXX.44:5060 -> 172.31.32.7:5060
INVITE sip:ST_6F2E6A_WK0SVX at sip.zzz.com:5060 SIP/2.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;branch=z9hG4bK90b6.f7a6b0a4.0
Max-Forwards: 66
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
User-Agent: voip SBC v2.0
CSeq: 50116727 INVITE
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 248
X-SessionId: 1743845685
X-UUID: d9582c1a-9320-42b7-9755-d9479a0d54fd
X-ACCOUNTID: 33563
X-URADID: 5541XXXX7941
X-NUMBERSIP: 419XXXXX998
Remote-Party-ID: "419XXXXX998" <sip:419XXXXX998 at 172.31.32.169>;party=calling;screen=yes;privacy=off
v=0
o=FreeSWITCH 1649321756 1649321757 IN IP4 54.XXX.XXX.44
s=FreeSWITCH
c=IN IP4 54.XXX.XXX.44
t=0 0
m=audio 25820 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
a=rtcp:25821
a=ptime:20
2022/04/07 14:17:19.045805 172.31.32.7:5060 -> 54.XXX.XXX.44:5060
SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;branch=z9hG4bK90b6.f7a6b0a4.0;rport=5060
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
CSeq: 50116727 INVITE
Server: kamailio (5.3.9 (x86_64/linux))
Content-Length: 0
2022/04/07 14:17:19.046036 172.31.32.7:5060 -> 172.31.69.198:5080
INVITE sip:ST_6F2E6A_WK0SVX at sip.zzz.com:5060 SIP/2.0
Record-Route: <sip:YY.YY.42.207;lr=on;ftag=p0BjH21gpa3rc>
Via: SIP/2.0/UDP YY.YY.42.207;branch=z9hG4bK90b6.9882e2c962c15b748ba340216ba106c2.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.0
Max-Forwards: 65
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
User-Agent: voip SBC v2.0
CSeq: 50116727 INVITE
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 248
X-SessionId: 1743845685
X-UUID: d9582c1a-9320-42b7-9755-d9479a0d54fd
X-ACCOUNTID: 33563
X-URADID: 5541XXXX7941
X-NUMBERSIP: 419XXXXX998
Remote-Party-ID: "419XXXXX998" <sip:419XXXXX998 at 172.31.32.169>;party=calling;screen=yes;privacy=off
v=0
o=FreeSWITCH 1649321756 1649321757 IN IP4 54.XXX.XXX.44
s=FreeSWITCH
c=IN IP4 54.XXX.XXX.44
t=0 0
m=audio 25820 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
a=rtcp:25821
a=ptime:20
2022/04/07 14:17:19.047742 172.31.69.198:5080 -> 172.31.32.7:5060
SIP/2.0 100 Trying
Via: SIP/2.0/UDP YY.YY.42.207;rport=5060;received=172.31.32.7;branch=z9hG4bK90b6.9882e2c962c15b748ba340216ba106c2.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.0
Record-Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>
CSeq: 50116727 INVITE
Server: Asterisk PBX 18.11.0
Content-Length: 0
2022/04/07 14:17:19.260615 172.31.69.198:5080 -> 172.31.32.7:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP YY.YY.42.207;rport=5060;received=172.31.32.7;branch=z9hG4bK90b6.9882e2c962c15b748ba340216ba106c2.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.0
Record-Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
CSeq: 50116727 INVITE
Server: Asterisk PBX 18.11.0
Contact: <sip:172.31.69.198:5080>
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: 239
v=0
o=- 1649321756 1649321759 IN IP4 172.31.69.198
s=Asterisk
c=IN IP4 172.31.69.198
t=0 0
m=audio 10010 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
2022/04/07 14:17:19.260864 172.31.32.7:5060 -> 54.XXX.XXX.44:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.0
Record-Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
CSeq: 50116727 INVITE
Server: Asterisk PBX 18.11.0
Contact: <sip:172.31.69.198:5080>
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: 239
v=0
o=- 1649321756 1649321759 IN IP4 172.31.69.198
s=Asterisk
c=IN IP4 172.31.69.198
t=0 0
m=audio 10010 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
2022/04/07 14:17:19.263469 54.XXX.XXX.44:5060 -> 172.31.32.7:5060
ACK sip:YY.YY.42.207:5060 SIP/2.0
Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;branch=z9hG4bK90b6.f7a6b0a4.2
Max-Forwards: 69
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
CSeq: 50116727 ACK
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Content-Length: 0
2022/04/07 14:17:19.264062 172.31.32.7:5060 -> YY.YY.42.207:5060
ACK sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc SIP/2.0
Via: SIP/2.0/UDP YY.YY.42.207;branch=z9hG4bK90b6.b67a9d126cb84546ec6dcda62d71b726.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.2
Max-Forwards: 68
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
CSeq: 50116727 ACK
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Content-Length: 0
2022/04/07 14:17:19.264124 YY.YY.42.207:5060 -> 172.31.32.7:5060
ACK sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc SIP/2.0
Via: SIP/2.0/UDP YY.YY.42.207;branch=z9hG4bK90b6.b67a9d126cb84546ec6dcda62d71b726.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.2
Max-Forwards: 68
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
CSeq: 50116727 ACK
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Content-Length: 0
2022/04/07 14:17:19.761546 172.31.69.198:5080 -> 172.31.32.7:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP YY.YY.42.207;rport=5060;received=172.31.32.7;branch=z9hG4bK90b6.9882e2c962c15b748ba340216ba106c2.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.0
Record-Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
CSeq: 50116727 INVITE
Server: Asterisk PBX 18.11.0
Contact: <sip:172.31.69.198:5080>
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: 239
v=0
o=- 1649321756 1649321759 IN IP4 172.31.69.198
s=Asterisk
c=IN IP4 172.31.69.198
t=0 0
m=audio 10010 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
2022/04/07 14:17:19.761730 172.31.32.7:5060 -> 54.XXX.XXX.44:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.0
Record-Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
CSeq: 50116727 INVITE
Server: Asterisk PBX 18.11.0
Contact: <sip:172.31.69.198:5080>
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: 239
v=0
o=- 1649321756 1649321759 IN IP4 172.31.69.198
s=Asterisk
c=IN IP4 172.31.69.198
t=0 0
m=audio 10010 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
2022/04/07 14:17:19.763174 54.XXX.XXX.44:5060 -> 172.31.32.7:5060
ACK sip:YY.YY.42.207:5060 SIP/2.0
Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc>
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;branch=z9hG4bK90b6.f7a6b0a4.2
Max-Forwards: 69
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
CSeq: 50116727 ACK
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Content-Length: 0
2022/04/07 14:17:19.763797 172.31.32.7:5060 -> YY.YY.42.207:5060
ACK sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc SIP/2.0
Via: SIP/2.0/UDP YY.YY.42.207;branch=z9hG4bK90b6.b67a9d126cb84546ec6dcda62d71b726.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.2
Max-Forwards: 68
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
CSeq: 50116727 ACK
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Content-Length: 0
2022/04/07 14:17:19.763859 YY.YY.42.207:5060 -> 172.31.32.7:5060
ACK sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc SIP/2.0
Via: SIP/2.0/UDP YY.YY.42.207;branch=z9hG4bK90b6.b67a9d126cb84546ec6dcda62d71b726.0
Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.2
Max-Forwards: 68
From: "419XXXXX998" <sip:38XXXX02 at 172.31.32.169>;tag=p0BjH21gpa3rc
To: <sip:38XXXX02 at 54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e
Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c
CSeq: 50116727 ACK
Contact: <sip:voip.voip-sbc.6792.fab37901 at 54.XXX.XXX.44:5060>
Content-Length: 0
More information about the sr-users
mailing list