Problem with installation on AWS EC2 virtual machine

Status
Not open for further replies.

Comextel

Member
Aug 8, 2019
33
2
8
41
Hi all,

I have a problem with fresh new installation of FusionPBX 4.5 on a AWS EC2, the installation scrip have use local IP for the installation and now when the Fusion want make a call, the IP address are wrong and i don't have sound .. ... where i can change, because in variable it's change but i have this log again ...

call-id ca3e06a0-58cf-1238-1992-024960480542
SIP UDP message remote=15.222.7.91:5080 -> local (private IP)=172.31.2.180:5060
v=0
o=- 1569241620 1569241621 IN IP4 172.31.27.153
s=-
c=IN IP4 172.31.27.153
t=0 0
m=audio 20404 RTP/AVP 9 0 8 101 13
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20

Blue = nice
Red = wrong IP
 

ad5ou

Active Member
Jun 12, 2018
892
204
43
You can set you public IP information in Advanced>Variables>IP Address or directly in the Sofia profiles.
You will have to restart the profile after making changes.
 

Comextel

Member
Aug 8, 2019
33
2
8
41
You can set you public IP information in Advanced>Variables>IP Address or directly in the Sofia profiles.
You will have to restart the profile after making changes.


I have try, but I have again internal AWS IP in log .... but it’s better ... i have erase fews internal by public but not all and I don’t have sound when the call answered
 

JamesBorne

Active Member
Jan 24, 2019
294
57
28
Australia
More info here:
https://freeswitch.org/confluence/display/FREESWITCH/Amazon+EC2

Advanced > XML Editor : vars.xml
Replace [AWS EIP] with your instance public IP
Code:
<X-PRE-PROCESS cmd="set" data="bind_server_ip=[AWS EIP]"/>
<X-PRE-PROCESS cmd="set" data="external_rtp_ip=[AWS EIP]"/>
<X-PRE-PROCESS cmd="set" data="external_sip_ip=[AWS EIP]"/>

And in autoload_configs/switch.conf.xml, uncomment these...
Code:
param name="rtp-start-port" value="16384"
param name="rtp-end-port" value="32768"

Important: Restart the EC2 instance to take affect.
 

francois

New Member
Oct 3, 2019
28
9
3
57
I have the same problem here with a fresh install and a similar setup but on GCP.

The above variables are well configured and FusionPBX been rebooted several times. The extension is receiving the local server IP in the SDP c line. I can work around the problem on PSTN-to-extension calls by configuring the extension in the Bypass Media mode. Or, on extension-to PSTN-calls with the extension configured in the Bypass Media After bridge mode. In those cases the SDP c line is set with the public IP. Obviously I am unable to get successful inbound and outbound calls with a single config and nevertheless I suspect that the SIP Bypass Media option is not the right approach to fix NAT issues.

So, it seems that external_rtp_ip has no effect on my setup or the Freeswitch auto-nat feature is not working. Should I do anything special to enable it the auto-nat? Any idea about what is wrong?

Many thanks!

UPDATE
Replaced the default ext-rtp-ip=$${local_ip_v4} value of the internal SIP profile with my public IP and now my problems are gone. Not sure why does not pick my $${external_rtp_ip} variable.
 
Last edited:

kapil Yadav

New Member
Jan 9, 2020
5
0
1
30
Hello, Same problem we are facing in AWS light sail instance of Debian 9.5.
nating is not working at all also the sip internal and external profile becomes down and didn't up.

We have tried all the way any suggestion?
 

agile

New Member
Oct 21, 2020
27
2
3
42
uys 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 that's done. Dont 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.
 
Last edited:

Tomcar

New Member
Feb 27, 2017
3
0
1
51
uys 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 that's done. Dont 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.

This doesn't work for me. The vars.xml doesn't exist in conf, it is in /etc/freeswitch. It is also re-created every time the settings in FusionPBX is changed.
Also Freeswitch doesn't seem to like the curl command, I'm getting error:

2021-07-13 16:44:03.861512 [ERR] sofia.c:3322 Error Creating SIP UA for profile: internal (sip:mod_sofia@[curl -s http://instance-data/latest/meta-data/public-ipv4]:5060;maddr=<MY_PRIVATE_IP>;transport=udp,tcp) ATTEMPT 1 (RETRY IN 5 SEC)

However, it works when entering the public IP address manually instead of the curl command.
 
Status
Not open for further replies.