This documentaion provides a basic configuration to get FreeSwitch up and running with Plivo as the external SIP gateway. This documentation was written using a Debian Jessie GNU/Linux System running FreeSwitch 1.6.6.
To get started with Zentrunk using FreeSwitch you would need to do the following:
On your Debian system, execute the following commands in the terminal:
$ apt-get update && apt-get install -y curl
$ curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -
$ echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
$ apt-get update && apt-get install -y freeswitch-all freeswitch-all-dbg gdb
To install Freeswitch on CentOS, follow the instructions given here
To install Freeswitch on Windows, follow the instructions given here
To configure Freeswitch to connect to your Plivo Zentrunk, locate the root configuration of FreeSwitch on your machine. These locations vary from platform to platform.
/etc/freeswitch/
.C:\Program Files\FreeSWITCH\conf
.For Linux systems, it could be either of the following depending on your installation:
/usr/local/freeswitch/conf
/opt/freeswitch/conf
With the root configuration directory located, you must complete the following configurations:
/etc/freeswitch/sip_profiles/external/
.
Next, you should setup a Dial Plan to use the Plivo SIP Profile created in Step 1.
/etc/freeswitch/dialplan/default/
. If you already have a dialplan prefixed by 02, you can choose the another number.The above dial plan has defined an extension for 11 digit US numbers like +1-(222)-(222)-2222. The outbound_caller_id_number
field is inherited from vars.xml
which would be set as the caller ID while making outbound calls. This extension is set to bridge to your SIP Profile “Plivo-outbound”.
fs_cli
in your terminal.reloadxml
.sofia profile external rescan
FreeSwitch instances have default users and SIP passwords preconfigured. To prevent being hacked, we recommend you change the default password.
Open vars.xml
located at /etc/freeswitch/
and edit the following line:
<X-PRE-PROCESS cmd="set" data="default_password=set your password here"/>
This change is applicable to all users under /etc/freeswitch/directory/default/
. If you want to change the password per user, then navigate to /etc/freeswitch/directory/default/
and edit 1000.xml (or any user of your choice).
<param name="password" value="set your password here"/>
Execute reloadxml
in fs_cli utility after making changes to users xml.
Note: Freeswitch has to be restarted if any changes were made to vars.xml
.
When the account is successfully enabled on X-Lite, it is ready to make calls. Enter any valid 11 digit US number in your X-Lite and hit on the call button. This call would hit your freeswitch server first, then go through Plivo Zentrunk and finally reach the destination number.
To know more about configuring X-lite for outbound calls, check the X-lite configuration guide
To configure the Freeswitch to connect to your Plivo inbound Zentrunk, first locate the root configuration of FreeSwitch on your machine. These locations vary from platform to platform.
/etc/freeswitch/
.C:\Program Files\FreeSWITCH\conf
.For Linux systems, it could be either of the following depending on your installation -
/usr/local/freeswitch/conf
/opt/freeswitch/conf
With the root configuration directory located, there are three major configurations that needs to done:
Create a new file named “03_zentrunk.xml” at /etc/freeswitch/dialplan/default/
. If you already have a dialplan prefixed by 03, you can choose the another number.
Use the XML Under the context =public
Values to be replaced:
Open the file acl.conf.xml at autoload_configs/acl.conf.xml. We will have to Whitelist Plivo outbound SIP IP found in zentrunk page.
Open the file found at freeswitch/directory/default/1000.xml Use the below XML as a reference to edit the user 1000.
FreeSwitch instances have default users and SIP passwords preconfigured. To prevent being hacked, we recommend you change the default password.
Open vars.xml
located at /etc/freeswitch/
and edit the following line:
<X-PRE-PROCESS cmd="set" data="default_password=set your password here"/>
This change is applicable to all users under /etc/freeswitch/directory/default/
. If you want to change the password per user, navigate to /etc/freeswitch/directory/default/
and edit 1000.xml (or any user of your choice).
<param name="password" value="set your password here"/>
Execute reloadxml
in fs_cli utility after making changes to users xml.
fs_cli
in your terminal.reloadxml
.reloadacl
.Reload mod_dialplan_xml
.Service freeswitch restart
.When the account is successfully enabled on X-Lite, it is ready to receive calls. Dial the number provided in the “your_destination_number$” field and the calls will first hit the Plivo inbound zentrunk and then go through your FreeSWITCH to reach your endpoint.
To know more about configuring X-lite for Inbound calls, check the X-lite configuration guide