FreePBX configure SIP trunk

In this post I will explain How to setup SIP trunk both inbound and outbound, This works for almost every VoIP provider, You just need to change SIP credentials.

First Create SIP Trunk:

  1. Log in to the FreePBX web interface as an administrator.
  2. Go to the Connectivity tab and select Trunks.
  3. Click the Add Trunk button.
  4. Select the SIP (chan_sip) option and click Submit.
  5. Enter a name for the trunk in the Trunk Name field. This is for your reference only and can be any name you choose.
  6. In the PEER Details section, enter the following information:
  • host=The hostname or IP address of the SIP provider’s server
  • type=friend
  • nat=yes (if the PBX and the SIP provider’s server are on different networks)
  1. In the USER Context section, enter a unique name for the context. This is the name of the extension that will be used to connect to the trunk.
  2. In the USER Details section, enter the following information:
  • username=The username provided by the SIP provider
  • secret=The password provided by the SIP provider
  1. In the REGISTRATION section, enter the following information:
  • username=The username provided by the SIP provider
  • secret=The password provided by the SIP provider
  • host=The hostname or IP address of the SIP provider’s server
  1. Click Submit to save the trunk configuration.
FreePBX SIP Trunk setting
FreePBX Trunk outbound
FreePBX Inbound trunk

Inbound Route setting to receive incoming calls

In FreePBX, inbound routes allow you to specify how incoming calls from a specific trunk should be handled. Here are the steps for configuring inbound routes in FreePBX:

  1. Go to the Connectivity tab and select Inbound Routes.
  2. Click the Add Inbound Route button.
  3. Enter a name for the inbound route in the Description field. This is for your reference only and can be any name you choose.
  4. Select the trunk that you want to use for this inbound route from the Trunk drop-down menu.
  5. In the DID Number field, enter the direct inward dial (DID) number that you want to use for this inbound route. This is the number that incoming calls will be directed to.
  6. In the Destination field, select the destination for the incoming calls. This can be an extension, a ring group, a queue, or another destination.
  7. If you select the Time Conditions option, you can specify the hours during which this inbound route should be active. If you want the route to be active all the time, leave this field blank.
  8. If you select the Call Group option, you can specify a call group for the incoming calls. This allows you to route calls to a group of extensions that can answer the call.
  9. Even you can send it directly to voicemail of any extension.
  10. Click Submit to save the inbound route configuration.
FreePBX inbound route sip trunk

FreePBX outbound route setting to make calls

  1. Go to the Connectivity tab and select Outbound Routes.
  2. Click the Add Outbound Route button.
  3. Enter a name for the outbound route in the Description field. This is for your reference only and can be any name you choose.
  4. In the Dial Patterns field, enter the dial patterns that you want to use for this outbound route. These can be specific numbers or number ranges, or you can use wildcards to match multiple numbers.
  5. In the Trunk Sequence field, select the trunks that you want to use for this outbound route. You can specify multiple trunks and specify the order in which they should be tried.
  6. Click Submit to save the outbound route configuration.
Freepbx outbound route setting
Freepbx outbound route dialplan
You want to use PjSIP instead of SIP, You should read this blog post.

How do I connect my SIP trunk to my PBX?

To connect a SIP trunk to a PBX, you will need to configure the PBX with the hostname or IP address of the SIP provider’s server, as well as the username and password provided by the SIP provider.

You will also need to specify the extension or context to use for the SIP trunk. Once these settings are configured, the PBX should be able to connect to the SIP provider’s server and make and receive calls through the SIP trunk.

Is FreePBX a SIP server?

t is not a SIP server itself, but it can be used to configure and manage a SIP server running on the Asterisk PBX.

With FreePBX, you can set up SIP trunks, configure inbound and outbound routes, create extensions, and manage other aspects of your PBX system.

Can I create my own SIP trunk?

Yes, it is possible to create your own SIP trunk. To do this, you will need to set up a SIP server, such as Asterisk, Freeswitch, FusionPBX and configure it with the necessary settings for your SIP trunk.