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¶

-
Static IP address (
a.b.c.din 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. -
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 serviceq.x.y.zin 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:

Follow steps below to add SIP Trunk:
- Click
Connectivitymenu. - Select
Trunks. - Click
Add Trunkbutton. - Select `Add SIP (chan_sip) Trunk
- Enter name of the trunk as
gotrunk - Switch to
sip Settingstab. - Switch to
Outgoingpanel. - Enter
gotrunkas Trunk Name. - Enter the following into
PEER Detailsfield (replaceeu.st.ssl7.netwithamn.st.ssl7.netif you want to use North America POP):
type=peer
host=eu.st.ssl7.net
context=from-trunk
- Switch to
Incomingtab 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. - Click
Submitbutton.
Next follow "Routing configuration" instructions below.
Dynamic IP address¶

-
For outbound calls from FreePBX to GoTrunk SIP Credentials (SIP username and password) authentication is used.
-
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.zin 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:

Follow steps below to add SIP Trunk:
- Click
Connectivitymenu. - Select
Trunks. - Click
Add Trunkbutton. - Select `Add SIP (chan_sip) Trunk
- Enter name of the trunk as
gotrunk - Switch to
sip Settingstab. - Switch to
Outgoingpanel. - Enter
gotrunkas Trunk Name. - Enter the following into
PEER Detailsfield (replaceeu.st.ssl7.netwithamn.st.ssl7.netif 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
- Switch to
Incomingtab. - Enter the following into
Register String:
incoming_sip_username:incoming_sip_password@eu.st.ssl7.net
- Click
Submitbutton.
Next follow "Routing configuration" instructions below.
Routing configuration¶
Outbound route¶

Follow steps below to add Outbound route:
- Click
Connectivity. - Select
Outbound Routes. - Click
Add Outbound Routebutton. - Enter
gotrunkasRoute Name - Select
gotrunkinTrunk Sequence for Matched Routesdrop down list. - Switch to
Dial Patternstab. - Enter
ZXXXXXX.to send numbers longer than 7 digits to GoTrunk service. - Click
Submitbutton.
Inbound routes¶

For each of the Telephone Numbers on your GoTrunk account follow steps below to add Inbound route:
- Click
Connectivity. - Select
Inbound Routes. - Click
Add Inbound Routebutton. - Enter Telephone Number into
Descriptionfield. - Enter Telephone Number into
DID Numberfield. - Set desired destination from the drop down list.
- Click
Submitbutton.
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