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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c CSeq: 50116727 ACK Contact: <sip:[email protected]: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.
2022/04/07 14:17:19.044923 54.XXX.XXX.44:5060 -> 172.31.32.7:5060 INVITE sip:[email protected]:5060 SIP/2.0 Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;branch=z9hG4bK90b6.f7a6b0a4.0 Max-Forwards: 66 From: "419XXXXX998" <sip:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]> Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c User-Agent: voip SBC v2.0 CSeq: 50116727 INVITE Contact: <sip:[email protected]: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:[email protected]>;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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]> 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:[email protected]: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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]> Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c User-Agent: voip SBC v2.0 CSeq: 50116727 INVITE Contact: <sip:[email protected]: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:[email protected]>;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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]> 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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c CSeq: 50116727 ACK Contact: <sip:[email protected]: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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c CSeq: 50116727 ACK Contact: <sip:[email protected]: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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c CSeq: 50116727 ACK Contact: <sip:[email protected]: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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c CSeq: 50116727 ACK Contact: <sip:[email protected]: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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c CSeq: 50116727 ACK Contact: <sip:[email protected]: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:[email protected]>;tag=p0BjH21gpa3rc To: <sip:[email protected]>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c CSeq: 50116727 ACK Contact: <sip:[email protected]:5060> Content-Length: 0
__________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions * [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
