I think you have multiple issues:
(not sure if I am right as I have to guess your network setup)
1. If Kamailio is an Application Layer Gateway between the public and the internal network, then of course Asterisk should listen only on the internal interface. Thus in sip.conf add:
udpbindaddr = internal.ip.add.ress
Further you can tweak if Asterisk should use internal or public IP addresses inside the SIP message headers by playing around with externip = ... localnet = ...
2. Regardless of the Via header inserted by Kamailio Asterisk should respond to the IP address from which Kamailio sent the request. Thus I guess Kamailio sent the request with the public IP address as source IP.
To have Kamailio acting correctly you have to make sure that Kamailio is listening on both interfaces (http://sip-router.org/wiki/cookbooks/core-cookbook/devel#listen):
listen=udp:public.ip.add.ress:5060 listen=udp:internal.ip.add.ress:5060
and activate multihoming feature of Kamailio to have proper IP addresses in Via and Record-Route headers (http://sip-router.org/wiki/cookbooks/core-cookbook/devel#mhomed)
mhomed=1
regards Klaus
Am 22.08.2010 04:46, schrieb Gnaneshwar Gatla:
Hello All,
I'm using Kamailio as a Border controller for my VoIP Research project at my school. The problem I'm facing is Kamailio routes the traffic to the private network where my asterisk machine is listening. The asterisk machine responds to the Kamailio using the public network but not the private. Is this an issue with Asterisk? If so how do I resolve it?
client kam_public Kam_pvt Ast_pvt Ast_public
| | | | | | | | | | | INVITE | | | | |---------------->| | INVITE | | | | |---------->| | | | | | | | | | | | | | | | | | | | 404 | | | |<----------|-----------|-----------| | | | | | | | | ACK | | | | |---------->| | | | | | | | 404 | | | | |<----------------| | | | | | | | | | ACK | | | | |---------------->| | | | | | | | | | | | | |
Regards Gnaneshwar
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users