FreePBX - Setup guide

How to setup FreePBX to work with a User-Based or IP-Based SIP Trunk

Permiting TTNC traffic through Sangoma Firewall

The most up to date list of TTNC IPs can be found here: How to setup VoIP destinations

If you are using the Sangoma Firewall, place our IPs within the trusted zone so no filtering will be applied within the FreePBX control panel. This can be done by navigating to ConnectivityFirewallNetwork

You can also enable the 'Responsive Firewall' here to block repeated malicious registration attempts.


Registering a User-Based SIP Trunk

This is a general guide for configuring TTNC SIP trunks with FreePBX; the SIP driver used will be chan_pjsip. UI changes may occur between different versions, but it should be possible to use this guide for any recent installations of the software. This guide is based on version 14.0.5.

This guide assumes you have successfully installed FreePBX and you have the following configured:

  • You have configured an Administrative user
  • Permitted TTNC traffic through your firewall
  • You have created one or more extensions that are registering correctly

🚧

Inbound Numbers

Multiple inbound numbers are not supported on a User-Based trunk. To configure individual numbers, you will have to use an IP authenticated trunk.

Navigate to ConnectivityTrunks
Click Add TrunkAdd SIP (chan_pjsip) Trunk

Under General, set the following:

FieldValue
Trunk NameEndpoint nickname
Hide CallerIDNo
CID OptionsAllow Any CID
Outbound CallerIDThe outbound CLI configured on your trunk
Maximum Channels
Asterisk Trunk Dial OptionsSystem
Continue if BusyNo
Disable TrunkNo
Monitor Trunk FailuresNo

Under Dialled Number Manipulation Rules, set the following:

prependprefixmatch pattern
9112
9999
9101
9105
9111
9118XXX
9116XXX
4490ZXXXXXXXX
4490ZXXXXXXXX
900ZXXX.
112
999
101
111
118XXX
116XXX
440ZXXXXXXXX
440ZXXXXXXXXX
00ZXXX.

Under pjsip SettingsGeneral set the following:
These details are found in myTTNC.

FieldValue
UsernameUsername
SecretPassword
AuthenticationOutbound
RegistrationSend
Language CodeDefault
SIP ServerDomain / Outbound Proxy
SIP Server Port5060
Contextfrom-trunk
Transport0.0.0.0-udp

Under pjsip SettingsAdvanced set the following:

📘

"Expiration" to '60'

Under pjsip SettingsCodecs set the following:

📘

Check 'alaw'


Register an IP-Based SIP Trunk

This is a general guide for configuring TTNC SIP trunks with FreePBX, the SIP driver used will be chan_sip. UI changes may occur between different versions, but it should be possible to use this guide for any recent installations of the software. This guide is based on version 14.0.5.

This guide assumes you have successfully installed FreePBX and you have the following configured:

  • You have configured an Administrative user
  • Permitted TTNC traffic through your firewall
  • You have created one or more extensions that are registering correctly

Navigate to SettingsAsterisk SIP Settings and set the following:

📘

Allow Anonymous Inbound SIP Calls = Yes

Navigate to ConnectivityTrunks
Click Add TrunkAdd SIP (chan_pjsip) Trunk

Under General, set the following:

FieldValue
Trunk NameEndpoint nickname
Hide CallerIDNo
CID OptionsAllow Any CID
Outbound CallerIDThe outbound CLI configured on your trunk
Maximum Channels
Asterisk Trunk Dial OptionsSystem
Continue if BusyNo
Disable TrunkNo
Monitor Trunk FailuresNo

Under Dialled Number Manipulation Rules, set the following:

prependprefixmatch pattern
9112
9999
9101
9105
9111
9118XXX
9116XXX
4490ZXXXXXXXX
4490ZXXXXXXXX
900ZXXX.
112
999
101
111
118XXX
116XXX
440ZXXXXXXXX
440ZXXXXXXXXX
00ZXXX.

Under sip SettingsOutgoing set the following:

Trunk Name: This can be anything without spaces or special characters
Peer Details: These details are found in myTTNC.

📘

type=peer
host=xxxxxxx.sip.ttnc.co.uk
transport=udp
insecure=very
context=from-trunks
dtmfmode=rfc2833
disallow=all
allow=alaw

Change xxxxxxx.sip.ttnc.co.uk to be your SIP Trunk Domain / Outbound Proxy.


Configuring a User-Based Inbound Route

This guide assumes you have successfully installed FreePBX and you have the following configured:

  • You have configured an Administrative user
  • Permitted TTNC traffic through your firewall
  • You have created one or more extensions that are registering correctly
  • You have registered a User-Based SIP Trunk

Navigate to ConnectivityInbound Routes
Click Add Inbound Route

Under General set the following:

Description
DID NumberANY
CallerID NumberANY
CID Priority RouteNo
Ringer Volume OverrideNone
CID name prefix
Music On HoldDefault
Set DestinationExtensions and select the necessary extension

Configuring an IP-Based Inbound Route

This guide assumes you have successfully installed FreePBX and you have the following configured:

  • You have configured an Administrative user
  • Permitted TTNC traffic through your firewall
  • You have created one or more extensions that are registering correctly
  • You have registered an IP-Based SIP Trunk

Navigate to ConnectivityInbound Routes
Click Add Inbound Route

Under General set the following:

DescriptionThis can be anything without spaces or special characters
DID NumberYour TTNC number
CallerID NumberANY
CID Priority RouteNo
Ringer Volume OverrideNone
CID name prefix
Music On HoldDefault
Set DestinationExtensions and select the necessary extension

Configuring an Outbound Route

Navigate to ConnectivityOutbound Routes
Click Add Outbound Route

Under Route Settings set the following

Route NameThis can be anything without spaces or special characters
Route CIDYour TTNC number
Override ExtensionNo
Route Password
Route TypeDefault
Music On Hold?Default
Time Match Time ZoneUse System Timezone
Time Match Time Group---Permanent Route---
Trunk Sequence for Matched RoutesSelect the trunk you have previously configured
Optional Destination on CongestionNormal Congestion

Under Dial Patterns set the following:

prependprefixmatch pattern
9112
9999
9101
9105
9111
9118XXX
9116XXX
4490ZXXXXXXXX
4490ZXXXXXXXXX
900ZXXX.
112
999
101
111
118XXX
116XXX
440ZXXXXXXXX
440ZXXXXXXXXX
00ZXXX.