Skip to content
CLIRoutes

Integration · PBX & softswitch

FusionPBX setup for CLIRoutes

FusionPBX is a multi-tenant web interface for FreeSWITCH. Carriers are gateways on the external SIP profile, and outbound routes are dialplan entries that bridge matching numbers to a gateway. The same settings apply to plain FreeSWITCH; the XML equivalent is included.

Tested on
FusionPBX 5.x · FreeSWITCH 1.10
Profile
external
Auth
Register true/false
Signalling
sip.example-carrier.net:5060 UDP
Codecs
PCMA, PCMU, G729

Before you start

  • FusionPBX superadmin access.
  • The external profile bound to your public IP (ext-sip-ip and ext-rtp-ip set).
  • Your public IP on the CLIRoutes endpoint, or SIP credentials.

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 FusionPBX

  1. 01

    Create the gateway

    Go to Accounts → Gateways → Add. Use the values below. For IP authentication set Register to *false* and leave username and password as placeholders FusionPBX requires.

    Gateway fields
    Gateway ............ cliroutes
    Username ........... <ACCOUNT_ID>
    Password ........... <SIP_PASSWORD>
    From User .......... <ACCOUNT_ID>
    From Domain ........ sip.example-carrier.net
    Proxy .............. sip.example-carrier.net
    Register ........... true      (false for IP auth)
    Caller ID In From .. true
    Profile ............ external
  2. 02

    Start the gateway

    Save, then click Start on the gateway list, or rescan the profile from the console.

    fs_cli
    fs_cli -x "sofia profile external rescan"
    fs_cli -x "sofia status gateway cliroutes"
  3. 03

    Add an outbound route

    Go to Dialplan → Outbound Routes → Add, pick the gateway, and enter a dialplan expression. The expression below accepts 00 or + prefixed numbers and sends country code plus number.

    Dialplan expression
    ^(?:\+|00)(\d{7,15})$
  4. 04

    Set the caller ID

    Set Outbound Caller ID Number on each extension, or add a set action on the route so every call uses an authorised number regardless of extension.

    Route actions
    set   effective_caller_id_number=<AUTHORISED_CLI>
    set   sip_cid_type=pid
    bridge sofia/gateway/cliroutes/$1
  5. 05

    Test the call

    Dial a mobile you control. If it fails, enable SIP tracing on the external profile and repeat; the trace shows the INVITE we received and our response.

    fs_cli
    fs_cli -x "sofia profile external siptrace on"

Plain FreeSWITCH XML equivalent

sip_profiles/external/cliroutes.xml
<include>
  <gateway name="cliroutes">
    <param name="username" value="<ACCOUNT_ID>"/>
    <param name="password" value="<SIP_PASSWORD>"/>
    <param name="realm" value="sip.example-carrier.net"/>
    <param name="proxy" value="sip.example-carrier.net"/>
    <param name="register" value="true"/>
    <param name="caller-id-in-from" value="true"/>
    <param name="ping" value="30"/>
  </gateway>
</include>

sip_cid_type=pid makes FreeSWITCH send a P-Asserted-Identity header. Keep it on so caller ID validation matches what you configured.

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
Gateway state FAIL_WAITRegistration rejectedCheck credentials and that the external profile can reach the proxy

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

FAQ

FusionPBX questions

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

Can each FusionPBX tenant use its own caller ID?

Yes. Set the outbound caller ID per domain or per extension. If tenants are separate customers, give each its own CLIRoutes endpoint so usage and caller IDs stay separate.

Why is my dialplan expression not matching?

FusionPBX applies outbound routes in order. Check that a more general route above it is not catching the number first, and test the expression against a real dialled string.

Does FreeSWITCH need a restart after adding a gateway?

No. A profile rescan loads new gateways. Changing profile-level settings such as bind addresses needs a profile restart.

How do I receive DIDs?

Create an inbound route per DID with the destination number in country code plus number format, and allow our signalling range in the external profile ACL.