<div dir="ltr"> <div><div><div><div><div><div>Hello,<br><br></div>I am running Kamailio behind NAT.<br><br></div>Kanailio has a private IP and I am relaying NAT to internet router.<br><br></div>I am using:<br><br>- #!define WITH_NAT<br>- listen=udp:PRIVATE-IP:5060 advertise PUBLIC-IP:5060<br><br></div>- Patched RTP proxy including the advertise option<br><br></div>And everything goes fine. I can make calls and have two way audio.<br><br></div>The problem begins when the callee ends the call. BYE is not received in Kamailio (caller)<br><div><div><br></div><div>I included the public IP using "add_contact_alias" because "set_contact_alias" was not adding the public IP. I included this in in NATDETECT (pre loaded router)<br></div><div><br>        if(is_first_hop()) {<br>            xlog("L_NOTICE","Metodo: $rm \n");<br>            xlog("L_NOTICE","is first hop\n");<br>            #set_contact_alias();<br>                 if (!add_contact_alias("PUBLIC-IP", "$Rp", "udp")) {<br>                 xlog("L_ERR", "Error in aliasing contact $ct\n");<br>                    send_reply("400", "Bad request");<br>                            exit;<br>                    }<br>        }<br><br></div><div>I think the problem is related to destination that BYE is sent by the vendor. From what I see IP and port is taken from advertised in contact (PUBLIC-IP and 5060). <br>The problem is that internet router changes the source port.<br><br>Contact: <sip:999999999@PRIVATE-IP:5060;alias=PUBLIC-IP~5060~1><br><br></div><div>--- Is it correcto to add_contact_alias("PUBLIC-IP", "$Rp", "udp") in order to received new transactions or should I follow a different procedure???<br><br></div><div>Thank you<br><br><br></div><div><br></div></div></div>