Skip to main content

Trunks

Trunks let you connect your FlyNumber phone system to external VoIP providers for both incoming and outgoing calls. This gives you control over call routing, which providers handle your calls, and how caller information is displayed.

Enabled on request

The Trunks menu isn't shown on a new phone system. Contact FlyNumber support and we'll have it switched on for your account β€” activation happens on our side, so allow a little time. Once it's live, Trunks appears in the main menu with the three tabs described below.

Quick Start​

Most users need trunks for one of these scenarios. Jump to the one that fits your needs:

I want to route all outbound calls through my own VoIP provider

Steps:

  1. Go to Trunks > Termination Gateways and click +
  2. Enter your provider's details (host, username, password, port)
  3. Save the gateway
  4. Go to Trunks > Termination Routes and click +
  5. Create a route with:
    • Name: "All Outbound"
    • SRC Prefix: Leave empty
    • DST Prefix: Leave empty
    • Gateway: Select your new gateway
  6. Save and test with a call

This catch-all route sends all outbound calls through your provider.

I want to route calls to specific countries through a different provider

Steps:

  1. Create your termination gateway (if not already done)
  2. Go to Trunks > Termination Routes and click +
  3. Create a route with:
    • Name: "UK Calls" (or relevant country)
    • SRC Prefix: Leave empty
    • DST Prefix: "+44" (UK country code, adjust as needed)
    • Gateway: Select your gateway
  4. Save and test with a call to that country

Calls to numbers starting with +44 will use your gateway; others use the default.

I want to receive calls from another VoIP provider on my FlyNumber system

Steps:

  1. Go to Trunks > Inbound Trunks. A trunk named Default already exists; open it with Actions β†’ Edit, or click + to create another
  2. Copy the auto-generated Domain shown at the top of the General section (use the copy icon)
  3. Add the external provider's number under Numbers > Phone Numbers so the phone system recognises calls to it
  4. Configure your external provider to send calls to <number in E.164>@<trunk domain>
  5. If your provider requires registration, enable it and enter credentials
  6. Test by calling the number

Your FlyNumber system will receive calls sent to the trunk's domain.


Overview​

Trunks interface showing inbound trunk configuration options

The Trunks interface has three sections:

SectionPurpose
Inbound TrunksReceive calls from external VoIP providers
Termination GatewaysDefine connections to outbound VoIP providers
Termination RoutesControl which gateway handles which outbound calls
Why Use Custom Trunks?
  • Cost Control: Route calls through cheaper providers for specific destinations
  • Provider Flexibility: Use multiple VoIP providers at once
  • Number Portability: Keep numbers with other providers while using FlyNumber features
  • Redundancy: Set up backup call paths
  • Custom Routing: Route based on caller ID, destination, or both

Inbound Trunks​

Inbound trunks let you receive calls from external VoIP providers. Useful when you have phone numbers with other providers that you want to route through your FlyNumber system.

Inbound trunk configuration options

Creating an Inbound Trunk​

  1. Navigate to Trunks > Inbound Trunks
  2. Click the + button
  3. Configure settings:
SettingDescription
DomainAuto-generated β€” copy it with the icon next to the field and give it to your provider. New trunks include the region you pick (see POP) in the domain
Friendly NameName shown in the list (e.g., "External Provider Trunk")
Transport ProtocolUDP, TCP or TLS
POPWhich of the two points of presence handles the trunk's calls: FRA (Frankfurt, default) or NYC (New York). Changing it changes the domain, so update your provider afterwards
Lookup destination byHow the called number is read from the incoming call: R-URI username part (typical) or To header username part
Allowed CodecsOPUS, G722, PCMU, PCMA, G729, GSM, telephone-event β€” drag to set priority (left-most first). Keep telephone-event so key presses reach voice menus and feature codes

Numbers that reach you through an inbound trunk must also be added under Numbers > Phone Numbers β€” otherwise the phone system can't match the incoming call to a Phone Number module.

Registration (If Required)​

Some providers require your trunk to register with them (registration is off by default):

  1. Toggle Registration to ON
  2. Enter:
    • Domain: Your provider's SIP registrar
    • Port: Usually 5060 β€” leave empty to use the provider's SRV or A record
    • Username and Password: From your provider
    • Contact User: Optional value for the Contact header

CLI Rules​

CLI rules for inbound trunks

Modify caller information as calls arrive:

  • SRC number rule: a ready-made choice to Remove + or Add + on the caller's number
  • SRC Name Rewrite Rule / Result: change caller names (e.g., add an "External: " prefix)
  • DST Rewrite Rule / Result: reformat the called number (e.g., strip country codes)

The rewrite rules use POSIX Regular Expressions. See Understanding Regular Expressions below.


Termination Gateways​

Termination gateways connect your system to external providers for outbound calls.

A FlyNumber-managed gateway is already there and carries your outbound calls by default; it shows a padlock and can't be edited or deleted. Add a gateway only when you want a third-party provider or custom routing.

Termination Gateways interface

Creating a Termination Gateway​

  1. Navigate to Trunks > Termination Gateways
  2. Click the + button
  3. Configure settings:

Creating a termination gateway

SettingDescriptionExample
NameFriendly name"Main Provider"
Network ProtocolIPv4 Only (usual), IPv6 Only, Dualstack, IPv4 Preferred or IPv6 PreferredIPv4 Only
Transport ProtocolUDP, TCP or TLSUDP
UsernameAuth username from provideryour_username
PasswordAuth password from providerβ€’β€’β€’β€’β€’β€’β€’
HostProvider's SIP serversip.provider.com
PortConnection port (5060 if left empty)5060 (UDP/TCP) or 5061 (TLS)
Allowed CodecsOPUS, G722, PCMU, PCMA, G729, GSM, telephone-event β€” drag to set priorityOPUS, G722, PCMU
Codec Selection
  • OPUS: Highest quality, more bandwidth
  • G722: HD voice quality
  • PCMU/PCMA: Standard quality, widely supported
  • G729: Lower bandwidth, slightly lower quality
  • Always include telephone-event for DTMF tones

CLI Rules for Gateways​

RulePurpose
SRC RewriteModify outbound caller ID
DST RewriteReformat destination number

Useful for adding/removing country codes or presenting specific caller IDs.


Termination Routes​

Routes determine which gateway handles each outbound call based on number patterns.

Key Point

Creating a gateway isn't enoughβ€”you must also create routes that tell the system when to use it. Without routes, calls use the default gateway.

Creating a Termination Route​

  1. Navigate to Trunks > Termination Routes
  2. Click the + button
  3. Configure settings:

Creating a termination route

SettingDescription
NameFriendly name (e.g., "International Calls")
SRC PrefixMatch calls FROM numbers starting with this (optional)
DST PrefixMatch calls TO numbers starting with this (optional)
GatewayWhich gateway to use

Route Priority​

When several routes could match a call, the one whose prefixes match most closely wins β€” a longer prefix beats a shorter one (+44207 beats +44, which beats an empty prefix). An empty SRC or DST prefix means "any". If no custom route matches, the call uses the FlyNumber-managed default gateway.

Common Route Configurations​

Route all calls through custom gateway:

  • SRC Prefix: (empty)
  • DST Prefix: (empty)
  • Gateway: Your custom gateway

Route UK calls through custom gateway:

  • SRC Prefix: (empty)
  • DST Prefix: +44
  • Gateway: Your UK provider

Route calls from specific DID:

  • SRC Prefix: +15551234567
  • DST Prefix: (empty)
  • Gateway: Your custom gateway

Troubleshooting​

ProblemLikely CauseSolution
Inbound calls never arriveNumber not added under Numbers > Phone Numbers, or provider sending to an old domain after a POP changeAdd the number; re-copy the trunk domain and update the provider
Calls don't connectWrong gateway credentialsVerify username/password with provider
Registration failsNetwork/firewall issueCheck connectivity to provider's server
One-way audioCodec mismatch or firewallTry different codecs; open RTP ports
Wrong caller IDCLI rules neededAdd SRC Rewrite rule
Number format rejectedProvider expects different formatAdd DST Rewrite to format numbers

Reference​

Understanding Regular Expressions​

CLI rules use POSIX Regular Expressions:

PatternMeaning
^Start of string
$End of string
.Any character
\dAny digit
*Zero or more of previous
+One or more of previous
()Capture group
\1First captured group (in replacement)

Example: Add "+1" to 10-digit US numbers:

  • Pattern: ^(\d{10})$
  • Replacement: +1\1

Inbound Trunk Use Cases​

Use CaseDescription
Multi-Provider IntegrationRoute numbers from various providers to one system
Legacy MigrationGradually move from old phone systems
Geographic PresenceMaintain local numbers from different regions
RedundancyBackup call paths for reliability

Outbound Route Use Cases​

Use CaseHow to Configure
Cost SavingsRoute by destination country to cheapest providers
Quality ControlPremium gateway for important calls
Local PresencePresent local caller IDs per region
FailoverMultiple routes to different gateways

Getting Help​

If you need assistance:

  1. Open a support ticket with FlyNumber
  2. Have your provider's documentation ready
  3. Include (non-sensitive) details about your setup
tip

Some VoIP providers have specific FlyNumber integration guidesβ€”ask your provider if one is available.