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.

important

This feature is not enabled by default. Contact FlyNumber support to request activation for your account.

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 and click +
  2. Note the auto-generated domain (e.g., xxxxxxx.in.phone.systems)
  3. Configure your external provider to forward calls to this domain
  4. If your provider requires registration, enable it and enter credentials
  5. Test by calling from your external provider

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 (e.g., xxxxxxx.in.phone.systems) β€” give this to your provider
NameFriendly name (e.g., "External Provider Trunk")
Transport ProtocolUDP (most common) or TCP
Lookup Destination ByHow to route calls (typically "R-URI username part")
Allowed CodecsAudio formats to accept

Registration (If Required)​

Some providers require your trunk to register with them:

  1. Toggle Enable registration to ON
  2. Enter:
    • Domain: Your provider's SIP domain
    • Port: Usually 5060
    • Username and Password: From your provider
    • Contact user: Optional identifier

CLI Rules​

CLI rules for inbound trunks

Modify caller information as calls arrive:

  • Change caller names (e.g., add "External: " prefix)
  • Reformat numbers (e.g., strip country codes)

Rules use POSIX Regular Expressions. See Understanding Regular Expressions below.


Termination Gateways​

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

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 ProtocolUsually IPv4 OnlyIPv4 Only
UsernameAuth username from provideryour_username
PasswordAuth password from providerβ€’β€’β€’β€’β€’β€’β€’
HostProvider's SIP serversip.provider.com
PortConnection port5060 (UDP/TCP) or 5061 (TLS)
Allowed CodecsAudio formatsOPUS, G722, PCMU, etc.
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​

More specific routes take precedence:

PriorityConfigurationExample
HighestBoth SRC and DST setFrom +1555 to +44
MediumOnly DST setTo +44 (any source)
LowerOnly SRC setFrom +1555 (any destination)
LowestNeither setCatch-all

Tip: Longer prefixes beat shorter ones (+44207 beats +44).

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
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.