Skip to main content

local_ip_v4

Created by Ryan Harris, last modified by Duvid Rottenberg on 2018.04.24

local_ip_v4

string

This global variable is set dynamically by the FreeSWITCH core by asking the underlying OS for the IP address of the server on which FreeSWITCH is running. If the server has multiple IP addresses this will be set to the first one returned by the OS. In the default configuration there are many settings that use this global variable.

You cannot override the value of this global variable, because it will be reset by the FreeSWITCH core every minute. If your server has multiple IP addresses and you want to force FreeSWITCH to use a particular IP address, you can create a global variable force_local_ip_v4 and set it to the IP address you prefer. You must also set the local_ip_v4 variable to this IP address, you can do it by simply setting local_ip_v4 to use the value of force_local_ip_v4

Example: force_local_ip_v4

<X-PRE-PROCESS cmd="set" data="force_local_ip_v4=1.1.1.1"/>
<X-PRE-PROCESS cmd="set" data="local_ip_v4=$${force_local_ip_v4 }"/>

FreeSWITCH will not validate that the IP address you entered for force_local_ip_v4 is actually pointing to the server, it's up to you to ensure that you use a valid IP address that's routed correctly to the server.