By changing contact addresses to kamailio ip, you lose the routing
information of the call. The proxy should leave the contact address as
it is (eventually updating for nat traversal purposes) and do record
routing to ensure that requests within dialog come through proxy as well.
If you want to do it for topology hiding, changing contact is not
enough, the addresses are also in Via, look at topoh or topos modules.
Cheers,
Daniel
On 03.02.23 02:03, Jack Murphy wrote:
I have a multi-homed kam with a uas behind one private
interface and a
public interface for the uac+sip provider.
When the uac initiates a call, kam sends the invite to the private uas
which sets up a b-leg call back to kam with a Contact header that has
the uas' private ip address. I want to change that private ip address
to be Kamailio's advertised/public ip address before it gets forwarded
to the sip provider.
I am rewriting Contact in a route from request_route like this:
if ($rP != $null) {
$var(ct) = ";transport=" + $rP;
}else{
$var(ct) = "";
}
$var(cr) = "<sip:" + $fU + "@" + $RAi + ":" + $RAp +
$var(ct) + ">";
remove_hf("Contact");
append_hf("Contact: $var(cr)\r\n");
This seems to work fine for the INVITE going to the provider.
There's also the 200 OK that the uas sends for the uac (a-leg) with a
private ip address in Contact -- I want to rewrite that before sending
it to the UAC, too.
Using the same method as above (but inside onreply_route), what
happens is the UAC receives the modified OK and sends back an ACK with
the modified Contact (kam's public ip addr) in the ACK r-uri, and kam
gets in a loop of sending an ACK from its private ip address to its
public ip address and replying to itself.
call flows:
https://imgur.com/a/Yj2DJpn
Is there a right way to do this?
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave(a)lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
--
Daniel-Constantin Mierla --
www.asipto.com
www.twitter.com/miconda --
www.linkedin.com/in/miconda
Kamailio World Conference - June 5-7, 2023 -
www.kamailioworld.com