Configuring FreePBX to connect with Zentrunk

Zentrunk is a SIP Trunking service from Plivo that allows you to connect with fixed and mobile phones in over 200 countries. Connect your cloud or on-premise communication infrastructure to Plivo’s Zentrunk SIP Trunking service to connect to your customers easily.

This documentation provides a basic configuration to get FreePBX up and running with Plivo as the external SIP gateway.

To get started with Zentrunk using FreePBX you would need to do the following:

  1. Install FreePBX on your environment.
  2. Create a Trunk on Zentrunk using Plivo Console.
  3. Configure Outbound Trunk on FreePBX to connect to the Trunk created in the previous step.

Installation of FreePBX

To start using Zentrunk, you would need to install FreePBX on your environment. If you already have a FreePBX instance running, you may ignore this step.

For more information on installing FreePBX, check the following official installation guides:

  • Follow the instructions here to install FreePBX on Debian.
  • Follow the instructions here to install FreePBX on CentOS.
  • Follow the instructions here to install FreePBX on Ubuntu.

Create a Trunk on Zentrunk

You can create a trunk using Plivo Console. For more information on creating a Trunk on Plivo Console, see Getting Started with Zentrunk.

Configuring Outbound Trunk on FreePBX

Configuring your Outbound Trunk involves the following steps:

  1. Adding a Trunk
  2. Adding Outbound Routes
  3. Configuring an Extension
  4. Configuring X-Lite Note: There are many softphones that you can use (for example, X-Lite, Blink for Linux, etc). In this tutorial, we will be using the X-Lite Softphone.

To add a trunk

  1. From your FreePBX dashboard, hover over the Connectivity menu, and then click on Trunks.
  2. On the Trunks page, click Add Trunk, and then click Add SIP (chan_sip) Trunk.
  3. On the Add Trunk page, enter the following details in the General tab:
    • Trunk Name: A friendly name for the trunk (for example, demo-trunk)
    • Outbound Caller ID: Caller ID for the calls placed using this trunk. This has to be in the following SIP format:
       "demo" <phone-number>

      image alt text

  4. Next, enter the following details in the sip Settings tab:
    • Host - Termination SIP Domain of your Plivo Trunk
    • Username - Username for TestAuthGroup
    • Password - Password for TestAuthGroup
    • Peer - Creates a peer connection image alt text
  5. Add dial pattern, you can choose to match any specific digits or use “.” as a wildcard to match one or more characters. image alt text
  6. Enter a friendly name for the Trunk in the Trunk Name field, and then click Submit. A trunk will be created. You must now configure an outbound route to this trunk.

To add an outbound route

  1. From the Connectivity menu, click Outbound Routes.
  2. On the Outbound Routes page, click Add Outbound Route.
  3. In the Outbound Route - Add Route page, enter a friendly name for the route in the Route Name field.
  4. From the list of Trunk Sequence for Matched Routes, select the trunk you created in the previous section (demo-outbound). image alt text
  5. Next, on the Dial Patterns tab, enter the dial pattern that matches your system. Note: You can choose to match any specific digits or use “.” as a wildcard to match one or more characters. image alt text
  6. Once you have entered your dial pattern, click Submit. The outbound route will be configured to your trunk. You must now configure an extension.

To add an extension

  1. From the Applications menu, click Extensions.
  2. On the Extensions page, click Add New Chan_SIP Extension from the Add Extension list. The Add SIP Extension page appears.
  3. In the General tab, enter the following details:
    • User Extension - The extension number to dial to reach the user
    • Display name - The callerID name for calls from this user will be set to this name
    • Secret - Password configured for the device image alt text
  4. Once done, click Submit. Your extension is created.
  5. On the All Extensions tab, in the Actions column, click edit for your extension.
  6. In the Advanced tab, under the Edit Extension section, change the configuration for NAT Mode to Yes - (force_rport,comedia). image alt text
  7. Click Submit. Your extension will be created.

Asterisk SIP Settings

  1. From Setting menu, click Asterisk SIP Settings.
  2. Next, enter the following details in the General SIP Settings tab:
    • External Address - Click on ‘Detect Network Settings’ and copy the value for future reference image alt text
  3. Next, enter the following details in the Chan SIP Settings tab in Advance General Settings section :
    • Bind port - 5060
    • TLS Bind Port - 5061 image alt text
  4. Click Apply Config on the top navigation bar. All your configurations are complete. You can now configure X-Lite to use your Trunk. Note: In case you get an error while configuring your softphone, make sure you have clicked Apply Config on FreePBX.

To configure X-Lite

  1. Download and install X-Lite.
  2. On X-Lite, navigate to Preferences.
  3. On the Accounts tab, click Add Account, and then click New SIP Account.
  4. Enter the User ID and Authorization name. Use the extension name for the User ID and Authorization name.
  5. In the Domain field, enter the domain of your FreePBX machine.
  6. In the Password field, enter the password for your extension.
  7. Once you have configured X-Lite, click OK. Your endpoint entry will be displayed in the Accounts tab. If all configuration details are accurate, the status will show the account as enabled. image alt text