FreeSWITCH™ is a scalable open source cross-platform telephony suite designed to route and interconnect popular communication protocols using audio, video, text or any other form of media. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.

FreeSWITCH also provides a stable telephony platform on which many telephony applications can be developed using a wide range of free tools.

Additional documentation:

  • Get in touch with FreeSWITCH here

  • Check out their help section for community or paid support.


Instructions For Configuring a FreeSWITCH IP Trunk

In this guide, you will:

  1. Extension configuration for registering a SIP phone

  2. Create a SIP trunk

  3. Create an inbound trunk - DID

  4. Create a dialplan

  5. Configure your network

Pre-Requisites

IMPORTANT: FreeSWITCH™ v1.8 has been tagged End of Life. If you are on this version, you must upgrade.

Video Walkthrough:

Coming soon! Check back frequently as we are updating our documentation.


1. Extension configuration for registering a SIP phone

You may register to one of the existing extensions; however it is recommended that you change the default password in the directory/default/1000.xml file:

<param name="password" value="abcd1234"/>
<!-- Replace abcd1234 with a strong password -->


2. Create the SIP Trunk

Create a file under directory: sip_profiles/external (i.e.: sip_profiles/external/telnyx.xml)

Note: If you have a linksys device (spa2102 spa5xx series), they will reject calls if ptime is not set to 20. Make sure you change that in the phone's configuration (rtp packet size 0.020 [from 0.030]) i.e.: sip_profiles/external/telnyx.xml - telnyx.xml should contain the following:

<!-- File: sip_profiles/external/default.xml -->
<include>
<gateway name="telnyx">
<param name="proxy" value="sip.telnyx.com"/>
<param name="username" value="your_username"/>
<param name="password" value="your_password"/>
<param name="expire-seconds" value="600"/>
<param name="register" value="true"/>
<param name="register-transport" value="udp"/>
<param name="retry-seconds" value="30"/>
<param name="caller-id-in-from" value="true"/>
<param name="ping" value="36"/>
<variables>
<variable name="domain"
value="int.example.net" direction="inbound"/>
<variable name="target_context"
value="int.example.net" direction="inbound"/>
</variables>
</gateway>
</include>

3. Create a Dialplan

File to edit: conf/dialplan/default.xml - add the following lines to default.xml

<extension name="dial">
<condition field="destination_number" expression="^(1{0,1}\d{10})$">
<action application="set" data="effective_caller_id_number=13125489677"/>
<!-- Replace 3125489677 with the DID you want as CID -->
<action application="bridge" data="sofia/gateway/telnyx/$1"/>
</condition>
</extension>


4. Create an inbound trunk - DID

  1. Create a new file in conf/dialplan/public/ and name it after the DID you purchased at Telnyx Mission Control Portal (i.e.: dialplan/public/3125489677.xml - 3125489677.xml).

  2. Add the following lines to this file:

<include>
<extension name="public_did">
<condition field="destination_number" expression="^(13125489677)$">
<!-- Replace 13125489677 with the DID you purchased at the Telnyx Portal -->
<action application="set" data="domain_name=$${domain}"/>
<action application="transfer" data="1000 XML default"/>
</condition>
</extension>
</include>

5. Configure your network

If you want to use the same profile for communication both inside and outside your network, you will need to tell FreeSWITCH™ when it should use the local IP or the external IP.

The autonat: prefix toggles on the usage of the local-network-acl, if you prefix the IP like that it will activate the dynamic ability to tell when it should use ext-rtp-ip vs rtp-ip based on the acl match.

<param name="ext-sip-ip" value="autonat:$${external_sip_ip}"/>

Note: In case FreeSWITCH fails to recognize your public IP you may "force" it to use a static Public IP by modifying sip_profiles/external.xml as follows:

<param name="ext-rtp-ip" value="8.8.8.8"/>
<param name="ext-sip-ip" value="8.8.8.8"/>
<!-- Replace 8.8.8.8 with your public IP -->

Additional Resources

Review our getting started with guide to make sure your Telnyx Mission Control Portal account is setup correctly!

Additionally you can:

  • Get in touch with FreeSWITCH here

  • Check out their help section for community or paid support.


Can't find what you're looking for? Click the chat bubble at your lower right hand corner and start a chat!

Did this answer your question?