# Setting up FreePBX with a SIP trunk

Systems: FreePBX

For Administrators configuring a SIP trunk on a self-hosted FreePBX system.

Canonical: https://warmtransfer.net/guides/freepbx-sip-trunk-setup

Last verified: 2026-09-25

The FreePBX Trunks module provides connectivity to the PSTN and to VoIP providers[^60]. A PJSIP trunk connection is added under Connectivity > Trunks by choosing the SIP (chan_pjsip) trunk type[^2].

## Before you start

Asterisk 21, which is the default in FreePBX 17, does not support the chan_sip channel driver at all[^5]. Sangoma strongly discourages chan_sip on FreePBX 17, has ceased testing or accepting contributions for it, and points administrators to conversion tools for existing chan_sip trunks and extensions[^8].

## What changes by situation

- How does your carrier authenticate your trunk? Username and password: FreePBX registers to the carrier; IP address: the carrier trusts your public IP, with no registration.
- Where does FreePBX sit on the network? Behind a NAT router or firewall, with a private IP address; Directly on a public IP address, with no NAT.

## Step 1: Confirm PJSIP availability

### Do
Navigate to Connectivity > Trunks to prepare a PJSIP trunk connection[^2].

### Verify
Confirm that the Trunks interface allows adding a SIP (chan_pjsip) trunk type[^2].

## Step 2: Set network addresses in Asterisk SIP Settings

**Behind a NAT router or firewall, with a private IP address**

### Do
Under Asterisk SIP Settings, configure External Address to reflect the PBX public IP address, using Detect Network Settings to detect addresses if needed[^20][^21]. Add each internal subnet into Local Networks in ip/mask format, using Add Local Network for additional subnets like VPNs[^37]. Note that res_pjsip rewrites the SDP media address to external_media_address when sending to destinations outside local_net[^22], while applying no NAT settings to traffic inside local_net[^36]. Configuring these settings avoids publishing private addresses in Contact headers on outbound calls[^44].

### Verify
Verify that External Address displays the public IP and Local Networks contains all internal subnets[^20][^37].

### Rollback
Restore previous values in External Address and Local Networks, then click Submit and Apply Changes[^4].

**Directly on a public IP address, with no NAT**

### Do
Under Asterisk SIP Settings, click Detect Network Settings and confirm that External Address reflects the server's public IP[^20]. Enter any internal subnets into Local Networks in ip/mask format[^37]. Note that res_pjsip applies no NAT-related settings to traffic inside local_net[^36].

### Verify
Verify that External Address shows the server public IP[^20].

### Rollback
Restore the earlier Asterisk SIP Settings entries, click Submit, and click Apply Changes[^4].

## Step 3: Create the trunk and configure General settings

### Do
Navigate to Connectivity > Trunks and add a SIP (chan_pjsip) trunk[^2]. In the General tab, enter the carrier-assigned caller ID in Outbound CallerID[^43]. If simultaneous outbound calls must be capped, enter a value in Maximum Channels[^39]. Select a CID Option: Force Trunk CID forces the trunk caller ID on all calls except emergency routes[^27], while Block Foreign CIDs blocks caller IDs originating from external forwarded calls[^6].

### Verify
Verify that the trunk is visible in the Trunks list with PJSIP technology[^2].

### Rollback
Check Disable Trunk to remove the trunk from all routes that reference it[^15], or delete the trunk, then click Apply Changes[^4].

## Step 4: Configure pjsip Settings for authentication

**Username and password: FreePBX registers to the carrier**

### Do
In the pjsip Settings tab, set Authentication to Outbound and Registration to Send, and supply the carrier Username and Secret[^10]. Enter the SIP Server, SIP Server Port, Context, and Transport specified by the carrier[^47][^7]. For an SRV record, leave SIP Server Port blank if directed by the carrier[^57]. On the Advanced tab, enter From Domain if required by the carrier[^11]. On the Codecs tab, select only the codecs supported by your carrier and arrange their order[^9].

### Verify
Click Submit and Apply Changes[^4]. Suggested check: verify that the configuration completes without interface errors.

### Rollback
Suggested rollback: Remove the trunk registration.

**IP address: the carrier trusts your public IP, with no registration**

### Do
In the pjsip Settings tab, set Authentication to none, Registration to none, and enter the carrier IP or host in SIP Server[^35]. In the Match (Permit) field, enter every carrier signalling IP address from which inbound calls may arrive[^34]. Configure the SIP Server Port, Transport, and Context as specified by the carrier[^47][^7]. On the Codecs tab, check the codecs supported by the carrier and arrange them in order[^9].

### Verify
Click Submit and Apply Changes[^4]. Suggested check: verify that the trunk fields save cleanly.

### Rollback
Clear the Match (Permit) field or select Disable Trunk[^15], then click Apply Changes[^4].

## Step 5: Configure the FreePBX Firewall

**Username and password: FreePBX registers to the carrier**

### Do
Navigate to Connectivity > Firewall and click Enable Firewall[^23]. On the Main page under Interfaces, move each interface from the default Trusted zone to the appropriate zone, usually Internet[^31]. By default, the Internet zone permits only HTTPS connections to the management interface[^32]. The Responsive Firewall automatically discovers known trunks and accepts traffic on their defined protocol without manual trunk firewall configuration[^24][^52].

### Verify
Verify on the Dashboard that no critical alert remains for an interface assigned to Trusted[^31].

### Rollback
Suggested rollback: restore previous interface zone assignments or disable the firewall via the management interface.

**IP address: the carrier trusts your public IP, with no registration**

### Do
Enable the Firewall under Connectivity > Firewall and assign interfaces to their intended zone, typically Internet[^23][^31]. On the Main page under Networks, add each carrier origination IP as trusted[^33][^42].

### Verify
Verify that all carrier origination addresses appear on the Networks tab[^42] and that no interface is left in the Trusted zone[^31].

### Rollback
Remove the carrier network entries from the Networks tab[^42] and click Apply Changes[^4].

## Step 6: Create a PJSIP extension for testing

### Do
Navigate to Applications > Extensions and choose Add New PJSIP Extension[^1]. Enter the User Extension, keeping in mind that this number cannot be modified once saved[^1]. Define Outbound CID if this user must override the trunk caller ID[^17]. Set Emergency CID for calls placed on emergency routes[^18]. For endpoints positioned behind NAT, enable RTP Symmetric[^19].

### Verify
Register a SIP endpoint to the newly configured extension and inspect the endpoint status using `pjsip show endpoint <extension>`[^56].

### Rollback
Delete the test extension under Applications > Extensions and click Apply Changes[^4].

## Step 7: Build outbound routes

### Do
Under Connectivity > Outbound Routes, configure the routing rules that direct calls to trunks[^45]. Create an initial emergency route with Route Type set to Emergency to enforce the device Emergency CID[^54], positioning it first in the route order[^16]. Create general outbound routes configuring the Prepend, Prefix, Match Pattern, and optional CallerID[^12]. Build patterns using FreePBX dial pattern characters, where X matches 0-9, Z matches 1-9, N matches 2-9, brackets match listed digits, and a period matches one or more characters[^46]. Add the PJSIP trunk into Trunk Sequence for Matched Routes[^59].

### Verify
Check route order in the Outbound Routes module, confirming the emergency route appears first, because FreePBX evaluates routes in priority order, executes only the first matching route, and fails calls matching no route[^53].

### Rollback
Delete or reorder the configured routes and click Apply Changes[^53][^4].

## Step 8: Build inbound routes

### Do
Under Connectivity > Inbound Routes, create an inbound route matching the DID format delivered by your carrier[^14]. If desired, configure a catch-all route with both DID Number and CallerID Number left blank[^13].

### Verify
Asterisk evaluates inbound routes by specificity: DID with CID, then DID alone, then CID alone, and finally blank entries[^30]. Activate logging with `pjsip set logger on`[^48] and confirm incoming INVITE requests carry a DID matching your inbound route configuration[^14].

### Rollback
Delete the inbound routes and click Apply Changes[^4].

## Step 9: Apply configuration and confirm trunk status

**Username and password: FreePBX registers to the carrier**

### Do
Click Submit and Apply Changes[^4]. Run `pjsip show registrations` on the Asterisk command-line interface[^51].

### Verify
Verify that the trunk displays a status of Registered[^51]. Outbound registration alone does not match inbound calls to the endpoint[^28], and unmatched requests will be rejected[^61].

### Rollback
Suggested rollback: Remove the trunk registration.

**IP address: the carrier trusts your public IP, with no registration**

### Do
Click Submit and Apply Changes[^4]. Run `pjsip show endpoint <trunk name>` on the Asterisk CLI[^56].

### Verify
Verify that the endpoint details display an Identify: line containing the carrier IP addresses[^56]. Asterisk rejects incoming SIP requests that cannot be matched to a configured endpoint[^61].

### Rollback
Enable Disable Trunk on the trunk settings[^15] and click Apply Changes[^4].

## Step 10: Validate audio flow

**Behind a NAT router or firewall, with a private IP address**

### Do
Enable SIP logging using `pjsip set logger on`[^48].

### Verify
Suggested check: place an outbound call and an inbound test call, and confirm audio is audible in both directions. Inspect the SIP trace to confirm that SDP media addresses and Contact headers sent to the carrier contain the public IP rather than a private local address[^22][^44]. If audio is missing or one-way, confirm that the RTP port range (defaulting to UDP 10000-20000) and Local Networks are configured properly[^55][^37].

### Rollback
Suggested rollback: run `pjsip set logger off` in the Asterisk CLI to disable SIP logging.

**Directly on a public IP address, with no NAT**

### Do
Run `pjsip set logger on` in the Asterisk CLI[^48].

### Verify
Suggested check: place an outbound call and an inbound test call, and confirm call audio is heard in both directions. Suggested check: in the SIP trace, confirm that outbound SDP media contains the PBX server public IP address. If audio fails, verify that UDP ports 10000-20000 are not filtered[^55][^52].

### Rollback
Suggested rollback: run `pjsip set logger off` in the Asterisk CLI to turn off SIP packet logging.

## Applicability

Applies to: Sangoma FreePBX, FreePBX, Telnyx SIP trunking with FreePBX, Asterisk Project Asterisk res_pjsip, and Wiretap Telecom Wiretap SIP trunking with FreePBX 17. Deployments: on-premises. Sources checked 2026-09-25. The claims in this article specifically cover FreePBX 17 paired with Asterisk 21[^5].

## What remains uncertain

Carrier-specific parameters such as signalling ports, supported audio codecs, inbound contexts, and domain names are not covered by the sources below and must be obtained directly from your trunk provider. Transport-layer security configuration, SRTP setup, router-level port forwarding, and SIP ALG behavior on edge networking equipment are not covered by the sources below.

## Sources

[^1]: A PJSIP extension is added under Applications > Extensions with Add New PJSIP Extension, and its User Extension number cannot be changed once saved. Source: [PBX GUI - Extensions Module - PJSIP Extension](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/22020636/Extensions+Module+-+PJSIP+Extension), Adding a PJSIP Extension; User Extension. Checked 2026-09-25.
[^2]: A PJSIP trunk is added under Connectivity > Trunks by choosing the SIP (chan_pjsip) trunk type. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), Adding a Trunk; SIP TRUNK (PJSIP). Checked 2026-09-25.
[^3]: The PJSIP trunk's advanced configuration exposes Client URI and Server URI for outbound registration and AOR Contact for permanent contacts. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), SIP TRUNK (PJSIP), advanced configuration. Checked 2026-09-25.
[^4]: FreePBX changes take effect only after Submit and then the red Apply Changes (Apply Config) button. Source: [Open Source - How to configure a Sangoma SIP Trunking account with AsteriskNOW and FreePBX](https://sangomakb.atlassian.net/wiki/spaces/OpenSource/pages/426410599/Open+Source+-+How+to+configure+a+Sangoma+SIP+Trunking+account+with+AsteriskNOW+and+FreePBX), Trunk, Inbound Route and Outbound Route sections, final step. Checked 2026-09-25.
[^5]: Asterisk 21, the default Asterisk under FreePBX 17, does not support the chan_sip channel driver at all. Source: [FreePBX Open Source - Using FreePBX 17 with chan_sip](https://sangomakb.atlassian.net/wiki/spaces/FP/pages/242581508/Using+FreePBX+17+with+chan+sip), Using FreePBX 17 with chan_sip, opening section. Checked 2026-09-25.
[^6]: The trunk CID Option Block Foreign CIDs blocks caller IDs that come from calls forwarded from outside the system, while Allow Any CID sends them. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), General Settings, CID Options. Checked 2026-09-25.
[^7]: Carriers specify different inbound Context values for a FreePBX PJSIP trunk: several Sangoma provider guides use from-pstn, and one FreePBX 17 carrier guide uses from-pstn-toheader. Source: [Configuring Your Trunk With FreePBX17 - Registration](https://docs.wiretaptelecom.com/docs/configuring-your-trunk-with-freepbx17-registration), Registration credentials, Context. Checked 2026-09-25.
[^8]: Sangoma strongly discourages chan_sip on FreePBX 17, says it no longer tests or accepts contributions for it, and points to tools that convert chan_sip trunks and extensions to PJSIP. Source: [FreePBX Open Source - Using FreePBX 17 with chan_sip](https://sangomakb.atlassian.net/wiki/spaces/FP/pages/242581508/Using+FreePBX+17+with+chan+sip), Using FreePBX 17 with chan_sip, opening section. Checked 2026-09-25.
[^9]: On the PJSIP trunk only the checked codecs are enabled, and their order is set by dragging. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), SIP TRUNK (PJSIP), Codecs. Checked 2026-09-25.
[^10]: For a credential (registration) trunk, a carrier's FreePBX instructions set the pjsip Settings Authentication to Outbound and Registration to Send, with Username and Secret from the carrier. Source: [FreePBX V13: PJSIP Credentials](https://support.telnyx.com/en/articles/1277754-configure-a-freepbx-v13-credentials-trunk-pjsip), PJSIP Settings, General tab. Checked 2026-09-25.
[^11]: A carrier's credential-trunk instructions set From Domain on the pjsip Settings Advanced tab to the carrier's SIP domain. Source: [FreePBX V13: PJSIP Credentials](https://support.telnyx.com/en/articles/1277754-configure-a-freepbx-v13-credentials-trunk-pjsip), PJSIP Settings, Advanced tab. Checked 2026-09-25.
[^12]: An outbound route dial pattern has four elements: Prepend (added on a match), Prefix (stripped on a match), Match Pattern, and an optional CallerID the call must carry. Source: [PBX GUI - Outbound Routes Module User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181933), Dial Patterns tab. Checked 2026-09-25.
[^13]: An Inbound Route with a blank DID Number matches calls with any or no DID, and one with both DID and CallerID blank matches all calls. Source: [PBX GUI - Inbound Route User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26116316), DID Number; CallerID Number. Checked 2026-09-25.
[^14]: An Inbound Route's DID Number must match the format in which the provider sends the DID. Source: [PBX GUI - Inbound Route User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26116316), DID Number. Checked 2026-09-25.
[^15]: The trunk's Disable Trunk checkbox disables the trunk in every route that uses it. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), General Settings, Disable Trunk. Checked 2026-09-25.
[^16]: Sangoma's IP-authenticated trunk example puts an outbound route of type Emergency first, ahead of the general outbound route. Source: [PBX GUI - VoIP Innovations SIP Trunk setup](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/39158404), Outbound Routes, E911-Leave-First. Checked 2026-09-25.
[^17]: An extension's Outbound CID overrides the common outbound caller ID set in the Trunks module. Source: [PBX GUI - Extensions Module - PJSIP Extension](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/22020636/Extensions+Module+-+PJSIP+Extension), General, Outbound CID. Checked 2026-09-25.
[^18]: An extension's Emergency CID is always used when dialling out an outbound route designated Emergency. Source: [PBX GUI - Extensions Module - PJSIP Extension](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/22020636/Extensions+Module+-+PJSIP+Extension), General, Emergency CID. Checked 2026-09-25.
[^19]: On a PJSIP extension, RTP Symmetric sends RTP back to the address it came from, and Sangoma says enabling it is usually a good idea when the device is behind NAT. Source: [PBX GUI - Extensions Module - PJSIP Extension](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/22020636/Extensions+Module+-+PJSIP+Extension), Advanced, RTP Symmetric. Checked 2026-09-25.
[^20]: In Asterisk SIP Settings, External Address should show the PBX's public-facing IP, and Detect Network Settings makes the PBX detect its external and local networks. Source: [PBX GUI - Asterisk SIP Settings User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26542239/PBX+GUI+-+Asterisk+SIP+Settings+User+Guide), External Address. Checked 2026-09-25.
[^21]: Sangoma's PJSIP trunk guide sets External IP Address in Asterisk SIP Settings (Chan PJSIP Settings) to the PBX's public IP. Source: [PBX GUI - Setup Alphalink SIP (PJSIP) Trunk](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/39289361/Setup+Alphalink+SIP+PJSIP+Trunk), Asterisk SIP Settings / Chan PJSIP Settings. Checked 2026-09-25.
[^22]: When a message goes to a destination outside local_net and its SDP media address is inside local_net, res_pjsip rewrites the SDP media address to external_media_address. Source: [Configuring res_pjsip to work through NAT](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Configuring-res_pjsip-to-work-through-NAT/), Configuring res_pjsip to work through NAT, external_media_address definition. Checked 2026-09-25.
[^23]: The FreePBX Firewall is turned on under Connectivity > Firewall with the Enable Firewall button. Source: [PBX GUI - Firewall Getting Started Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26148986/PBX+GUI+-+Firewall+Getting+Started+Guide), Enabling the Firewall. Checked 2026-09-25.
[^24]: The Firewall needs no configuration for trunks; they are configured automatically. Source: [PBX GUI - Firewall Getting Started Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26148986/PBX+GUI+-+Firewall+Getting+Started+Guide), Trusted networks paragraph. Checked 2026-09-25.
[^25]: The Firewall configures trunk peers automatically from the trunk definition, but an IP-authenticated carrier that sends calls from addresses other than the trunk's SIP Server may need those addresses trusted explicitly (inferred). Source: [PBX GUI - VoIP Innovations SIP Trunk setup](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/39158404), Firewall configuration, read with the Firewall Getting Started Guide trunk note. Checked 2026-09-25.
[^26]: For inbound traffic through NAT, the endpoint option force_rport, enabled by default, sends responses back to the source address of the request. Source: [Asterisk PJSIP Troubleshooting Guide](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Asterisk-PJSIP-Troubleshooting-Guide/), ARGH! NAT!. Checked 2026-09-25.
[^27]: The trunk CID Option Force Trunk CID always sends the trunk's caller ID, except when the trunk is part of an emergency route. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), General Settings, CID Options. Checked 2026-09-25.
[^28]: Outbound registration does not by itself identify inbound calls; an identify section's match option associates SIP traffic from a given IP with the endpoint. Source: [Configuring Outbound Registrations](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Configuring-Outbound-Registrations/), Example configuration, identify section. Checked 2026-09-25.
[^29]: In Sangoma's VoIP Innovations example, inbound DIDs arrive in E.164 format (for example +13607464343) by default, so Inbound Route DIDs must be entered in that format. Source: [PBX GUI - VoIP Innovations SIP Trunk setup](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/39158404), Inbound Routes. Checked 2026-09-25.
[^30]: Inbound Routes are matched most-specific first: DID with CID, then DID only, then CID only, then neither. Source: [PBX GUI - Inbound Route User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26116316), Route matching order. Checked 2026-09-25.
[^31]: New interfaces default to the Trusted zone. They should be moved on the Main page's Interfaces tab to the correct zone, usually Internet, and leaving any interface Trusted raises a critical Dashboard alert. Source: [PBX GUI - Firewall Getting Started Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26148986/PBX+GUI+-+Firewall+Getting+Started+Guide), Interfaces tab paragraph. Checked 2026-09-25.
[^32]: By default the Firewall's Internet zone allows only HTTPS connections to the management interface. Source: [PBX GUI - Firewall](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181828/PBX+GUI+-+Firewall), Zones, Internet. Checked 2026-09-25.
[^33]: Sangoma's IP-authenticated trunk guide adds each carrier origination IP as trusted on the Firewall module's Networks tab. Source: [PBX GUI - VoIP Innovations SIP Trunk setup](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/39158404), Firewall configuration. Checked 2026-09-25.
[^34]: For an IP-authenticated carrier, the PJSIP trunk's Match (Permit) field lists every carrier signalling IP address that inbound calls may come from. Source: [PBX GUI - VoIP Innovations SIP Trunk setup](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/39158404), Chan_pjSIP setup, Match (Permit). Checked 2026-09-25.
[^35]: For an IP-authenticated carrier, Sangoma's guide sets the PJSIP trunk's Authentication to none and Registration to none and enters the carrier's server IP as SIP Server. Source: [PBX GUI - VoIP Innovations SIP Trunk setup](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/39158404), Chan_pjSIP setup, Primary_Origination_Server trunk. Checked 2026-09-25.
[^36]: res_pjsip applies no NAT-related settings, including the external address options, to traffic with addresses inside local_net. Source: [Configuring res_pjsip to work through NAT](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Configuring-res_pjsip-to-work-through-NAT/), Configuring res_pjsip to work through NAT, local_net definition. Checked 2026-09-25.
[^37]: Asterisk SIP Settings Local Networks takes entries in ip/mask form (for example 192.168.1.0/255.255.255.0), with Add Local Network for additional subnets such as a VPN. Source: [PBX GUI - Asterisk SIP Settings User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26542239/PBX+GUI+-+Asterisk+SIP+Settings+User+Guide), Local Networks. Checked 2026-09-25.
[^38]: FreePBX's Match (Permit) trunk field probably generates the PJSIP identify match used to associate carrier IPs with the trunk endpoint (inferred). Source: [Configuring Outbound Registrations](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Configuring-Outbound-Registrations/), Example configuration, identify section, compared with the VoIP Innovations Match (Permit) usage. Checked 2026-09-25.
[^39]: The trunk Maximum Channels field limits the number of simultaneous outbound calls on that trunk. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), General Settings, Maximum Channels. Checked 2026-09-25.
[^40]: Sangoma's North American outbound route example uses the dial patterns NXXNXXXXXX, 1NXXNXXXXXX and 011. with the new trunk as the trunk sequence. Source: [Open Source - How to configure a Sangoma SIP Trunking account with AsteriskNOW and FreePBX](https://sangomakb.atlassian.net/wiki/spaces/OpenSource/pages/426410599/Open+Source+-+How+to+configure+a+Sangoma+SIP+Trunking+account+with+AsteriskNOW+and+FreePBX), Outbound Route configuration. Checked 2026-09-25.
[^41]: For res_pjsip behind NAT, the key options are local_net, external_media_address and external_signaling_address on the transport, and direct_media on the endpoint. Source: [Configuring res_pjsip to work through NAT](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Configuring-res_pjsip-to-work-through-NAT/), Configuring res_pjsip to work through NAT, configuration discussion. Checked 2026-09-25.
[^42]: Trusted networks or hosts, including DDNS hosts, are added through the Networks tab on the Firewall's Main page. Source: [PBX GUI - Firewall](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181828/PBX+GUI+-+Firewall), FAQ, adding a trusted network or host. Checked 2026-09-25.
[^43]: The trunk General tab's Outbound CallerID field sets the caller ID for calls placed out of that trunk. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), General Settings, Outbound CallerID. Checked 2026-09-25.
[^44]: For outbound calls through NAT, Asterisk's troubleshooting guide says to set local_net, external_signaling_address and external_signaling_port so unroutable private addresses are not published in Contact headers. Source: [Asterisk PJSIP Troubleshooting Guide](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Asterisk-PJSIP-Troubleshooting-Guide/), ARGH! NAT!. Checked 2026-09-25.
[^45]: An outbound route is the set of rules the PBX uses to choose the trunk for an outbound call. Source: [PBX GUI - Outbound Routes Module User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181933), Overview. Checked 2026-09-25.
[^46]: In FreePBX dial patterns, X matches 0-9, Z matches 1-9, N matches 2-9, [ ] matches any digit listed, and . matches one or more characters. Source: [PBX GUI - Outbound Routes Module User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181933), Dial Patterns tab, pattern rules. Checked 2026-09-25.
[^47]: The PJSIP trunk settings include Username, Secret, SIP Server, SIP Server Port, Context (the context inbound calls are sent to), Transport and Codecs. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), SIP TRUNK (PJSIP), simple configuration. Checked 2026-09-25.
[^48]: The Asterisk CLI command pjsip set logger on turns on logging of SIP messages for troubleshooting. Source: [Asterisk PJSIP Troubleshooting Guide](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Asterisk-PJSIP-Troubleshooting-Guide/), Initial troubleshooting commands. Checked 2026-09-25.
[^49]: Sangoma's Alphalink PJSIP trunk example uses Registration None, SIP Server Port 5060, Context from-pstn and UDP or TCP transport. Source: [PBX GUI - Setup Alphalink SIP (PJSIP) Trunk](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/39289361/Setup+Alphalink+SIP+PJSIP+Trunk), PJSIP Settings, General tab. Checked 2026-09-25.
[^50]: The PJSIP trunk's registration settings include Expiration, Retry Interval, Forbidden Retry Interval, Max Retries, Permanent Auth Rejection, Qualify Frequency and Contact User. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), SIP TRUNK (PJSIP), registration and authentication settings. Checked 2026-09-25.
[^51]: pjsip show registrations lists outbound registrations with a status of Registered, Unregistered (usually not yet established), Rejected (a failure occurred) or Stopped (removed from configuration and unregistering). Source: [Configuring Outbound Registrations](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Configuring-Outbound-Registrations/), Outbound registration status values. Checked 2026-09-25.
[^52]: The Responsive Firewall discovers all known peers and trunks in the FreePBX installation and accepts traffic from each peer on its defined protocol. Source: [PBX GUI - Firewall](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181828/PBX+GUI+-+Firewall), Responsive Firewall. Checked 2026-09-25.
[^53]: Routes are checked from highest to lowest priority, only the first matching route is used, and the call fails if no route matches. Source: [PBX GUI - Outbound Routes Module User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181933), Route ordering / Route Position. Checked 2026-09-25.
[^54]: Marking an outbound route's Route Type as Emergency makes it use the device's Emergency CID setting, if one is set. Source: [PBX GUI - Outbound Routes Module User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181933), Route Settings, Route Type. Checked 2026-09-25.
[^55]: The FreePBX RTP port range defaults to UDP 10000-20000, and Sangoma advises at least 4 ports per potential call. Source: [PBX GUI - Asterisk SIP Settings User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26542239/PBX+GUI+-+Asterisk+SIP+Settings+User+Guide), RTP Port Ranges. Checked 2026-09-25.
[^56]: When an endpoint is matched by IP address, pjsip show endpoint <name> shows an Identify: line with the matched address, and an InAuth: line when inbound authentication is configured. Source: [Asterisk PJSIP Troubleshooting Guide](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Asterisk-PJSIP-Troubleshooting-Guide/), Unrecognized Endpoint; Authentication is failing. Checked 2026-09-25.
[^57]: One carrier's FreePBX 17 instructions say to leave SIP Server Port blank when the carrier's server is an SRV record. Source: [Configuring Your Trunk With FreePBX17 - Registration](https://docs.wiretaptelecom.com/docs/configuring-your-trunk-with-freepbx17-registration), Registration credentials, Sip Server Port. Checked 2026-09-25.
[^58]: A carrier's FreePBX instructions pair SIP Server Port 5060 with UDP or TCP transport, and 5061 with TLS. Source: [FreePBX V13: PJSIP Credentials](https://support.telnyx.com/en/articles/1277754-configure-a-freepbx-v13-credentials-trunk-pjsip), PJSIP Settings, General tab, SIP Server Port and Transport. Checked 2026-09-25.
[^59]: An outbound route's Trunk Sequence for Matched Routes sets the order in which trunks are tried for a matched call. Source: [PBX GUI - Outbound Routes Module User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/26181933), Trunk Sequence for Matched Routes. Checked 2026-09-25.
[^60]: The FreePBX Trunks module is where connectivity to the PSTN and to VoIP providers is configured. Source: [PBX GUI - Trunks Module-User Guide](https://sangomakb.atlassian.net/wiki/spaces/PG/pages/25690439), Overview. Checked 2026-09-25.
[^61]: Asterisk rejects an inbound SIP request it cannot match to a configured endpoint, and an apparent authentication failure often means the endpoint was not recognised at all. Source: [Asterisk PJSIP Troubleshooting Guide](https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/Asterisk-PJSIP-Troubleshooting-Guide/), Unrecognized Endpoint; Authentication is failing. Checked 2026-09-25.
