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.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. -
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.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:
Follow steps below to add SIP Trunk:
- Click
Connectivity
menu. - Select
Trunks
. - Click
Add Trunk
button. - Select `Add SIP (chan_sip) Trunk
- Enter name of the trunk as
gotrunk
- Switch to
sip Settings
tab. - Switch to
Outgoing
panel. - Enter
gotrunk
as Trunk Name. - Enter the following into
PEER Details
field (replaceeu.st.ssl7.net
withamn.st.ssl7.net
if you want to use North America POP):
type=peer
host=eu.st.ssl7.net
context=from-trunk
- 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. - Click
Submit
button.
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.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:
Follow steps below to add SIP Trunk:
- Click
Connectivity
menu. - Select
Trunks
. - Click
Add Trunk
button. - Select `Add SIP (chan_sip) Trunk
- Enter name of the trunk as
gotrunk
- Switch to
sip Settings
tab. - Switch to
Outgoing
panel. - Enter
gotrunk
as Trunk Name. - Enter the following into
PEER Details
field (replaceeu.st.ssl7.net
withamn.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
- Switch to
Incoming
tab. - Enter the following into
Register String
:
incoming_sip_username:incoming_sip_password@eu.st.ssl7.net
- Click
Submit
button.
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 Route
button. - Enter
gotrunk
asRoute Name
- Select
gotrunk
inTrunk Sequence for Matched Routes
drop down list. - Switch to
Dial Patterns
tab. - Enter
ZXXXXXX.
to send numbers longer than 7 digits to GoTrunk service. - Click
Submit
button.
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 Route
button. - Enter Telephone Number into
Description
field. - Enter Telephone Number into
DID Number
field. - Set desired destination from the drop down list.
- 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