<div dir="ltr">Hello!<div><br></div><div>I have the following architecture:</div><div><ul><li>Kamailio with RTPEngine (with public access on IP <b>YY.YY.42.207</b>)</li><li>Asterisk (with no public access, internal IP <b>172.31.69.198</b>)</li></ul><div>I am using a Voip SIP (with public access on IP <b>54.XXX.XXX.44</b>) configured as a Trunk on Kamailio using UAC Module.</div></div><div><br></div><div>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).</div><div><br></div><div>For example, this is the 200 message I sent to the VOIP provider (I clearly state that the contact is Asterisk sip:<a href="http://172.31.69.198:5080">172.31.69.198:5080</a>):</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>2022/04/07 14:17:19.260864 <a href="http://172.31.32.7:5060">172.31.32.7:5060</a> -> 54.XXX.XXX.44:5060</div><div>SIP/2.0 200 OK</div><div>Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;rport=5060;branch=z9hG4bK90b6.f7a6b0a4.0</div><div>Record-Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc></div><div>Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c</div><div>From: "419XXXXX998" <<a href="mailto:sip%3A38XXXX02@172.31.32.169">sip:38XXXX02@172.31.32.169</a>>;tag=p0BjH21gpa3rc</div><div>To: <sip:38XXXX02@54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e</div><div>CSeq: 50116727 INVITE</div><div>Server: Asterisk PBX 18.11.0</div><div><b>Contact: <sip:<a href="http://172.31.69.198:5080">172.31.69.198:5080</a>></b></div><div>Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER</div><div>Supported: 100rel, timer, replaces, norefersub</div><div>Content-Type: application/sdp</div><div>Content-Length:   239</div></blockquote><div><br></div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div><div>v=0</div><div>o=- 1649321756 1649321759 IN IP4 172.31.69.198</div><div>s=Asterisk</div><div>c=IN IP4 172.31.69.198</div><div>t=0 0</div><div>m=audio 10010 RTP/AVP 8 101</div><div>a=rtpmap:8 PCMA/8000</div><div>a=rtpmap:101 telephone-event/8000</div><div>a=fmtp:101 0-16</div><div>a=ptime:20</div><div>a=maxptime:150</div><div>a=sendrecv</div></blockquote></div><div><br></div><div>But the ACK I get from them is destined to Kamailio instead of Asterisk:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>2022/04/07 14:17:19.263469 54.XXX.XXX.44:5060 -> <a href="http://172.31.32.7:5060">172.31.32.7:5060</a></div><div><b>ACK sip:YY.YY.42.207:5060 SIP/2.0</b></div><div>Route: <sip:YY.YY.42.207;lr;ftag=p0BjH21gpa3rc></div><div>Via: SIP/2.0/UDP 54.XXX.XXX.44:5060;branch=z9hG4bK90b6.f7a6b0a4.2</div><div>Max-Forwards: 69</div><div>From: "419XXXXX998" <<a href="mailto:sip%3A38XXXX02@172.31.32.169">sip:38XXXX02@172.31.32.169</a>>;tag=p0BjH21gpa3rc</div><div>To: <sip:38XXXX02@54.XXX.XXX.44>;tag=8c3bb09e-a909-4cb4-99a7-3c57aa8f946e</div><div>Call-ID: 464f21c3-3120-123b-91b2-026ef2fede4c</div><div>CSeq: 50116727 ACK</div><div>Contact: <sip:voip.voip-sbc.6792.fab37901@54.XXX.XXX.44:5060></div><div>Content-Length: 0</div></blockquote><div><br></div><div>This causes Kamailio to not know where to forward the message to... Asterisk never gets the reply.</div><div><br></div><div>This is happening to one of the SIP Trunks I am using, with the other, everything is fine.</div><div><br></div><div>Is there anything I can do to work around it (other than contacting the provider to fix on their end)?</div><div><br></div><div>Thanks!</div><div><br></div><div>ps: I have attached the full SIP messages trail to help.</div></div>