Sip nat only working when forced external ip into internal profile rather than varibles

Status
Not open for further replies.

TimGuyUK

Member
Feb 28, 2018
105
2
18
51
Ive been trying to get traction on this for a few days. I couldn't get the sip working externally at all

Fusion <> Nat <> Internet <> Nat <> Phone.

In the varibles I had the external_rtp_ip and external_sip_ip set to my external ip address but the internal sip profile wouldn't pick them up. Today I hard coded (if that's the word) the ip address directly into the internal profile ext-rtp-ip and ext-stp-ip and everything is now working.

I don't mind, I just really wanted to know what Id done wrong?
 

UCtech

Member
Jan 9, 2019
34
6
8
Have you tried removing the -nonat from /etc/default/freeswitch ?

Without this in my testing I could get it to work one way or another, but something was always broken on one network or another (one way audio, calls drop at between about 30 and 90 seconds, etc.). You may not notice it depending on your network config, but in my testing I have broken it down to:
1. External calls (calls in/out through SIP provider)
2. Internal routed calls (different network subnet but not the outside)
3. Internal calls (same network subnet, no routing)
I found I had to test calls for each in both directions.

What worked for me:
1. Edit /etc/default/freeswitch from the CLI and remove -nonat
2. Advanced-Sip Profiles - External (NOT Internal), ext_rtp_ip & ext_sip_ip change to autonat:XXX.XXX.XXX.XXX with the x's being the public IP
3. Restart Freeswitch

https://www.pbxforums.com/threads/freeswitch-behind-nat-issue.3091/

Anyway, may not be your issue, but if it helps . . .
 

TimGuyUK

Member
Feb 28, 2018
105
2
18
51
Have you tried removing the -nonat from /etc/default/freeswitch ?

Without this in my testing I could get it to work one way or another, but something was always broken on one network or another (one way audio, calls drop at between about 30 and 90 seconds, etc.). You may not notice it depending on your network config, but in my testing I have broken it down to:
1. External calls (calls in/out through SIP provider)
2. Internal routed calls (different network subnet but not the outside)
3. Internal calls (same network subnet, no routing)
I found I had to test calls for each in both directions.

What worked for me:
1. Edit /etc/default/freeswitch from the CLI and remove -nonat
2. Advanced-Sip Profiles - External (NOT Internal), ext_rtp_ip & ext_sip_ip change to autonat:XXX.XXX.XXX.XXX with the x's being the public IP
3. Restart Freeswitch

https://www.pbxforums.com/threads/freeswitch-behind-nat-issue.3091/

Anyway, may not be your issue, but if it helps . . .

Yes I say you post before and that down 1-3 before I hard coded the ip addresses into the sip profiles. Its not an issue, its working, Maybe the next box Ill look into it more, Thanks for taking the time to post.

Tim
 

agile

New Member
Oct 21, 2020
27
2
3
42
Hey guys I got this to work using the following I have Failover setup on AWS using RDS. I found this is the easiest way to setup up the public IP using the curl command curl -s http://instance-data/latest/meta-data/public-ipv4

https://freeswitch.org/confluence/display/FREESWITCH/Amazon+EC2

/etc/freeswitch

Edit vars.xml

conf/vars.xml

<X-PRE-PROCESS cmd="exec-set" data="bind_server_ip=curl -s http://instance-data/latest/meta-data/public-ipv4"/>
<X-PRE-PROCESS cmd="exec-set" data="external_rtp_ip=curl -s http://instance-data/latest/meta-data/public-ipv4"/>
<X-PRE-PROCESS cmd="exec-set" data="external_sip_ip=curl -s http://instance-data/latest/meta-data/public-ipv4"/>

after theat done forgot to put the default value back and test.
Set the value of sip profile external and internal back to default

$${external_rtp_ip}

In the Sip profiles

External sip profile
ext-rtp-ip /ext-sip-ip set it to $${external_rtp_ip} if its not set already

Internal sip profiles

ext-rtp-ip /ext-sip-ip set it to $${external_rtp_ip} if its not set already

I am running a Failover setup on AWS when I failover node A the node be stated picking up the correct elastic IP address and I can hear the voice.
in my setup when i bring node A back online the traffic automatically redirects to node A and all the phones get re-registered. However, the good news is if we have calls going on they do not drop they continue on the Node B.
 
Status
Not open for further replies.