Skip to content

IP PBX Configuration - FreePBX

FreePBX is a web based user interface designed to simplify management of Asterisk PBX. SIP Trunk configuration instructions below apply to the following FreePBX versions:

  • FreePBX v. 12 - Asterisk 11
  • FreePBX v. 12 - Asterisk 13 (chan_sip)
  • FreePBX v. 13 - Asterisk 11
  • FreePBX v. 13 - Asterisk 13 (chan_sip)

Documentation is provided for scenario where FreePBX server uses Static IP address on the public Internet and when Dynamic IP address is used.

Static IP address

freepbx-sip-trunking-diagram-static-ip.png

Figure 8.1 FreePBX SIP Trunk - static IP address.


  1. Static IP address (a.b.c.d in our example above) of your FreePBX server will be added to GoTrunk service IP ACL (Access Control List) and outbound calls coming from that IP address will be accepted without requiring any further authentication (SIP username and password). This is the most efficient way of authenticating SIP calls.

  2. Inbound calls to one of Telephone Numbers on your GoTrunk account will be sent directly to FreePBX public IP address. Since the calls will be coming from known peer (IP address of SIP Trunking service q.x.y.z in our example above) FreePBX will accept them without requiring any further authentication.


To configure FreePBX server to work with GoTrunk SIP trunk using IP authentication the following changes are required:


freepbx-add-trunk-static-ip.png

Figure 8.2 FreePBX add SIP Trunk - static IP address.

Follow steps below to add SIP Trunk:

  1. Click Connectivity menu.
  2. Select Trunks.
  3. Click Add Trunk button.
  4. Select `Add SIP (chan_sip) Trunk
  5. Enter name of the trunk as gotrunk
  6. Switch to sip Settings tab.
  7. Switch to Outgoing panel.
  8. Enter gotrunk as Trunk Name.
  9. Enter the following into PEER Details field (replace eu.st.ssl7.net with amn.st.ssl7.net if you want to use North America POP):
type=peer
host=eu.st.ssl7.net
context=from-trunk
  1. Switch to Incoming tab and make all fields blank. Since we use Static IP configuration, registration is not required for incoming calls. Incoming calls will be sent directly to FreePBX public IP address.
  2. Click Submit button.

Next follow "Routing configuration" instructions below.

Dynamic IP address

freepbx-sip-trunking-diagram-dynamic-ip.png

Figure 8.3 FreePBX SIP Trunk - dynamic IP address.


  1. For outbound calls from FreePBX to GoTrunk SIP Credentials (SIP username and password) authentication is used.

  2. For inbound calls to one of Telephone Numbers on your GoTrunk account to work FreePBX needs to Register with GoTrunk service (and periodically refresh registration in case IP address changes). Calls will be sent to IP address which was sent in the most recent FreePBX Registration. Since the calls will be coming from known peer (IP address of SIP Trunking service q.x.y.z in our example above) FreePBX will accept them without requiring any further authentication.

To configure FreePBX server to work with GoTrunk SIP Trunk using SIP Credentials authentication the following changes are required:


freepbx-add-trunk-dynamic-ip.png

Figure 8.4 FreePBX add SIP Trunk - dynamic IP address.

Follow steps below to add SIP Trunk:

  1. Click Connectivity menu.
  2. Select Trunks.
  3. Click Add Trunk button.
  4. Select `Add SIP (chan_sip) Trunk
  5. Enter name of the trunk as gotrunk
  6. Switch to sip Settings tab.
  7. Switch to Outgoing panel.
  8. Enter gotrunk as Trunk Name.
  9. Enter the following into PEER Details field (replace eu.st.ssl7.net with amn.st.ssl7.net if you want to use North America POP):
type=peer
host=eu.st.ssl7.net
context=from-trunk
qualify=yes
defaultuser=outbound_sip_username   ; <- replace with your Outbound SIP Username
remotesecret=outbound_sip_password  ; <- replace with your Outbound SIP Password
  1. Switch to Incoming tab.
  2. Enter the following into Register String:
incoming_sip_username:incoming_sip_password@eu.st.ssl7.net
  1. Click Submit button.

Next follow "Routing configuration" instructions below.

Routing configuration

Outbound route

freepbx-outbound-routes.png

Figure 8.5 FreePBX add Outbound route.

Follow steps below to add Outbound route:

  1. Click Connectivity.
  2. Select Outbound Routes.
  3. Click Add Outbound Route button.
  4. Enter gotrunk as Route Name
  5. Select gotrunk in Trunk Sequence for Matched Routes drop down list.
  6. Switch to Dial Patterns tab.
  7. Enter ZXXXXXX. to send numbers longer than 7 digits to GoTrunk service.
  8. Click Submit button.

Inbound routes

freepbx-inbound-routes.png

Figure 8.6 FreePBX add Inbound routes.

For each of the Telephone Numbers on your GoTrunk account follow steps below to add Inbound route:

  1. Click Connectivity.
  2. Select Inbound Routes.
  3. Click Add Inbound Route button.
  4. Enter Telephone Number into Description field.
  5. Enter Telephone Number into DID Number field.
  6. Set desired destination from the drop down list.
  7. Click Submit button.

Note: make sure to click Apply Config button in top right corner of the page to reload your FreePBX configuration.

Configuration note

Some FreePBX distributions has default SIP listening port as 5160 instead of the standard SIP port.

To make incoming calls work we need to modify SIP port under FreePBX to 5060. This can be done from Settings > Asterisk SIP settings, under Chan SIP Settings, you will need to set Bind port to 5060.

If you deployed IP Authentication you have one other option. You can also set remote SIP port to 5160 under GoTrunk. This can be done by editing Endpoint SIP under GoTrunk settings and set port to 5160