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)
if(is_first_hop()) {
xlog("L_NOTICE","Metodo: $rm \n");
xlog("L_NOTICE","is first hop\n");
#set_contact_alias();
if (!add_contact_alias("PUBLIC-IP", "$Rp", "udp")) {
xlog("L_ERR", "Error in aliasing contact $ct\n");
send_reply("400", "Bad request");
exit;
}
}
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).
The problem is that internet router changes the source port.
Contact: <sip:999999999@PRIVATE-IP:5060;alias=PUBLIC-IP~5060~1>
--- Is it correcto to add_contact_alias("PUBLIC-IP", "$Rp", "udp") in order to received new transactions or should I follow a different procedure???
Thank you