Skip to main content

Trunks

The Trunks section allows you to manage communication pathways for both incoming and outgoing calls. Trunks create flexible connections between your FlyNumber phone system and external service providers, giving you control over call routing, protocols, and call display information.

important

This feature is not enabled by default. If you need to use custom trunks for your phone system, please contact FlyNumber support to open a ticket and request activation of this feature for your account.

Trunks interface showing inbound trunk configuration options

What Are Trunks?​

Think of trunks as dedicated highways for your voice traffic. They establish how calls enter and exit your phone system, determining:

  • How incoming calls from external providers reach your system
  • How outgoing calls connect to the public telephone network
  • What caller information displays during calls
  • Which audio codecs are used for optimal sound quality
Why Use Custom Trunks?

Custom trunks provide several advantages for businesses with specific requirements:

  • Provider Flexibility: Use multiple VoIP providers simultaneously
  • Cost Control: Route calls through the most economical providers
  • Advanced Number Management: Maintain existing numbers with other providers
  • Custom Call Routing: Create sophisticated routing rules based on call patterns
  • Enhanced Redundancy: Set up backup pathways for business continuity

The Trunks interface is divided into three primary sections:

  1. Inbound Trunks: Manage how external calls arrive in your phone system
  2. Termination Gateways: Configure connections to external VoIP providers
  3. Termination Routes: Create routing rules for outbound calls

Inbound Trunks​

Inbound trunks allow you to receive calls from external VoIP providers directly into your FlyNumber phone system for processing. This is particularly useful when you have existing phone numbers with other providers that you want to integrate with your system.

Inbound trunk configuration options showing general settings and registration details

Creating an Inbound Trunk​

To create a new inbound trunk:

  1. Navigate to Trunks > Inbound Trunks
  2. Click the + button in the lower right corner
  3. Configure the following settings:

General Settings​

SettingDescription
DomainAuto-generated unique domain (e.g., xxxxxxx.in.phone.systems)
NameFriendly name to identify this trunk
Transport ProtocolUDP (most common) or TCP
Lookup Destination ByHow to route incoming calls (typically R-URI username part)
Allowed CodecsAudio formats supported (OPUS, G722, PCMA, etc.)

Registration (Optional)​

If your provider requires registration:

  1. Toggle "Enable registration" to ON
  2. Enter the registration details:
    • Domain (typically your provider's SIP domain)
    • Port (usually 5060, consult your provider)
    • Username
    • Password
    • Contact user (optional identifier)
tip

Registration allows your trunk to authenticate with providers that require it. If your provider doesn't require registration, you can leave this section disabled.

CLI Rules​

CLI (Caller Line Identification) rules allow you to modify how caller information appears when calls come through this trunk.

CLI rules configuration for inbound trunks showing caller ID modification options

You can create rules to:

  • Change caller names (e.g., add your company name)
  • Modify destination numbers (e.g., remove country codes)
  • Apply custom formatting to enhance caller identification
note

CLI rules use POSIX Regular Expressions for pattern matching and replacement. Use the examples provided in the interface for guidance.

Technical Details​

When configuring an inbound trunk:

  • Each trunk receives a unique SIP domain address
  • Phone numbers should be in E.164 format (e.g., +12025551234)
  • Your SIP provider needs to forward calls to your trunk's domain
  • The system automatically creates a default inbound trunk

Best Practices​

  1. Clear Naming: Use descriptive names that identify the provider or purpose
  2. Registration Check: Test registration status to ensure proper connectivity
  3. Codec Selection: Choose appropriate codecs based on quality needs and bandwidth
  4. CLI Rules: Use CLI rules to present consistent caller information
  5. Provider Documentation: Consult your VoIP provider's specific instructions
tip

When configuring CLI rules, start with simple patterns and test thoroughly before implementing complex rules. This helps prevent unexpected call routing issues.

Inbound Trunk Use Cases​

Use CaseDescription
Multi-Provider IntegrationConnect numbers from different providers to a single system
Legacy System MigrationGradually transition from older phone systems
Geographic FlexibilityMaintain local presence numbers from various regions
RedundancyCreate backup call paths for business continuity

Termination Gateways​

Termination Gateways connect your FlyNumber phone system to external VoIP providers for outbound calling. They act as bridges that route your outgoing calls to the public telephone network or other SIP destinations.

Termination Gateways interface showing gateway connection details

Creating a Termination Gateway​

To set up a new termination gateway:

  1. Navigate to Trunks > Termination Gateways
  2. Click the + button in the lower right corner
  3. Configure the following settings:

Creating a termination gateway with configuration options

General Settings​

SettingDescription
NameDescriptive name for this gateway (e.g., "Main Provider" or "International")
Network ProtocolUsually "IPv4 Only" (based on your provider's requirements)
UsernameAuthentication username from your termination provider
PasswordAuthentication password from your termination provider
HostIP address or domain name of your provider's SIP server
PortConnection port (typically 5060 for UDP/TCP or 5061 for TLS)
Allowed CodecsAudio formats supported (prioritize in order of preference)
tip

When selecting codecs, keep in mind:

  • OPUS offers the highest quality but requires more bandwidth
  • G722 provides HD voice quality
  • PCMU/PCMA (G.711) are widely supported standard codecs
  • G729 uses less bandwidth but with slightly lower quality
  • Always include "telephone-event" for proper DTMF tone handling

CLI Rules for Termination Gateways​

CLI rules for termination gateways control how caller information appears in outbound calls:

Rule TypePurpose
SRC RewriteModify the caller ID number shown to the recipient
DST RewriteAdjust the format of the dialed destination number
note

These rules are particularly useful for:

  • Adding or removing country codes
  • Ensuring proper number formatting for your provider
  • Presenting consistent company caller ID

Technical Considerations​

  1. Provider Requirements: Always consult your VoIP provider's documentation for specific setup instructions
  2. Firewall Settings: Ensure your network allows traffic on the specified ports
  3. Codec Compatibility: Verify your provider supports your preferred codecs
  4. Call Quality: Network conditions and codec selection directly impact call clarity

Termination Routes​

Termination Routes define the pathways for outbound calls through your configured gateways. They give you granular control over which calls use which gateways based on number patterns.

Creating a Termination Route​

To create a new termination route:

  1. Navigate to Trunks > Termination Routes
  2. Click the + button in the lower right corner
  3. Configure the following settings:

Creating a termination route with prefix and gateway options

Route Settings​

SettingDescription
NameDescriptive name for this route (e.g., "Local Calls" or "International")
SRC PrefixOptional prefix for matching source numbers (caller)
DST PrefixOptional prefix for matching destination numbers (dialed)
GatewayThe termination gateway to use for calls matching this route

CLI Rules for Routes​

Similar to gateway CLI rules, route-specific rules offer another layer of number formatting control:

Rule TypePurpose
SRC RewriteModify caller ID specifically for this route
SRC Rewrite ResultThe transformed source number pattern
DST RewritePattern to match in dialed numbers
DST Rewrite ResultHow to reformat matched destination numbers

How Route Selection Works​

When a user makes an outbound call, the system:

  1. Compares the call's source and destination numbers against all routes
  2. Selects the route with the most specific matching prefixes
  3. Applies any CLI rules associated with that route
  4. Routes the call through the specified gateway
Route Priority Examples
  • A route with both SRC and DST prefixes takes precedence over a route with only one prefix
  • Longer prefix matches are more specific than shorter ones
  • If multiple routes match equally, the system uses the first matching route

Outbound Routing Use Cases​

Use CaseConfiguration
Cost OptimizationCreate routes for different regions using the most cost-effective gateways for each
Call Quality ManagementUse high-quality providers for important business calls and standard providers for other calls
Geographic FlexibilitySet up different routes to present local caller IDs for different regions
RedundancyConfigure backup gateways that activate if primary connections fail
Number FormattingUse CLI rules to automatically format numbers based on country or provider requirements

Troubleshooting​

IssuePossible Solution
Failed RegistrationCheck provider credentials and network connectivity
One-way AudioVerify codec compatibility and firewall settings
Poor Call QualityTest with different codecs or check network conditions
Incorrect Caller IDAdjust CLI rules to ensure proper formatting
Number Format ErrorsVerify provider's expected number format and update CLI rules
Understanding POSIX Regular Expressions

CLI rules use POSIX Regular Expressions for pattern matching. Here are some basic patterns:

PatternMatches
^Start of string
$End of string
.Any single character
\dAny digit
*Zero or more of previous character
+One or more of previous character
()Grouping for capturing or precedence
\1First capture group (in replacement)

Example: To add "+1" to 10-digit US numbers:

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

Always test your trunk configuration thoroughly before using it in a production environment. Make test calls to various destinations to verify both connectivity and audio quality.

Getting Help​

If you encounter issues configuring your trunks or need assistance with specific provider settings:

  1. Contact FlyNumber support to open a ticket with your specific question
  2. Have your provider's technical documentation available for reference
  3. Be prepared to share (non-sensitive) details about your provider's requirements
tip

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