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
- 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. - 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 - 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.
- 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
00or+and sends country code plus number to us.Dial Patterns prepend prefix match pattern 00 X. + X. 9 X. - 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.
- 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
| Symptom | Likely cause | Fix |
|---|---|---|
403 Forbidden | Source IP not allow-listed, wrong credentials, or caller ID not authorised | Check Portal → Endpoints and Caller IDs |
484 Address Incomplete | Number sent in national format or with a leftover prefix | Send country code + number, no + or 00 |
| One-way or no audio | NAT not handled or RTP blocked | Set external address, open the RTP range |
| Trunk greyed out in Asterisk Info | Responsive Firewall blocking | Add 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.