Content

Freeswitch is an open-source alternative to Asterisk to build a telephony server. It was launched by a member of the Asterisk development team who wanted to rewrite the whole thing from scratch to cleanly separate the switching part from the PBX part.

1. Install EPEL

We will install two repository namely epel and the one provided by freeswitch. To install these two execute the following commands in the terminal.

#  wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-7.noarch.rpm
#  rpm -ivh epel-release-7-7.noarch.rpm

Install EPEL release

Now install freeswitch release

# rpm -Uvh http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm

Install freeswitch repository

2. Install freeswitch

To install it, execute the following two command. The total download size is around 33 MB for all the files in freeswitch-config-vanilla and the download size for all sound files is around 760MB.

# yum install freeswitch-config-vanilla

Install freeswitch

Next install sounds

# yum install sox freeswitch-sounds* -y

Install freeswitch sounds

Installation is now complete.

Execute the following commands to enable it during boot.

# systemctl enable freeswitch

Restart it

# systemctl restart freeswitch

To get the console, execute the following command from terminal.

# fs_cli

Now you will be welcome by a console, like below

Type commands in freeswitch console

 

Now type show status from console. It will display all details.

#freeswitch@demohost.com> show status

Freeswitch status

The installation is now complete.

3. Add users

To add a user, navigate to /etc/freeswitch/directory/default directory and create a file by the name 1000.xml and add the following.

# cd /etc/freeswitch/directory/default
# vi 1000.xml

<include>
<user id=”1000″>
<params>
<param name=”password” value=”default.123″/>
<param name=”vm-password” value=”1000″/>
</params>
<variables>
<variable name=”toll_allow” value=”domestic,international,local”/>
<variable name=”accountcode” value=”1000″/>
<variable name=”user_context” value=”default”/>
<variable name=”effective_caller_id_name” value=”Extension 1000″/>
<variable name=”effective_caller_id_number” value=”1000″/>
<variable name=”outbound_caller_id_name” value=”$${outbound_caller_name}”/>
<variable name=”outbound_caller_id_number” value=”$${outbound_caller_id}”/>
<variable name=”callgroup” value=”techsupport”/>
</variables>
</user>
</include>

Create freeswitch user

Change the ownership of the file.

# chown freeswitch:daemon 1000.xml

Similarly, create another user in 1001.xml. Replace all occurrences of 1000 with 1001 in the above file and change the password.

<include>
<user id=”1001″>
<params>
<param name=”password” value=”edmund1001″/>
<param name=”vm-password” value=”1001″/>
</params>
<variables>
<variable name=”toll_allow” value=”domestic,international,local”/>
<variable name=”accountcode” value=”1001″/>
<variable name=”user_context” value=”default”/>
<variable name=”effective_caller_id_name” value=”Extension 1001″/>
<variable name=”effective_caller_id_number” value=”1001″/>
<variable name=”outbound_caller_id_name” value=”$${outbound_caller_name}”/>
<variable name=”outbound_caller_id_number” value=”$${outbound_caller_id}”/>
<variable name=”callgroup” value=”techsupport”/>
</variables>
</user>
</include>

Change the ownership.

# chown freeswitch:daemon 1001.xml

Now open the file  /etc/freeswitch/dialplan/default.xml using any editor and modify the  destination_number  and application=”bridge” part under extension section “Local Extension” around line 266. If you have already configured the domain name then you don’t have to add IP address part in bridge parameter. Just Keep it like below.

<action application=”bridge” data=”user/${dialed_extension}@${domain_name}”/>

If you have not configured the domain name then edit the above line and add IP address in place of {domain_name}.

……………..

……………..

……………..

<extension name=”Local_Extension”>
<condition field=”destination_number” expression=”^(1[0-9]{3})$”>
<!– This will dial a registered phone at the ip or domain name you set in the globals section –>
<!– (The % indicates it is an internal extension)  –>
<action application=”set” data=”dialed_extension=$1″/>
<action application=”export” data=”sip_auto_answer=true”/>
<action application=”bridge” data=”user/${dialed_extension}@103.38.75.11“/>
</condition>

……………..

……………..

……………..

Reload new configuration.

freeswitch@your-host> reloadxml

Reload xml

4. Install Zoiper in client

We have created two users in the last step. Download and install zoiper in two separate client system from https://www.zoiper.com/en/voip-softphone/download/zoiper3 . Extract the downloaded zoiper directory and run the installer according to your client’s architecture.

# ./Zoiper_3.3_Linux_Free_32Bit.run
              OR
# ./Zoiper_3.3_Linux_Free_64Bit.run

 

 Zoiper setup step1

 

Click “Forward”

 

Zoiper accept license

 

Accept the license.

 

Zoiper select components

 

Click “Forward”

 

Zoiper choose installation location

 

Choose installation directory

 

Choose installation location

 

Click “Forward”

 

Click forward

 

Again click “Forward”

 

Click forward

 

Click finish to complete the installation

 

Click “Finish”

 

Choose "Yes" or "No"

 

Choose “Yes” or “No”. The zoiper installation is now complete.

 

5. Configure Zoiper

Run the zoiper and click settings-> Audio wizard  and configure speaker and microphone. Once you have finished testing “microphone” and “speakers” , click “settings”->create a new account. Choose “SIP” and click next.

 

Create new account in Zoiper

 

Enter user/password that we have created earlier along with domain. If you have already configured the domain then you don’t have to put IP address. Click “Next”.

 

Provide zoiper username and password

 

Give a name of the account.

 

Give a name of zoiper account

 

Click “Next” , your account will be added to the list.

 

Click Next

 

If you now click  “Settings”->“Preferences”  and then “General” and “advance” tab, it will look  like below.

 

Zoiper preferences

 

Zoiper advance preferences

 

Repeat the same process for user 1001 in another system. Now as a user ‘1000’ dial the user ‘1001’ or vice-versa, you will get a screen like below stating its status as “ringing”.  Once the user “1001” accept your call, you will get connected with the user ‘1001’.

 

Zoiper outbound call

 

Now you have a basic PBX which allows the SIP users to register and place and receive calls.

Was this article helpful to you?

DD2016

2 Responses to “How to setup freeswitch in CentOS 7”

  1. zoro

    i am gettin error while reloading xml and error is as follows
    reloadxml
    +OK [[error near line 7297]: missing >]

    2016-11-14 06:51:23.378813 [ERR] switch_xml.c:1310 Error including /etc/freeswitch/lang/de/*.xml
    2016-11-14 06:51:23.400781 [ERR] switch_xml.c:1310 Error including /etc/freeswitch/lang/fr/*.xml
    2016-11-14 06:51:23.400781 [ERR] switch_xml.c:1310 Error including /etc/freeswitch/lang/ru/*.xml
    2016-11-14 06:51:23.400781 [ERR] switch_xml.c:1310 Error including /etc/freeswitch/lang/he/*.xml
    2016-11-14 06:51:23.400781 [INFO] switch_xml.c:1313 No files to include at /etc/freeswitch/lang/es/es_ES.xml
    2016-11-14 06:51:23.400781 [INFO] switch_xml.c:1313 No files to include at /etc/freeswitch/lang/pt/pt_BR.xml

    Can you please guide me what i need to make changes in that /etc/freeswitch/dialplan/default.xml file coz i have changed the way you have guided here but error remains as above.

  2. Admin

    Ensure you follow through the guides carefully.
    Have you ensure the ownership of the folder are correctly set?

    http://prntscr.com/d8fmk8

Comments are closed.