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:

Field

Value

Trunk Name

Endpoint nickname

Hide CallerID

No

CID Options

Allow Any CID

Outbound CallerID

The outbound CLI configured on your trunk

Maximum Channels

Asterisk Trunk Dial Options

System

Continue if Busy

No

Disable Trunk

No

Monitor Trunk Failures

No

Under Dialled Number Manipulation Rules, set the following:

prepend

prefix

match pattern

9

112

9

999

9

101

9

105

9

111

9

118XXX

9

116XXX

44

90

ZXXXXXXXX

44

90

ZXXXXXXXX

900

ZXXX.

112

999

101

111

118XXX

116XXX

44

0

ZXXXXXXXX

44

0

ZXXXXXXXXX

00

ZXXX.

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

Field

Value

Username

Username

Secret

Password

Authentication

Outbound

Registration

Send

Language Code

Default

SIP Server

Domain / Outbound Proxy

SIP Server Port

5060

Context

from-trunk

Transport

0.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:

Field

Value

Trunk Name

Endpoint nickname

Hide CallerID

No

CID Options

Allow Any CID

Outbound CallerID

The outbound CLI configured on your trunk

Maximum Channels

Asterisk Trunk Dial Options

System

Continue if Busy

No

Disable Trunk

No

Monitor Trunk Failures

No

Under Dialled Number Manipulation Rules, set the following:

prepend

prefix

match pattern

9

112

9

999

9

101

9

105

9

111

9

118XXX

9

116XXX

44

90

ZXXXXXXXX

44

90

ZXXXXXXXX

900

ZXXX.

112

999

101

111

118XXX

116XXX

44

0

ZXXXXXXXX

44

0

ZXXXXXXXXX

00

ZXXX.

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 Number

ANY

CallerID Number

ANY

CID Priority Route

No

Ringer Volume Override

None

CID name prefix

Music On Hold

Default

Set Destination

Extensions 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:

Description

This can be anything without spaces or special characters

DID Number

Your TTNC number

CallerID Number

ANY

CID Priority Route

No

Ringer Volume Override

None

CID name prefix

Music On Hold

Default

Set Destination

Extensions and select the necessary extension


Configuring an Outbound Route

Navigate to ConnectivityOutbound Routes
Click Add Outbound Route

Under Route Settings set the following

Route Name

This can be anything without spaces or special characters

Route CID

Your TTNC number

Override Extension

No

Route Password

Route Type

Default

Music On Hold?

Default

Time Match Time Zone

Use System Timezone

Time Match Time Group

---Permanent Route---

Trunk Sequence for Matched Routes

Select the trunk you have previously configured

Optional Destination on Congestion

Normal Congestion

Under Dial Patterns set the following:

prepend

prefix

match pattern

9

112

9

999

9

101

9

105

9

111

9

118XXX

9

116XXX

44

90

ZXXXXXXXX

44

90

ZXXXXXXXXX

900

ZXXX.

112

999

101

111

118XXX

116XXX

44

0

ZXXXXXXXX

44

0

ZXXXXXXXXX

00

ZXXX.