Problem with Freeswitch with IP public and Kamailio behind NAT

518 views
Skip to first unread message

HaiBui

unread,
Mar 10, 2016, 10:49:18 PM3/10/16
to 2600hz-dev
Hi all,

I have NAT problem when configure Freeswitch and Kamailio.

As the old network diagram:

I configure dispatcher to FS 1,2 with IP private and map IP public <-> IP private for each server via Router.
This work fine.
Then now, I want to improve FS performance so that I set up new FS with IP public:

I configure dispatcher FS3 with IP public, connection between FS3 & ecallmgr via public IP is Okay but have problem with NAT:
When Kamailio foward SIP INVITE message to FS3 then FS3 response 200 OK message but it send to Ip private of Kamailio not IP public.
As Kamailio I have already configure advertise IP public:
local.cfg
listen
=UDP_SIP advertise 125.212.212.40:5060
listen
=TCP_SIP advertise 125.212.212.40:5060

View console log on Freeswitch, I see the ecallmgr response to FS3:
  1. bridge({outbound_redirect_fatal="false",call_timeout=20,originate_timeout=20,local_var_clobber="true"}[ecallmgr_Authorizing-ID="71310939684a2c8acc4e0e6dff1be6c2",ecallmgr_Owner-ID="188cd101dcea060d080261b328fdf1ca",ecallmgr_Account-ID="3f221d1ce6959ec04acd372923e253b9",sdp_secure_savp_only="false",sip_invite_domain="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",presence_id="shark...@hahai1412.anttel-pro.ab-kz-02.antbuddy.com",sip_h_X-KAZOO-AOR=sip:sharklasers@hahai1412.anttel-pro.ab-kz-02.antbuddy.com,absolute_codec_string="^^:PCMU:VP8",leg_timeout="20",effective_callee_id_number="sharklasers",effective_callee_id_name="sharklasers  ",origination_callee_id_number="sharklasers",origination_callee_id_name="sharklasers  ",ecallmgr_Realm="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",ecallmgr_Username="sharklasers"]sofia/sipinterface_1/sharklasers@113.161.89.159:5914;transport=ws;fs_path=sip:10.127.15.36:5060;lr;received="sip:113.161.89.159:5914;transport=ws")
I guess this is broken It should be Public IP: fs_path=sip:125.212.212.40:5060. But I don't know how I can change this parameter ! 
Anybody faced that problem ? Any solution ?

Regards,
Hai Bui

Darren Schreiber

unread,
Mar 10, 2016, 10:50:59 PM3/10/16
to 2600h...@googlegroups.com
This isn't related to Kazoo is it? If not, you're posting to the wrong place. This should go to the freeswitch or kamailio mailing lists. ..



Sent from the 2600hz mobile network
--
You received this message because you are subscribed to the Google Groups "2600hz-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 2600hz-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

HaiBui

unread,
Mar 11, 2016, 11:01:42 AM3/11/16
to 2600hz-dev, dschr...@2600hz.com
Hi Darren Schreiber,

Thank for replying.
This message freeswitch receive from Ecallmgr
kazoo_event_stream.c:245 increased event stream buffer size to 5168
EXECUTE sofia
/sipinterface_1/hahai@hahai1412.anttel-pro.ab-kz-02.antbuddy.com
bridge
({outbound_redirect_fatal="false",call_timeout=20,originate_timeout=20,local_var_clobber="true"}[ecallmgr_Authorizing-ID="71310939684a2c8acc4e0e6dff1be6c2",ecallmgr_Owner-ID="188cd101dcea060d080261b328fdf1ca",ecallmgr_Account-ID="3f221d1ce6959ec04acd372923e253b9",sdp_secure_savp_only="false",sip_invite_domain="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",presence_id="shark...@hahai1412.anttel-pro.ab-kz-02.antbuddy.com",sip_h_X-KAZOO-AOR=sip:sharklasers@hahai1412.anttel-pro.ab-kz-02.antbuddy.com,absolute_codec_string="^^:PCMU:VP8",leg_timeout="20",effective_callee_id_number="sharklasers",effective_callee_id_name="sharklasers  ",origination_callee_id_number="sharklasers",origination_callee_id_name="sharklasers  ",ecallmgr_Realm="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",ecallmgr_Username="sharklasers"]sofia/sipinterface_1/sharklasers@113.161.89.159:5914;transport=ws;fs_path=sip:10.127.15.36:5060;lr;received="sip:113.161.89.159:5914;transport=ws")

So that, I think it related. I will also post this problem to FS or Kamailio forum. Thank for advice !
You have any idea for this problem or suggestion ?

Regards,
Hai Bui

On Friday, March 11, 2016 at 10:50:59 AM UTC+7, Darren Schreiber wrote:
This isn't related to Kazoo is it? If not, you're posting to the wrong place. This should go to the freeswitch or kamailio mailing lists. ..



Sent from the 2600hz mobile network


-------- Original message --------
From: HaiBui <hai...@htklabs.com>
Date: 03/10/2016 7:49 PM (GMT-08:00)
To: 2600hz-dev <2600h...@googlegroups.com>
Subject: Problem with Freeswitch with IP public and Kamailio behind NAT

Hi all,

I have NAT problem when configure Freeswitch and Kamailio.

As the old network diagram:

I configure dispatcher to FS 1,2 with IP private and map IP public <-> IP private for each server via Router.
This work fine.
Then now, I want to improve FS performance so that I set up new FS with IP public:

I configure dispatcher FS3 with IP public, connection between FS3 & ecallmgr via public IP is Okay but have problem with NAT:
When Kamailio foward SIP INVITE message to FS3 then FS3 response 200 OK message but it send to Ip private of Kamailio not IP public.
As Kamailio I have already configure advertise IP public:
local.cfg
listen
=UDP_SIP advertise 125.212.212.40:5060
listen
=TCP_SIP advertise 125.212.212.40:5060

View console log on Freeswitch, I see the ecallmgr response to FS3:
  1. bridge({outbound_redirect_fatal="false",call_timeout=20,originate_timeout=20,local_var_clobber="true"}[ecallmgr_Authorizing-ID="71310939684a2c8acc4e0e6dff1be6c2",ecallmgr_Owner-ID="188cd101dcea060d080261b328fdf1ca",ecallmgr_Account-ID="3f221d1ce6959ec04acd372923e253b9",sdp_secure_savp_only="false",sip_invite_domain="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",presence_id="sharkla...@hahai1412.anttel-pro.ab-kz-02.antbuddy.com",sip_h_X-KAZOO-AOR=sip:sharklasers@hahai1412.anttel-pro.ab-kz-02.antbuddy.com,absolute_codec_string="^^:PCMU:VP8",leg_timeout="20",effective_callee_id_number="sharklasers",effective_callee_id_name="sharklasers  ",origination_callee_id_number="sharklasers",origination_callee_id_name="sharklasers  ",ecallmgr_Realm="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",ecallmgr_Username="sharklasers"]sofia/sipinterface_1/sharklasers@113.161.89.159:5914;transport=ws;fs_path=sip:10.127.15.36:5060;lr;received="sip:113.161.89.159:5914;transport=ws")
I guess this is broken It should be Public IP: fs_path=sip:125.212.212.40:5060. But I don't know how I can change this parameter ! 
Anybody faced that problem ? Any solution ?

Regards,
Hai Bui

Darren Schreiber

unread,
Mar 11, 2016, 11:58:25 AM3/11/16
to HaiBui, 2600hz-dev
Ahhh ok so you are using Kazoo :-) heh

FreeSWITCH should be sending it back to Kamailio, I believe, based on wherever it saw it from originally. I assume you are calling a registered device, yes? And that's what the bridge command below is?

HaiBui

unread,
Mar 14, 2016, 12:03:14 AM3/14/16
to 2600hz-dev, hai...@htklabs.com, dschr...@2600hz.com
Hi Darren Schreiber,

Yes, I'm make the call and Freeswitch should be sending response "200 OK" to Kamailio but it send to Private IP (10.127.15.36) and can't reach to Kamailio. My Kamailio is behind NAT with public IP (125.212.212.40).
Now I just want to set up Freeswitch send response to Kamailio public IP.
View console log on Freeswitch, I see the ecallmgr response to FS3:
  1. bridge({outbound_redirect_fatal="false",call_timeout=20,originate_timeout=20,local_var_clobber="true"}[ecallmgr_Authorizing-ID="71310939684a2c8acc4e0e6dff1be6c2",ecallmgr_Owner-ID="188cd101dcea060d080261b328fdf1ca",ecallmgr_Account-ID="3f221d1ce6959ec04acd372923e253b9",sdp_secure_savp_only="false",sip_invite_domain="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",presence_id="sharkla...@hahai1412.anttel-pro.ab-kz-02.antbuddy.com",sip_h_X-KAZOO-AOR=sip:sharklasers@hahai1412.anttel-pro.ab-kz-02.antbuddy.com,absolute_codec_string="^^:PCMU:VP8",leg_timeout="20",effective_callee_id_number="sharklasers",effective_callee_id_name="sharklasers  ",origination_callee_id_number="sharklasers",origination_callee_id_name="sharklasers  ",ecallmgr_Realm="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",ecallmgr_Username="sharklasers"]sofia/sipinterface_1/sharklasers@113.161.89.159:5914;transport=ws;fs_path=sip:10.127.15.36:5060;lr;received="sip:113.161.89.159:5914;transport=ws")
I guess this is broken It should be Public IP: fs_path=sip:125.212.212.40:5060


On Friday, March 11, 2016 at 11:58:25 PM UTC+7, Darren Schreiber wrote:
Ahhh ok so you are using Kazoo :-) heh

FreeSWITCH should be sending it back to Kamailio, I believe, based on wherever it saw it from originally. I assume you are calling a registered device, yes? And that's what the bridge command below is?

From: HaiBui <hai...@htklabs.com>
Date: Thursday, March 10, 2016 at 8:13 PM
To: 2600hz-dev <2600h...@googlegroups.com>
Cc: Computer User <dschr...@2600hz.com>
Subject: Re: Problem with Freeswitch with IP public and Kamailio behind NAT

Hi Darren Schreiber,

Thank for replying.
This message freeswitch receive from Ecallmgr
kazoo_event_stream.c:245 increased event stream buffer size to 5168
EXECUTE sofia
/sipinterface_1/hahai@hahai1412.anttel-pro.ab-kz-02.antbuddy.
com
bridge
({outbound_redirect_fatal="false",call_timeout=20,originate_timeout=20,local_var_clobber="true"}[ecallmgr_Authorizing-ID="71310939684a2c8acc4e0e6dff1be6c2",ecallmgr_Owner-ID="188cd101dcea060d080261b328fdf1ca",ecallmgr_Account-ID="3f221d1ce6959ec04acd372923e253b9",sdp_secure_savp_only="false",sip_invite_domain="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",presence_id="sharkla...@hahai1412.anttel-pro.ab-kz-02.antbuddy.com",sip_h_X-KAZOO-AOR=sip:sharklasers@hahai1412.anttel-pro.ab-kz-02.antbuddy.com,absolute_codec_string="^^:PCMU:VP8",leg_timeout="20",effective_callee_id_number="sharklasers",effective_callee_id_name="sharklasers  ",origination_callee_id_number="sharklasers",origination_callee_id_name="sharklasers  ",ecallmgr_Realm="hahai1412.anttel-pro.ab-kz-02.antbuddy.com",ecallmgr_Username="sharklasers"]sofia/sipinterface_1/sharklasers@113.161.89.159:5914;transport=ws;fs_path=sip:10.127.15.36:5060;lr;received="sip:113.161.89.159:5914;transport=ws")

Reply all
Reply to author
Forward
0 new messages