[SR-Users] question about force_send_socket

Fabian Borot fborot at hotmail.com
Thu Feb 1 00:13:10 CET 2018


thank you John, that did the trick!.





________________________________
From: Fabian Borot <fborot at hotmail.com>
Sent: Wednesday, January 31, 2018 5:05 PM
To: sr-users at lists.kamailio.org
Subject: question about force_send_socket

 our kamailo has 2 IPs, a public (87.x.x.x) and a private (192.168.1.1). It is listening on all of them. For all calls it listens on the public IP but for some calls I need to forward the incoming INVITE to a server in the private network so I do a " force_send_socket(privateip:port)"  before the route that forwards the INVITE to the server in the private network and that works.

But then when the server in the private network replies with 302 I have to contact the servers inside the Contact header using the Public IP now so I do this hoping that it will switch back to the public IP:

        if (t_check_status("302")) {
                force_send_socket(PUBLIC_IP:5060);
                get_redirects("*");
                t_relay();
        }

But it stays in the private, so the INVITEs to the servers inside the Contact header are sent from the Private IP and they are blocked.

This would be the flow:
customer INVITE  -> kamailio(publicIP)
kamailio (publicIP) 100 trying -> customer

kamailio(privateIP) INVITE -> Server(privateIP)
Server(privateIP) 302 redirect -> kamailio(privateIP)
kamailio(privateIP) ACK -> Server(privateIP)

after I would like this to happen

kamailio(publicIP) INVITE -> Server1(publicIP)
but instead this happens:

kamailio(privateIP) INVITE -> Server1(publicIP)

how can I switch back to the public IP to continue with this call flow?
thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180131/fbf4092d/attachment.html>


More information about the sr-users mailing list