Skip to content
CLIRoutes

Integration · PBX & softswitch

FreePBX setup for CLIRoutes

FreePBX generates Asterisk PJSIP configuration from its web interface, so everything in this guide happens in the GUI. You will create a trunk, attach it to an outbound route with dial patterns for international numbers and trust our network in the FreePBX firewall.

Tested on
FreePBX 16 and 17 · Asterisk 18/20
Channel driver
chan_pjsip
Auth
IP or registration
Signalling
sip.example-carrier.net:5060 UDP
Codecs
ulaw, alaw, g729

Before you start

  • FreePBX admin access.
  • Asterisk SIP Settings configured with your external address (Settings → Asterisk SIP Settings → NAT Settings).
  • Your public IP on the CLIRoutes endpoint, or SIP credentials.
  • An authorised caller ID.

Placeholders in angle brackets, such as <ACCOUNT_ID>, come from your portal. The host shown is a placeholder; use the one listed under Portal → Network.

Set up FreePBX

  1. 01

    Create the trunk

    Go to Connectivity → Trunks → Add Trunk → Add SIP (chan_pjsip) Trunk. Name it cliroutes, set Outbound CallerID to an authorised number and CID Options to *Force Trunk CID* so extensions cannot override it.

  2. 02

    Enter the PJSIP settings

    On the pjsip Settings → General tab set the values below. For IP authentication choose Authentication *None* and Registration *None*; for credentials choose *Outbound* and *Send*.

    Trunk · pjsip Settings
    Username ........... <ACCOUNT_ID>
    Secret ............. <SIP_PASSWORD>
    Authentication ..... Outbound   (None for IP auth)
    Registration ....... Send       (None for IP auth)
    SIP Server ......... sip.example-carrier.net
    SIP Server Port .... 5060
    Context ............ from-pstn
    Transport .......... 0.0.0.0-udp
  3. 03

    Set the advanced options

    On the Advanced tab, set From Domain to the CLIRoutes host, enable Send RPID/PAI as *Send P-Asserted-Identity header*, and set Match (Permit) to our signalling range so inbound DID calls are accepted. On Codecs, keep ulaw, alaw and g729 in that order.

  4. 04

    Build the outbound route

    Go to Connectivity → Outbound Routes → Add. Select the trunk in Trunk Sequence, set a Route CID if you need one per route, and add dial patterns. The pattern below lets users dial 00 or + and sends country code plus number to us.

    Dial Patterns
    prepend   prefix   match pattern
              00       X.
              +        X.
              9        X.
  5. 05

    Trust CLIRoutes in the firewall

    In Connectivity → Firewall → Networks, add the signalling and media ranges from Portal → Network as *Trusted*. Without this, Responsive Firewall may block OPTIONS replies and mark the trunk unreachable.

  6. 06

    Apply and test

    Click Submit and Apply Config. Check Reports → Asterisk Info → Registries (credential accounts) or run pjsip show endpoint cliroutes, then dial a mobile you control and confirm the caller ID.

Caller ID precedence in FreePBX

FreePBX picks the outbound caller ID from, in order: Force Trunk CID, the outbound route CID (if *Override Extension* is set), the extension Outbound CID, then the trunk CID. For CLI routes, *Force Trunk CID* is the safest choice because a mistyped extension CID cannot reach the network. See what a CLI route is for why unauthorised numbers are rejected.

Troubleshooting

SymptomLikely causeFix
403 ForbiddenSource IP not allow-listed, wrong credentials, or caller ID not authorisedCheck Portal → Endpoints and Caller IDs
484 Address IncompleteNumber sent in national format or with a leftover prefixSend country code + number, no + or 00
One-way or no audioNAT not handled or RTP blockedSet external address, open the RTP range
Trunk greyed out in Asterisk InfoResponsive Firewall blockingAdd our ranges as Trusted in Firewall → Networks

Last verified by the CLIRoutes routing team. Menus can change between releases; if a field has moved, tell us.

FAQ

FreePBX questions

Can’t find what you need? Our routing team answers within the hour, around the clock.

Should I use chan_sip or chan_pjsip in FreePBX?

Use chan_pjsip. FreePBX 17 ships with Asterisk versions where chan_sip is deprecated or removed.

Why are inbound DID calls rejected?

The trunk needs Match (Permit) set to our signalling range and an Inbound Route for each DID. Check that the DID format in the inbound route matches what we send, which is country code plus number.

Can different departments present different caller IDs?

Yes. Create one outbound route per department with its own Route CID, all pointing at the same trunk. Every number must be authorised in the portal.

Does FreePBX need a reload after every change?

Changes take effect when you click Apply Config. Trunk registration changes may take up to the retry interval to reconnect.