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.
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.
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:
- Inbound Trunks: Manage how external calls arrive in your phone system
- Termination Gateways: Configure connections to external VoIP providers
- 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.
Creating an Inbound Trunkβ
To create a new inbound trunk:
- Navigate to Trunks > Inbound Trunks
- Click the + button in the lower right corner
- Configure the following settings:
General Settingsβ
Setting | Description |
---|---|
Domain | Auto-generated unique domain (e.g., xxxxxxx.in.phone.systems) |
Name | Friendly name to identify this trunk |
Transport Protocol | UDP (most common) or TCP |
Lookup Destination By | How to route incoming calls (typically R-URI username part) |
Allowed Codecs | Audio formats supported (OPUS, G722, PCMA, etc.) |
Registration (Optional)β
If your provider requires registration:
- Toggle "Enable registration" to ON
- Enter the registration details:
- Domain (typically your provider's SIP domain)
- Port (usually 5060, consult your provider)
- Username
- Password
- Contact user (optional identifier)
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.
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
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β
- Clear Naming: Use descriptive names that identify the provider or purpose
- Registration Check: Test registration status to ensure proper connectivity
- Codec Selection: Choose appropriate codecs based on quality needs and bandwidth
- CLI Rules: Use CLI rules to present consistent caller information
- Provider Documentation: Consult your VoIP provider's specific instructions
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 Case | Description |
---|---|
Multi-Provider Integration | Connect numbers from different providers to a single system |
Legacy System Migration | Gradually transition from older phone systems |
Geographic Flexibility | Maintain local presence numbers from various regions |
Redundancy | Create 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.
Creating a Termination Gatewayβ
To set up a new termination gateway:
- Navigate to Trunks > Termination Gateways
- Click the + button in the lower right corner
- Configure the following settings:
General Settingsβ
Setting | Description |
---|---|
Name | Descriptive name for this gateway (e.g., "Main Provider" or "International") |
Network Protocol | Usually "IPv4 Only" (based on your provider's requirements) |
Username | Authentication username from your termination provider |
Password | Authentication password from your termination provider |
Host | IP address or domain name of your provider's SIP server |
Port | Connection port (typically 5060 for UDP/TCP or 5061 for TLS) |
Allowed Codecs | Audio formats supported (prioritize in order of preference) |
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 Type | Purpose |
---|---|
SRC Rewrite | Modify the caller ID number shown to the recipient |
DST Rewrite | Adjust the format of the dialed destination number |
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β
- Provider Requirements: Always consult your VoIP provider's documentation for specific setup instructions
- Firewall Settings: Ensure your network allows traffic on the specified ports
- Codec Compatibility: Verify your provider supports your preferred codecs
- 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:
- Navigate to Trunks > Termination Routes
- Click the + button in the lower right corner
- Configure the following settings:
Route Settingsβ
Setting | Description |
---|---|
Name | Descriptive name for this route (e.g., "Local Calls" or "International") |
SRC Prefix | Optional prefix for matching source numbers (caller) |
DST Prefix | Optional prefix for matching destination numbers (dialed) |
Gateway | The 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 Type | Purpose |
---|---|
SRC Rewrite | Modify caller ID specifically for this route |
SRC Rewrite Result | The transformed source number pattern |
DST Rewrite | Pattern to match in dialed numbers |
DST Rewrite Result | How to reformat matched destination numbers |
How Route Selection Worksβ
When a user makes an outbound call, the system:
- Compares the call's source and destination numbers against all routes
- Selects the route with the most specific matching prefixes
- Applies any CLI rules associated with that route
- Routes the call through the specified gateway
To ensure your outbound calls use your custom gateway instead of the default system gateway, you must create specific termination routes. Without proper routes configured, all calls will automatically use the default gateway regardless of your custom gateway settings.
Key Point: Simply creating a custom gateway is not enough - you must also create termination routes that specify when to use that gateway based on source DID, destination patterns, or both.
Route Priority and Gateway Selectionβ
The key to controlling which gateway handles your calls lies in understanding route priority:
Priority Level | Configuration | Example |
---|---|---|
Highest | Both SRC and DST prefixes specified | SRC: +1555, DST: +44 |
Medium | Only DST prefix specified | DST: +1 (for US calls) |
Lower | Only SRC prefix specified | SRC: +1555 (calls from specific number) |
Lowest | No prefixes (catch-all route) | Empty SRC and DST fields |
- 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 (e.g., +44207 beats +44)
- If multiple routes match equally, the system uses the first matching route
- Critical: If no specific routes match, calls default to the system's primary gateway
Outbound Routing Use Casesβ
Use Case | Configuration |
---|---|
Cost Optimization | Create routes for different regions using the most cost-effective gateways for each |
Call Quality Management | Use high-quality providers for important business calls and standard providers for other calls |
Geographic Flexibility | Set up different routes to present local caller IDs for different regions |
Redundancy | Configure backup gateways that activate if primary connections fail |
Number Formatting | Use CLI rules to automatically format numbers based on country or provider requirements |
Troubleshootingβ
Issue | Possible Solution |
---|---|
Failed Registration | Check provider credentials and network connectivity |
One-way Audio | Verify codec compatibility and firewall settings |
Poor Call Quality | Test with different codecs or check network conditions |
Incorrect Caller ID | Adjust CLI rules to ensure proper formatting |
Number Format Errors | Verify 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:
Pattern | Matches |
---|---|
^ | Start of string |
$ | End of string |
. | Any single character |
\d | Any digit |
* | Zero or more of previous character |
+ | One or more of previous character |
() | Grouping for capturing or precedence |
\1 | First capture group (in replacement) |
Example: To add "+1" to 10-digit US numbers:
- Pattern:
^(\d{10})$
- Replacement:
+1\1
Common Configuration Scenariosβ
Scenario 1: Route All Calls Through Custom Gatewayβ
To ensure all outbound calls (including PSTN forwarding from Contact Methods) use your custom gateway instead of the default:
- Create a termination route with:
- Name: "All Outbound Calls"
- SRC Prefix: Leave empty
- DST Prefix: Leave empty
- Gateway: Select your custom gateway
This catch-all route should be your last route. Create more specific routes first for special cases, then add this general route to handle everything else.
This configuration affects all outbound calls, including:
- Direct calls made through the phone system app or SIP accounts
- PSTN forwarding configured in Contact Methods
- Any other outbound call routing
Scenario 2: Route Specific Destination Numbers Through Custom Gatewayβ
To route calls to certain destination numbers through your custom gateway:
- Create a termination route with:
- Name: "International Calls"
- SRC Prefix: Leave empty
- DST Prefix: Enter the pattern (e.g., "+44" for UK numbers)
- Gateway: Select your custom gateway
This is particularly useful when you have PSTN forwarding (phone number forwarding) set up in Contact Methods. If you forward your DID to a UK number (+44), creating a route with DST Prefix "+44" ensures all forwarding to UK numbers uses your preferred gateway instead of the default system gateway.
Scenario 3: Route Calls from Specific DIDsβ
To route calls originating from specific DIDs (phone numbers) through your custom gateway:
- Create a termination route with:
- Name: "Custom DID Route"
- SRC Prefix: Enter your DID number (e.g., "+15551234567")
- DST Prefix: Leave empty (to route all destinations) or specify particular destinations
- Gateway: Select your custom gateway from the dropdown
This configuration ensures that when calls are made from your specific DID number, they will use your chosen custom gateway instead of the default system gateway. This is particularly useful for:
- Maintaining consistent caller ID presentation
- Using specific providers for certain business lines
- Routing emergency or priority numbers through dedicated gateways
Quick Setup Guideβ
For DID-Specific Routingβ
For users who want to route calls from a specific DID through a custom gateway:
- First: Ensure your custom gateway is already created in "Termination Gateways"
- Second: Go to "Termination Routes" and click the + button
- Configure the route:
- Name: Give it a descriptive name (e.g., "Main Line Custom Route")
- SRC Prefix: Enter your DID (the phone number calls originate from)
- DST Prefix: Leave empty for all destinations, or specify patterns
- Gateway: Select your custom gateway from the dropdown list
- Save: Click save to activate the route
For PSTN Forwarding with Custom Gatewaysβ
For users who have PSTN forwarding (phone number forwarding) in Contact Methods and want those forwards to use a custom gateway:
- First: Ensure your custom gateway is already created in "Termination Gateways"
- Second: Go to "Termination Routes" and click the + button
- Configure the route:
- Name: Give it a descriptive name (e.g., "PSTN Forwards Custom Route")
- SRC Prefix: Leave empty (or specify your DID if you want to be more specific)
- DST Prefix: Enter the destination pattern your PSTN forwarding forwards to (e.g., "+1555" for a specific area code)
- Gateway: Select your custom gateway from the dropdown list
- Save: Click save to activate the route
If you have PSTN forwarding in Contact Methods that forwards calls to +15551234567, create a termination route with:
- DST Prefix: "+1555" (or "+15551234567" for exact match)
- Gateway: Your preferred custom gateway
This ensures when your DID forwards calls to that number, it uses your custom gateway instead of the default.
After creating routes, test with different scenarios:
- DID-based routing: Make calls from your configured DID to verify they use the correct gateway
- PSTN forwarding: If you have PSTN forwarding in Contact Methods, test incoming calls that get forwarded
- Destination-based routing: Test calls to numbers matching your DST prefix patterns
- Check call logs to confirm routing behavior
- Test both covered and uncovered number patterns
- Verify that calls from other DIDs still use expected gateways
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:
- Contact FlyNumber support to open a ticket with your specific question
- Have your provider's technical documentation available for reference
- Be prepared to share (non-sensitive) details about your provider's requirements
Some VoIP providers offer specific FlyNumber integration guidesβask your provider if they have one available.