Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanderkwantes/3ab81f2d3d6ee182fa237bbc3f5c1489 to your computer and use it in GitHub Desktop.
Save sanderkwantes/3ab81f2d3d6ee182fa237bbc3f5c1489 to your computer and use it in GitHub Desktop.
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
Copy link

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