[SR-Users] How can change via header's ip to public ip when Kamailio locate behind a NAT network?

dongwf dongwflj at 163.com
Tue Jan 27 11:21:29 CET 2015


Thanks, the public ip is not a real device ip, it is a NAT external public ip, so if I listen on that, server will not work. Anyway, I found my problem is caused by firewall, so even the via header is priviate ip, I still can get response, so please ignore this question, thanks for your help. 






At 2015-01-26 17:14:46, "Olle E. Johansson" <oej at edvina.net> wrote:


On 25 Jan 2015, at 14:48, dongwf <dongwflj at 163.com> wrote:


Hi Kamailio:
I use Kamailio with Amazon EC2 virtual machine, it has a private ip such as 172.31.7.164, kamailio listened on this, I assigned a float public ip 54.X.X.X on it, and all the client send traffics to the public ip and it work well(REGISTER), but now I would relay kamailio's traffic to another real public server, the server found the INVITE's via header's ip address is 172.31.7.164, so it failed to response 100 trying and 200 OK to my kamalio, because it send to a private 172.31.7.164, so my question is can I change Kamailio's via header's ip value with my specified public ip? How can I do? Thanks a lot!


The core cookbok documents the "advertise" parameter to the "listen" config setting for this case.


http://www.kamailio.org/wiki/cookbooks/4.2.x/core#listen


Go ahead and try that one.


/O
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150127/333e287e/attachment.html>


More information about the sr-users mailing list