Skip to main content
FreePBX V15: Credentials - PJSIP

Learn how to configure a FreePBX V15 Credentials trunk with Telnyx using PJSIP

C
Written by Customer Success
Updated over 11 months ago

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.

PJSIP is an Open Source and separate extension of the Asterisk, and Asterisk derived systems. It provides a resource for assigning multiple trunks via SRV addresses, and more options. PJSIP also provides three main components of real-time multimedia application, i.e. signaling, media features, and NAT traversal, among other things that have been taken care of by PJSIP.

We suggest using PJSIP as an upgrade from Chan_SIP, as Chan_SIP is outdated, and the majority of users are moving to PJSIP which provides a number of more future proof options, and is still actively being improved by the community. You can find out more about PJSIP here.

Additional documentation and resoruces:


Instructions for Configuring a FreePBX V15 IP Trunk

In this activity you will:

Pre-requisites

Video Walkthrough

Setting up your Telnyx SIP portal account so you can make and receive calls:

Note: Video walkthrough for FreePBX/Telnyx configuration coming soon. Check back as we update our docs.

1. Install your FreePBX V15

In this section, you'll go through the steps you need to follow to install FreePBX.

  1. Once you load the 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 16.

    A loaded virtual machine/server.

  2. You'll be prompted for your preferred video method you want to install.

    Video method selection tab.

  3. The installer will now start.

    Active installer.

  4. You'll notice that the root password is not set. You will need to click on the root password box to set your root password. The installation process can not complete until this is done.

    Installer root password settings.

  5. Type in your root password and confirm it a second time and click on the Done option in the top left screen.

    Root password confirmation.

  6. At this time the FreePBX package itself can take 15 or more minutes to install and does requires access to the internet so depending on your internet speeds it can take awhile to install so be patient.

    A page showing an ongoing FreePBX installation.

  7. Once the install has 100% completed it will give you a reboot option as shown below. Click on reboot your your system is now installed.

    A page showing a complete configuration.

  8. Once the process is complete, you'll reach the Linux console/command prompt login. You can log in here using the username "root" without quotes, and the Root password you selected earlier.

    IP Address tab.

  9. After you log in, you should see the IP address of your PBX as shown below. Take note of this IP address as you will need it in the next step.

    IP address tab.

  10. Enter the IP address of the new PBX into your web browser. The first time you do so, you'll be asked to create the admin username and the admin password. That username and password will be used in the future to access the FreePBX configuration screen.

    Note: These passwords do not change the Root password! They are only used for access to the FreePBX web interface.

    FreePBX support initial setup interface.


2. Configuring basic settings for your FreePBX

In this step, you'll configure your FreePBX V15 and connect it to Telnyx. To begin, notice that the main FreePBX screen will offer you four options:

FreePBX basic settings.

  • FreePBX Administration will allow you to configure your PBX. Use the admin username and admin password you configured in the step above to login. This section is what most people refer to as "FreePBX."

  • User Control Panel is where a user can log in to make web calls, set up their phone buttons, view voicemails, send and receive faxes, use SMS & XMPP messaging, view conferences, and more, depending on what you have enabled for the user, see User Control Panel (UCP) 14+ for more information.

  • Operator Panel is a screen that allows an operator to control calls (needs additional licensing)

  • Get Support takes you to a web page about various official support options for FreePBX.

  1. Enter the username, password, and admin email address in order to create your account.

    Initial setup settings interface.
  2. Once you've created your account, you'll be brought to the dashboard. Select FreePBX Administration and enter your username and password.

  3. Follow the process to activate your FreePBX V15.

    FreePBX server welcome page.

    1. Select your default locales.

      Default locales settings.

    2. You'll be presented with some firewall details and other suggestions. You are welcome to set this up based on your requirements.

    3. Once you're back at the dashboard, you'll see more detail.

      FreePBX dashboard.



3. Configuring SIP settings for your FreePBX

At this point you can now work on confirming network settings and configuring your SIP trunks and extensions.

  1. Make your way to Settings -> Asterisk SIP Settings in order to confirm your network settings.

  2. You'll want to ensure you populate the external and local network addresses under General SIP Settings and PJSIP Settings.

  3. Click Submit and then Apply Config.

    Asterisk SIP settings.


4. Configure Extensions for your Free PBX

In this section, you'll configure all your PJSIP extensions.

  1. Make your way to Applications -> Extensions -> Add Extension -> Add New Chan PJSIP 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.

    Applications settings.

    Note that if you do not set an Outbound CID for your extension, you will need to enable this on your trunk.

    This device uses PJSIP technology listening on Port 5060 (UDP)

  2. Click Submit and Apply Config.

    PJSIP addition extension.

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.


5. Configure a Trunk for your FreePBX

  1. Make your way to Connectivity -> Trunks -> Add Trunk -> Add New PJSIP Trunk. You'll now be located in the General tab.

  2. Enter a Trunk name, your Outbound CID and the maximum channels you'd like for this trunk.

    Trunk editing page.

    Note: 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.

  3. Proceed to the Dialed Number Manipulation Rules tab. Depending on your use case, we've provided a simple dial pattern US numbers below.

    Trunk Addition page.

    For US numbers:

    1. prepend:1; match pattern: NXXNXXXXXX

    2. prepend: blank; match pattern: 1NXXNXXXXXX

    International:

    1. prepend: Country Dialing prefix; match pattern: NXXNXXXXXX

    2. prepend:blank; match pattern: (Country Dialing prefix)NXXNXXXXXX


6. Configure PJSIP Outbound Settings for your FreePBX

PJSIP settings in the trunk editing section.
  1. Make sure to specify:

    1. Username: as the credential based SIP Connections username from your Telnyx account.

    2. Auth Username: as the credential based SIP Connections username from your Telnyx account.

    3. Secret: as the credential based SIP Connections password from your Telnyx account.

    4. SIP Server: as your preferred Telnyx SIP Proxy (sip.telnyx.com in this instance for USA).

    5. SIP Server Port: 5060 if you are using UDP or TCP transport. 5061 if you are using TLS transport.

      PJSP settings configuration.
  2. Click Submit and Apply Config.

  3. You might see something like "WARNING: This trunk is not used by any routes! This trunk will not be able to be used for outbound calls until a route is setup that uses it."


7. Set up call routing on your FreePBX

  1. Make your way to Connectivity -> Outbound Routes -> Add Outbound Route

    Outbound routes section.
  2. In Route Settings:

    1. Set the route name

    2. Ensure Telnyx Trunk is selected for the trunk sequence

      Outbound routes for Telnyx trunk.
  3. In Dial Patterns:

    1. Use the dial pattern wizards to make all the dial patterns that apply to you.

      Dial patterns for Telnyx.
  4. Click Generate Routes, Submit and Apply Config.

  5. Now make your way to Connectivity -> Inbound Routes -> Add Inbound Route.

  6. Enter the route name description, DID associated with this route and specify the extension that should be associated when calls are received to the DID.

    Inbound routes for incoming routes.
  7. Click Submit and Apply Config.

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 V15 Credentials PJSIP 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 setup correctly!

Additionally, check out:


Did this answer your question?