FreePBX is a web-based open source GUI (graphical user interface) that controls and manages Asterisk (PBX), an open source communication server. FreePBX is licensed under the GNU General Public License (GPL), an open source license. FreePBX can be installed manually or as part of the pre-configured FreePBX Distro that includes the system OS, Asterisk, FreePBX GUI and assorted dependencies.
You'll need to have created a Credentials based connection on your Telnyx Mission Control Portal account, assigned this connection to a DID and outbound profile in order to make and receive calls.
Additional documentation and resources:
FreePBX documentation (This is useful for any configuration instructions that don't involve Telnyx and are maintained solely by FreePBX)
Instructions to Configure a FreePBX ChanSIP V13
Note: By default, when creating a SIP Connection in the Telnyx Mission Control Portal, the number formats for the ANI and DNIS will be set to E.164. This means Telnyx will send the dialled number in the SIP INVITE to your FreePBX system with 11 digits. As the DID number above is in 11 digit format, the call will be accepted and routed to the extension. However, you can control the number formats as you desire and can read more about it here. |
In this activity you will:
Install FreePBX (You can also follow instructions provided by FreePBX)
Pre-requisites
Have created a credentials based connection on your Telnyx Mission Control Portal account, assigned this connection to a DID and outbound profile in order to make and receive calls.
Download and install FreePBX. You can also see our installation guide below.
RECOMMENDED: Enable TLS to encrypt your traffic
Video walkthrough
Setting up your Telnyx SIP portal account so you can make and receive calls:
Configuring your Telnyx SIP trunk with FreePBX
1. Install FreePBX
Once you've loaded the FreePBX ISO onto your server or virtual machine, you'll have a few options to select for installation. We'll be doing a full install via asterisk 13. So go ahead and run the installer.
Steps:
Select Full Install.
Confirm your network settings.
Confirm your root password.
Wait for all the necessary packages to be installed.
More modules will be updated after successful internet tests.
Enter root and the password you created from step 2.
You'll now be provided with the URL to access the FreePBX web interface.
You'll be brought to the initial setup and must enter in the username, password and admin email address to create your account.
Once you've created your account, you'll be brought to the dashboard. Select FreePBX Administration, enter your username and password.
Follow the process to activate your FreePBX V13.
Select your default locales.
You'll be presented with some firewall details and other suggestions. You are welcome to set this up based on your requirements.
2. Configure your SIP trunk
In this section, you'll set up and configure your SIP trunk and connect Telnyx to FreePBX.
Tab: General SIP Settings
Make your way to Settings > Asterisk SIP Settings in order to confirm your network settings.
You'll want to ensure you populate the external and local network addresses under General SIP Settings and Chan SIP Settings.
Once you've completed this, click Submit and then Apply Config.
Now go to Applications -> Extensions > Add Extension > Add New Chan SIP Extension. The Outbound CID is the number you purchased from your Telnyx Mission Control Portal. The extensions secret may need to be populated under the Other tab.
Note that if you do not set an Outbound CID for your Extension, you must enable this on your trunk. See the Pre-requisites section.
Note: This device uses CHAN_SIP technology listening on Port 5160 (UDP - this is a NON STANDARD port).
Click Submit and Apply Config.
For testing purposes, you can now use your SIP client to register with FreePBX using the username, password/secret and local IP address of your FreePBX.
Now we'll set up your trunk. Go to Connectivity -> Trunks -> Add Trunk -> Add New Chan SIP Trunk. You'll now be located in the General tab. Provide the following information:
Trunk Name: Your Outbound CID and the maximum channels you'd like for this trunk.
Note: Enter a Trunk name, your Outbound CID and the maximum channels you'd like for this trunk. If you choose not to set an Outbound CID on your trunk, then you must set an Outbound CID on each relevant extension. If you do not set a caller ID on either the trunk or each extension, then your calls will reach our SIP proxy without a valid caller ID. You may instead choose to enable a Caller ID Override in your SIP Connection’s Outbound Options from within the Telnyx Portal. Please review our caller ID number policy for accepted formats.
Tab: Dialed Number Manipulation Rules
Click on the Dialed Number Manipulation Rules tab. You can leave this entire section in its default state, but you can also enter dial patterns here:
Click on the Settings tab and on the General sub-tab, provide the following:
Username : Your Telnyx account username
Secret : The password for your Telnyx trunk found under the connection → "show password" link in your Telnyx portal
Authentication : Outbound
Registration : Send
Language Code : English (or the language you wish to conduct calls in)
SIP Server : sip.telnyx.com
SIP Server Port : 5060 if you have not enabled TLS encryption. If you have, choose 5061.
Context : from-pstn
Transport : UDP or TCP if you have not enabled TLS encryption. If you have, choose TLS/TCP.
Open the Settings > Advanced sub-tab and adjust the following:
Open the SIP Settings > Codecs sub-tab and adjust the following:
Select ulaw, alaw, gsm, g722, g729, Opus. All other boxes should be unchecked, as these are the Telnyx-supported codecs.
If you plan to do any video communication, Telnyx supports the H264 video codec.
Proceed to the SIP Settings tab. In the sub tabs outgoing and incoming.
Outgoing settings for your SIP trunk:
Inbound settings for your SIP trunk:
username: Your Telnyx SIP credentials username
secret: Your Telnyx SIP credentials password
fromdomain: sip.telnyx.com
host: sip.telnyx.com
type: friend
insecure: port,invite
qualify: yes
disallow: all
allow: ulaw&alaw
dtmfmode: rfc2833
Register String: Your Telnyx SIP credentials username:Your Telnyx SIP credentials password@sip.telnyx.com/Your Telnyx SIP credentials username
Example: dillin1234:mypassword123@sip.telnyx.com/dillin1234
3. Configure outbound routes
Outbound routing is a set of rules that tells FreePBX which Telnyx trunk to use for any given outbound call. Having multiple trunks allows you to control cost by routing calls over the least costly trunk for a particular call. Outbound routes are used to specify what numbers are allowed to go out a particular route.
You will want to make sure you define routes for all types of calls. Not defining a route can leave your users frustrated when they need to make an important call.
Navigate to Connectivity -> Outbound Routes.
Create a new outbound route and provide the following on the Route Settings tab:
Route Name: Something distinct that makes sense for your route purpose.
Trunk Sequence for Matched Routes: Select the trunk you just created in section 2.
Route Name : Outbound_Telnyx
Route CID : Number you purchased on the Telnyx portal.
Trunk Sequence for Matched Routes : Select the trunk you just created in section 2.
Now select the Dial Patterns tab to the right of the Route Settings tab and enter dial patterns exactly as you see in the following image. This pattern allows you to dial 10 Digits (U.S. Calling), 11 Digits (North American Calling).
If you need dial patterns for a region outside North America, please contact Telnyx support.Note that our current documentation portal shrinks screenshots, making some detail difficult to see. Right-click on the image above and select "Open image in new tab" from the context menu. This will open the image in a new tab and display it at its full size and resolution.
Click Submit, then Apply Config.
4. Configure inbound routes
When a call comes in from the outside, it'll need to be directed from sip.telnyx.com to the phone extension you ultimately want it to go, such as a user extension or an IVR extension.
In this section, we'll configure our own inbound routes.
Make your way to Connectivity -> Inbound Routes and open the General tab.
The following image demonstrates an inbound route that will send ANY call to a certain extension.
To direct a specific number to a specific extension you would create a route and set the "DID Number" field to your 11 digit DID with sip.telnyx.com (for instance : 12172031700).
Note: By default, when creating a SIP Connection in the Telnyx Mission Control Portal, the number formats for the ANI and DNIS will be set to E.164. This means Telnyx will send the dialled number in the SIP INVITE to your FreePBX system with 11 digits. As the DID number above is in 11 digit format, the call will be accepted and routed to the extension. However, you can control the number formats as you desire and can read more about it here. |
That's it, you've now completed the configuration of FreePBX ChanSIP V13 Credentials Trunk and can now make and receive calls by using Telnyx as your SIP provider.
Additional Resources
Review our getting started with guide to make sure your Telnyx Mission Control Portal account is set up correctly.
Additionally, you can check out: