1

I have installed Freeswitch (centos7) on a Google Cloud VM. This is just a test instance.

Haven't made any changes to the config yet.

The server starts up fine but I can't get any audio through while testing. Have opened the firewall as per the link: https://freeswitch.org/confluence/display/FREESWITCH/Firewall

The freeswitch logs show the call coming in and the audio being sent out.

Would someone be able to suggest anything to help me resolve this?

Regards vm

vjm
  • 49
  • 1
  • 9
  • Have you got any errors or logs with relevant information? How do you know the issue is in the test instance if you see the traffic flowing correctly? – Tux Feb 26 '18 at 16:16
  • Hi Jordi; thanks for responding. I uninstalled and re-installed, this time on a new Debian 8 instance. Same problem; the call seems to go through but no sound. I have definitely opened the ports. The logs from startup and a single call are at: [https://pastebin.com/Z9baGfJa] – vjm Mar 01 '18 at 01:46
  • Looks like your pastebin has been removed for some reason, was there some sensitive information in it? Maybe try again here: https://paste.ubuntu.com/ – Tux Mar 01 '18 at 08:00
  • Thanks for pointing that out. The reason the link didn't work is that it had a slash at the end and that commented the square bracket after that. AFAIK, the IP was the only sensitive info as this is always intended as a test vm. Have pasted it now at: [ https://paste.ubuntu.com/p/x5B9fyZmfM ] – vjm Mar 01 '18 at 08:22
  • Hi Jordi; Please check again now. The square bracket at the end caused the issue. The one above works now as I put a space on either side of the link. – vjm Mar 01 '18 at 08:26

2 Answers2

1

After looking around a bit it looks like there are some gotchas with running Freeswitch on a cloud provider. So far there is official documentation about running it on Amazon EC2, and it says it's not officially supported. I'll try to adapt it to Google Cloud Platform, maybe this will work for you.

1 - Create a Debian Jesse 8 instance

gcloud compute instances create freeswitch-test --image-family debian-8 --image-project debian-cloud --tags=freeswitch

2 - Create the required firewall rules to open the ports it needs to run. From the documentation looks it should be UPD:16384-32768,TCP:8081-8082,TCP/UDP:5060,UDP:4569,TCP/UDP:8000

 gcloud compute firewall-rules create freeswitch-policy --allow UDP:16384-32768,TCP:8081-8082,TCP:5060,UDP:5060,UDP:4569,TCP:8000,UDP:8000 --source-ranges=0.0.0.0/0 --target-tags=freeswitch

Then you want freeswitch to be able to know its external IP when it starts up. I think the best way might be to reserve a static IP and then create a forwarding rule:

gcloud compute addresses create freeswitch-ip --region us-east1
gcloud compute target-pools create freeswitch --region us-east1
gcloud compute target-pools add-instances freeswitch --instances freeswitch-test --instances-zone us-east1-b
gcloud compute forwarding-rules create freeswitch-forwarding --address freeswitch-ip --region us-east1 --target-pool   freeswitch

Now to configure the static IP on freeswitch:

conf/vars.xml

<X-PRE-PROCESS cmd="exec-set" data="bind_server_ip=[YOUR-IP]">
<X-PRE-PROCESS cmd="exec-set" data="[YOUR-IP]"/>
<X-PRE-PROCESS cmd="exec-set" data="[YOUR-IP]"/>



conf/sip_profiles/internal.xml

<param name="aggressive-nat-detection" value="true"/>
<param name="multiple-registrations" value="true"/>
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
<param name="NDLB-received-in-nat-reg-contact" value="true"/>
<param name="NDLB-force-rport" value="true"/>
<param name="NDLB-broken-auth-hash" value="true"/>
<param name="enable-timer" value="false"/>
<param name="auth-calls" value="true"/>


conf/sip_profiles/external.xml


<param name="aggressive-nat-detection" value="true"/>
<param name="ext-rtp-ip" value="$${external_rtp_ip}"/>
<param name="ext-sip-ip" value="$${external_sip_ip}"/>
<param name="NDLB-force-rport" value="true"/>


conf/autoload/switch.conf.xml
=============================


<param name="rtp-start-port" value="16384"/>
<param name="rtp-end-port" value="32768"/>
Tux
  • 2,039
  • 8
  • 22
0

I try that:

Sofia External IP Config

You shouldn't have to make any changes to the Sofia profile. The FreeSWITCH Auto NAT feature will take care of this automatically. However, if you want to do this manually, edit the sip_profiles/internal.xml file and replace auto-nat with the external IP address in the ext-rtp-ip and ext-sip-ip parameters.

juan
  • 1