Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Freeswitch/FusionPBX set IP adres to Floating IP on Digital Ocean VPS (add to vars.xml)
<!-- Set local_ip_v4 to Digital Ocean Floating IP -->
<X-PRE-PROCESS cmd="exec-set" data="local_ip_v4=ip addr show eth0 | awk 'FNR == 5 {print $2}' | cut -d '/' -f 1"/>
@SeanDevoy

This comment has been minimized.

Copy link

@SeanDevoy SeanDevoy commented Oct 2, 2019

Thanks,
I found this to work great, but it made the old droplet ip fail. The old droplet ip is still valid. For the purpose of migration, I wanted both to work. I did the above EXCEPT I created a new local variable local_ip_v4_float (thus leaving local_ip_v4 unchanged):
<X-PRE-PROCESS cmd="exec-set" data="local_ip_v4_float=ip addr show eth0 | awk 'FNR == 5 {print $2}' | cut -d '/' -f 1"/>

Then copy the config file /sip_profiles/internal.xml to internal_float.xml
Edit the new file and replace local_ip_v4 with local_ip_v4_float
Copy to your server and restart FreeSwitch. Registrations will start working on either ip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment