Skip to content
SIPTrunkHub

Setup guide · Gateway (GUI)

Connect a SIP trunk to FusionPBX

FusionPBX is a multi-tenant web interface on top of FreeSWITCH. A trunk is a gateway on the external profile. You add the gateway, allow our IP in the providers ACL, create an outbound route, and add a destination for each DID. Menu names below match FusionPBX 5.x.

Before you start

What you need

  • FusionPBX 5.x with superadmin access
  • Your server’s public IP set in Advanced › Variables (external_rtp_ip / external_sip_ip)
  • Your SIPTrunkHub account details: SIP server, auth method, tech prefix if any
  • The domain (tenant) that will use the trunk

IP auth or register auth?

IP authentication

Recommended

Set Register to False. We whitelist your public IP. You must add our IP to the providers ACL or FreeSWITCH challenges our inbound calls.

Register (digest) authentication

Set Register to True with username and password. FusionPBX keeps the registration up and shows it under Status › SIP Status.

Step by step

Configure FusionPBX

sip.example-host.net and 203.0.113.10 are documentation placeholders. Replace them, and the username, password and tech prefix, with the values from your account.

  1. 01

    Add the gateway

    Accounts › Gateways › Add (+). Fill in the fields below and save. For IP auth, FusionPBX still requires a username and password: enter any placeholder, they are not sent.

    Gateway (field → value)
    Gateway ............... siptrunkhub
    Username .............. YOUR_SIP_USERNAME   (placeholder for IP auth)
    Password .............. YOUR_SIP_PASSWORD   (placeholder for IP auth)
    From Domain ........... sip.example-host.net
    Proxy ................. sip.example-host.net
    Realm ................. sip.example-host.net
    Expire Seconds ........ 600
    Register .............. False | True
    Retry Seconds ......... 30
    Caller ID In From ..... True
    Ping .................. 30
    Context ............... public
    Profile ............... external
    Enabled ............... True
  2. 02

    Start the gateway

    Go to Status › SIP Status. Under the external profile click Rescan, then Start next to the siptrunkhub gateway. Its state should change to REGED (register) or NOREG (IP auth).

  3. 03

    Allow our IP in the providers ACL

    Advanced › Access Controls › providers › add a node. Then go to Status › SIP Status and click Reload ACL.

    Access control node
    Type .......... allow
    CIDR .......... 203.0.113.10/32
    Description ... SIPTrunkHub signalling
  4. 04

    Create an outbound route

    Dialplan › Outbound Routes › Add. Pick the gateway, choose a dialplan expression, and set the prefix. FusionPBX builds the regex and the bridge for you.

    Outbound route (field → value)
    Gateway ............... siptrunkhub
    Dialplan Expression ... ^00(\d{7,15})$      (international, strips 00)
    Prefix ................ 1234#               (tech prefix, if your account has one)
    Limit ................. 30                  (your channel limit)
    Accountcode ........... (optional)
    Toll Allow ............ (optional)
    Enabled ............... True
  5. 05

    Set the outbound caller ID

    Accounts › Extensions › edit each extension and set Outbound Caller ID Number to the DID it should present, in E.164 without +. Our network rejects calls with an empty or invalid caller ID.

  6. 06

    Add a destination for each DID

    Dialplan › Destinations › Add. Choose type Inbound, enter the DID exactly as we deliver it, pick the tenant domain and the action (extension, ring group, IVR).

    Destination (field → value)
    Type .................. Inbound
    Country Code .......... 44
    Destination ........... 2079460000
    Caller ID Name Prefix . (optional)
    Action ................ 1001 Extension
    Domain ................ your-tenant.example
    Enabled ............... True

Media

Codec order

  • Advanced › Variables › Codecs: set global_codec_prefs and outbound_codec_prefs to PCMU,PCMA,G729.
  • Click Apply / reloadxml after changing variables. Existing calls keep their codec.
  • For fax, enable T.38 on the fax extension (Advanced settings › fax_enable_t38).

NAT notes

  • Advanced › Variables › SIP Profile: set external_rtp_ip and external_sip_ip to your public IP.
  • Advanced › SIP Profiles › external: confirm ext-rtp-ip and ext-sip-ip use those variables.
  • Open UDP 5080 (external profile) and the RTP range 16384–32768 on your firewall. Tell us if your gateway uses 5080 so inbound goes to the right port.
  • Disable SIP ALG on the router.

Verify

Test the trunk

Status › SIP Status should show the gateway UP with a ping time. Then dial a mobile you own and check audio both ways. For a SIP trace, use Advanced › Command (fs_cli) or sngrep over SSH.

Advanced › Command (switch)
sofia status gateway siptrunkhub
reloadacl
sofia global siptrace on

Troubleshooting

Common SIP errors

What each response means and what to check first on FusionPBX. If you still need help, send the Call-ID and timestamp to the NOC.

Common SIP error codes and fixes for FusionPBX
CodeMeaningLikely causeFix on FusionPBX
401UnauthorizedWe challenged the INVITE or REGISTER and the credentials were wrong or missing. With IP auth it usually means the call arrived from an IP we have not whitelisted.Inbound: our IP is not in the providers ACL, or you did not click Reload ACL. Outbound: check gateway username and realm.
403ForbiddenAuthenticated, but not allowed: wrong or missing tech prefix, zero prepaid balance, destination blocked on your account, or an invalid caller ID.Check the extension’s Outbound Caller ID Number. An empty caller ID is rejected.
404Not FoundThe dialled number is not in a format we can route: missing country code, an extra 00 or +, or a local trunk prefix left in.The outbound route prefix or expression is sending 00 or +. Check the generated dialplan under Dialplan › Dialplan Manager.
408Request TimeoutNo response came back. Usually a firewall, wrong port or transport, a DNS failure, or SIP ALG on the router eating packets.The gateway is stopped or the external profile port is blocked. Start it under Status › SIP Status.
480Temporarily UnavailableThe far end could not be reached: handset off, out of coverage, or the route for that prefix is temporarily down.Retry later or route to another trunk. If it hits one prefix repeatedly, send examples to the NOC.
486Busy HereThe called party is busy, or you reached the concurrent-channel limit on your account.Treat as a normal busy. If every call returns 486, check your active channel count against your limit.
503Service UnavailableCapacity limit hit (calls per second or channels), or every route for that destination failed.Pace your dialer to the agreed CPS. Configure a second trunk for failover. Ask the NOC if it persists.

Seeing one-way audio instead of an error? Read One-Way Audio on VoIP Calls.

FAQ

FusionPBX questions

Can several tenants share one gateway?

Yes. Leave the gateway domain set to Global and create outbound routes per tenant. Each tenant can present its own caller ID.

Why do inbound calls get 401 on FusionPBX?

The external profile only accepts calls from IPs in the providers ACL. Add our IP and reload the ACL.

How do I add failover?

Add a second gateway and pick it as Alternate gateway in the outbound route. FusionPBX tries it if the first fails.

Ready to connect FusionPBX?

Prepaid from $200. No setup fee, no contract. Get rates and your account details from sales.