[SR-Users] Best approach for Kamailio behind nat

Evgeny Kuchkov ky4k0b at gmail.com
Sun Mar 25 01:10:52 CET 2018


Sorry for my previous mail with typos.

I have the current configuration located on google cloud servers:
[Alice a.a.a.a]--->(GCN NAT x.x.x.x)--->(Instance with Kam
10.0.0.1)--->(next proxy 10.0.0.2)

Currently I have configured a fake alias with IP x.x.x.x in Debain and set
listeners this way:
listen=udp:10.0.0.1:5060 advertise x.x.x.x:5060
listen=udp:x.x.x.x:5060

200OK from Kam to Alice:
Via: a.a.a.a
Record-Route: <sip:alias1 at 10.0.0.2;lr> (used for further internal routing)
Record-Route: <sip:alias2 at 10.0.0.2;lr>
Record-Route: <sip:x.x.x.x;lr>
Contact: <sip:dnis at x.x.x.x>

ACK recived from Alice with reversed RR:
ACK sip:dnis at x.x.x.x
Via: a.a.a.a
Route: <sip:x.x.x.x;lr>, <sip:alias2 at 10.0.0.2;lr>,<sip:alias1 at 10.0.0.2;lr>

So what Kam does - it goes through loose_route() and dispatches two ACKs to
x.x.x.x (from which I'd like to get rid of) and 10.0.0.2
First one is:
ACK sip:alias1 at 10.0.0.2
Via: x.x.x.x
Via: a.a.a.a
Route: <sip:x.x.x.x;lr>, <sip:alias2 at 10.0.0.2;lr>

And the next one:
ACK sip:alias1 at 10.0.0.2
Via: x.x.x.x
Via: x.x.x.x (Doubles Via)
Via: a.a.a.a
Route: <sip:alias2 at 10.0.0.2;lr>

So my question is - how to make Kam think that x.x.x.x it's own address and
stop dispatching in-dialog messages to itself? Currently I'm thinking about
chooping off one Route/Record-Route in route[WITHINDLG] tight before
loose_route(). But maybe there's a better way to solve my problem?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180325/5eac699b/attachment.html>


More information about the sr-users mailing list