Trunk

Overview

VoIPBIN’s Trunk system provides the infrastructure for SIP-based voice communication, supporting both outbound calls (trunking) and inbound calls (registration). Trunks connect VoIPBIN to the PSTN and enable SIP endpoints to communicate with external networks.

The Trunk system provides:

  • SIP trunking for outbound call routing

  • Registration services for inbound call delivery

  • Connection between VoIPBIN and external providers

  • Integration with on-premise PBX systems

  • Flexible routing through providers

How Trunks Work

The trunk system handles bidirectional call flow between VoIPBIN and external networks.

Trunk Architecture

+-----------------------------------------------------------------------+
|                          Trunk System                                 |
+-----------------------------------------------------------------------+

                     +-------------------+
                     |     VoIPBIN       |
                     |     Platform      |
                     +--------+----------+
                              |
          +-------------------+-------------------+
          |                                       |
          v                                       v
+-------------------+                   +-------------------+
|    Trunking       |                   |   Registration    |
| (Outbound Calls)  |                   | (Inbound Calls)   |
+--------+----------+                   +--------+----------+
         |                                       |
         v                                       v
+-------------------+                   +-------------------+
|     Providers     |                   |   SIP Endpoints   |
| (Telnyx, Twilio)  |                   | (Phones, PBX)     |
+--------+----------+                   +--------+----------+
         |                                       |
         v                                       v
+-------------------+                   +-------------------+
|       PSTN        |                   |  Registered       |
|   (Phone Network) |                   |  Devices          |
+-------------------+                   +-------------------+

Key Components

  • Trunk: Connection to external SIP provider for outbound calls

  • Registration: Service for SIP endpoints to receive inbound calls

  • Provider: External SIP service (Telnyx, Twilio, etc.)

  • PSTN: Public Switched Telephone Network

Trunking vs Registration

Understanding the difference between these two services is essential.

Comparison

+-----------------------------------------------------------------------+
|                    Trunking vs Registration                           |
+-----------------------------------------------------------------------+

TRUNKING (Outbound):
+--------------------------------------------+
| Purpose: Make calls to external numbers    |
| Direction: VoIPBIN -> Provider -> PSTN     |
| Uses: Provider configuration               |
| Example: Call +1-555-123-4567              |
+--------------------------------------------+

REGISTRATION (Inbound):
+--------------------------------------------+
| Purpose: Receive calls on SIP devices      |
| Direction: PSTN -> VoIPBIN -> Device       |
| Uses: Extension configuration              |
| Example: IP phone receives incoming call   |
+--------------------------------------------+

When to Use Each

Capability

Trunking

Registration

Direction

Outbound calls

Inbound calls

Configuration

Provider + Route

Extension

Endpoint

External phone number

SIP device/softphone

Authentication

Provider credentials

Extension credentials

Outbound Call Flow (Trunking)

Outbound calls route through providers to reach external numbers.

Trunking Flow

VoIPBIN                    Provider                      PSTN

|                             |                             |
| 1. Initiate call            |                             |
|    to +1-555-1234           |                             |
+---+                         |                             |
    |                         |                             |
    v                         |                             |
+-------+                     |                             |
| Route |                     |                             |
| Engine|                     |                             |
+---+---+                     |                             |
    |                         |                             |
    | 2. Select provider      |                             |
    |    based on route       |                             |
    |                         |                             |
    | 3. INVITE               |                             |
    +------------------------>|                             |
    |                         |                             |
    |                         | 4. Route to PSTN            |
    |                         +----------------------------->|
    |                         |                             |
    |                         |     5. 180 Ringing          |
    |                         |<----------------------------+
    |     6. Ringing          |                             |
    |<------------------------+                             |
    |                         |                             |
    |                         |     7. 200 OK (Answer)      |
    |                         |<----------------------------+
    |     8. Connected        |                             |
    |<------------------------+                             |
    |                         |                             |
    |         Media (RTP) <-------------------------------> |

Inbound Call Flow (Registration)

Inbound calls reach registered SIP devices.

Registration Flow

PSTN                       VoIPBIN                    SIP Device

|                             |                             |
| 1. Call to VoIPBIN number   |                             |
+----------------------------->|                             |
|                             |                             |
|                             | 2. Flow execution           |
|                             |    (dial extension)         |
|                             +---+                         |
|                             |   |                         |
|                             |   v                         |
|                             | +-------+                   |
|                             | |Lookup |                   |
|                             | |Reg.   |                   |
|                             | +---+---+                   |
|                             |     |                       |
|                             | 3. INVITE to registered IP  |
|                             +----------------------------->|
|                             |                             |
|                             |     4. 180 Ringing          |
|                             |<----------------------------+
|     5. Ringback             |                             |
|<----------------------------+                             |
|                             |                             |
|                             |     6. 200 OK               |
|                             |<----------------------------+
|     7. Connected            |                             |
|<----------------------------+                             |
|                             |                             |
|         Media (RTP) <-------------------------------------> |

Trunk Configuration

Configure the trunk system through providers, routes, and extensions.

Provider Configuration (for Trunking)

See Provider Overview for detailed configuration.

$ curl -X POST 'https://api.voipbin.net/v1.0/providers?token=<token>' \
    --header 'Content-Type: application/json' \
    --data '{
        "name": "Primary SIP Provider",
        "type": "sip",
        "hostname": "sip.provider.com"
    }'

Route Configuration (for Trunking)

See Route Overview for detailed configuration.

$ curl -X POST 'https://api.voipbin.net/v1.0/routes?token=<token>' \
    --header 'Content-Type: application/json' \
    --data '{
        "name": "Default Outbound Route",
        "provider_id": "provider-uuid-123",
        "priority": 1
    }'

Extension Configuration (for Registration)

See Extension Overview for detailed configuration.

$ curl -X POST 'https://api.voipbin.net/v1.0/extensions?token=<token>' \
    --header 'Content-Type: application/json' \
    --data '{
        "name": "office-phone",
        "username": "office1",
        "password": "secure-password"
    }'

Complete Setup Example

Set up a complete trunk system for bidirectional calling.

Setup Steps

Step 1: Configure Provider (Outbound)
+--------------------------------------------+
| Provider: "Telnyx Production"              |
| Hostname: sip.telnyx.com                   |
| Type: sip                                  |
+--------------------------------------------+
          |
          v
Step 2: Configure Route (Outbound)
+--------------------------------------------+
| Route: "Default Route"                     |
| Provider: Telnyx Production                |
| Priority: 1                                |
+--------------------------------------------+
          |
          v
Step 3: Create Extensions (Inbound)
+--------------------------------------------+
| Extension: "office-main"                   |
| Username: office-main                      |
| Password: ********                         |
+--------------------------------------------+
          |
          v
Step 4: Register SIP Devices
+--------------------------------------------+
| Device registers to:                       |
| office-main@{id}.registrar.voipbin.net    |
+--------------------------------------------+
          |
          v
Step 5: Configure Number Flow
+--------------------------------------------+
| Number: +1-555-123-4567                    |
| Flow: Dial extension "office-main"         |
+--------------------------------------------+

Result:
- Outbound: Make calls via Telnyx
- Inbound: Calls to +1-555-123-4567 ring office phone

Common Scenarios

Scenario 1: Basic Office Phone System

Set up a simple office with outbound and inbound calling.

Configuration:
+--------------------------------------------+
| Provider: Telnyx (for outbound)            |
| Route: Default -> Telnyx                   |
| Extensions: office-1, office-2, office-3   |
| Number: +1-555-OFFICE                      |
+--------------------------------------------+

Call Flows:
+--------------------------------------------+
| Outbound: Any extension can dial out       |
|   -> Routes through Telnyx to PSTN         |
|                                            |
| Inbound: Calls to +1-555-OFFICE            |
|   -> IVR: "Press 1 for Sales..."          |
|   -> Routes to appropriate extension       |
+--------------------------------------------+

Scenario 2: Multi-Provider Failover

Configure redundant providers for reliability.

Provider Configuration:
+--------------------------------------------+
| Primary: Telnyx                            |
|   Route Priority: 1                        |
|                                            |
| Secondary: Twilio                          |
|   Route Priority: 2                        |
|                                            |
| Tertiary: Bandwidth                        |
|   Route Priority: 3                        |
+--------------------------------------------+

Failover Behavior:
+--------------------------------------------+
| 1. Try Telnyx first                        |
| 2. If Telnyx fails (5xx) -> try Twilio    |
| 3. If Twilio fails -> try Bandwidth        |
| 4. All fail -> return error to caller      |
+--------------------------------------------+

Scenario 3: Remote Worker Setup

Enable remote workers with softphones.

Setup:
+--------------------------------------------+
| Extension per worker:                      |
|   - remote-john                            |
|   - remote-jane                            |
|   - remote-bob                             |
+--------------------------------------------+

Worker Configuration:
+--------------------------------------------+
| Softphone App: Zoiper, Linphone, etc.      |
| Server: registrar.voipbin.net              |
| Username: remote-john                      |
| Domain: {customer-id}.registrar.voipbin.net|
+--------------------------------------------+

Benefits:
+--------------------------------------------+
| - Work from anywhere with internet         |
| - Same extension travels with worker       |
| - Company number for outbound caller ID    |
| - Inbound calls reach worker globally      |
+--------------------------------------------+

Best Practices

1. Provider Management

  • Configure at least two providers for failover

  • Test provider connectivity regularly

  • Monitor call success rates per provider

  • Choose providers with coverage in your regions

2. Route Configuration

  • Set up priority-based routing

  • Configure failover for all routes

  • Test failover scenarios periodically

  • Document routing logic

3. Extension Security

  • Use strong, unique passwords

  • Rotate credentials periodically

  • Monitor for unauthorized registrations

  • Enable TLS when possible

4. Monitoring

  • Track call success/failure rates

  • Monitor provider latency and quality

  • Set up alerts for registration failures

  • Review call logs regularly

Troubleshooting

Outbound (Trunking) Issues

Symptom

Solution

Calls not connecting

Check provider is configured; verify route exists; confirm provider credentials

Wrong provider used

Review route priorities; check for destination-specific routes

All providers failing

Check provider status; verify network connectivity; test each provider independently

Inbound (Registration) Issues

Symptom

Solution

Device not receiving calls

Verify registration is active; check extension in flow; confirm device is online

Registration failing

Check credentials; verify registrar address; confirm firewall allows SIP traffic

Intermittent registration

Check NAT settings; enable keep-alives; increase registration expiry

Audio Issues

Symptom

Solution

No audio

Check RTP ports; verify NAT traversal; confirm media IP is reachable

One-way audio

Enable STUN/TURN; check symmetric RTP; verify both endpoints can send/receive

Poor audio quality

Check network bandwidth; reduce jitter; consider QoS configuration

Trunking

SIP trunking is a technology that enables organizations to make telephone calls over the internet, rather than traditional phone lines. Instead of using physical phone lines to connect to the public switched telephone network (PSTN), SIP trunking uses an internet connection to carry voice and other communications. SIP trunking is cost-effective, scalable and provides a range of features and benefits, such as better call quality, enhanced disaster recovery capabilities, and the ability to easily manage multiple locations or remote workers. Additionally, SIP trunking allows organizations to consolidate their voice and data networks, reducing the complexity and cost of their telecommunications infrastructure.

Server address

Once you created trunk, the voipbin generates the trunk server address for you.

sip:{your voipbin trunk domain name}.trunk.voipbin.net

Authentication

Currently, The VoIPBIN’s trunking authentication supports only the Basic authentication.

  • Basic authentication

  • IP-based authentication (coming soon)

Basic authentication

To make a SIP outgoing call through a VoIPBIN using basic authentication, you need to follow a few steps:

  1. Choose a SIP client: You can use a software-based SIP client, such as Zoiper or X-Lite, or a hardware-based SIP phone, such as a Cisco or Grandstream phone.

  2. Configure your SIP client: You need to configure your SIP client with VoIPBIN credentials, such as your name, extension, password, domain info.

  3. Set up your outgoing call settings: In your SIP client, you need to specify the destination address(phone number or extension) you want to call and set any additional options, such as the call type, call quality, or call duration.

  4. Initiate the call: Once you have configured your SIP client and set up your outgoing call settings, you can initiate the call by clicking on the call button or using a keypad command.

  5. Authenticate your credentials: When you initiate the call, your SIP client sends your authentication credentials to the VoIPBIN, using the basic authentication method. The VoIPBIN then verifies your credentials and authorizes the call.

  6. Make the call: Once your credentials are verified, the VoIPBIN establishes the call and connects you with the destination address.

By following these steps, you can make a SIP outgoing call through VoIPBIN using basic authentication. This process can be used for a variety of business and personal applications, such as remote work, conferencing, and customer support.

UA                                   VoIPBIN                                 Destination

|                                        |                                        |
|---------------- INVITE --------------->|                                        |
|<-- 407 Proxy Authentication Required --|                                        |
|---------------- ACK ------------------>|                                        |
|                                        |                                        |
|----- INVITE with Authorization ------->|                                        |
|                                        |---------------- INVITE --------------->|
|                                        |                                        |
|                                        |<--------------- 100 Trying ------------|
|<------------- 100 Trying --------------|                                        |
|                                        |                                        |
|                                        |<--------------- 180 Ringing -----------|
|<------------- 180 Ringing -------------|                                        |
|                                        |                                        |
|                                        |<---------------- 200 OK ---------------|
|<------------- 200 OK ------------------|                                        |
|-------------- ACK -------------------->|                                        |
|                                        |----------------- ACK ----------------->|
|                                        |                                        |
|                                        |                                        |
|-------------- BYE -------------------->|                                        |
|                                        |----------------- BYE ----------------->|
|                                        |<---------------- 200 OK ---------------|
|<------------- 200 OK ------------------|                                        |

Call handle

Unlike VoIPBIN’s normal call handling, the VoIPBIN handles trunking outbound calls in a different way. The VoIPBIN executes special flow for the trunking call. It executes the follow features:

  • Enable the early media.

  • Relay the hangup cause.

Early media handle

The VoIPBIN enables the early-media feature for the trunking outbound call.

UA                                   VoIPBIN                                 Destination

|                                        |                                        |
===================================================================================
|----- INVITE with Authorization ------->|                                        |
|                                        |---------------- INVITE --------------->|
|                                        |<--------------- 100 Trying ------------|
|<------------- 100 Trying --------------|                                        |
|                                        |<--------------- 183 Ringing -----------|
|<------------- 183 Ringing -------------|                                        |
|<------------- RTP Media ---------------|<---------------- RTP Media ------------|

Relay hangup cause

The VoIPBIN delivers the hangup cause code from the outgoing call.

UA                                   VoIPBIN                                 Destination

|                                        |                                        |
===================================================================================
|----- INVITE with Authorization ------->|                                        |
|                                        |---------------- INVITE --------------->|
|                                        |<--------------- 100 Trying ------------|
|<------------- 100 Trying --------------|                                        |
|                                        |<--------------- 404 NOT FOUND ---------|
|<------------- 404 NOT FOUND -----------|                                        |

Domain name

The SIP Domain resource in VoIPBIN entails a personalized DNS hostname designed to accept SIP (Session Initiation Protocol) traffic for your account. When a SIP request is directed to this domain, like sip:alice@example.trunk.voipbin.net, it is directed to VoIPBIN. Subsequently, VoIPBIN verifies the request’s authenticity and channels it to the designated voice_url linked with the SIP domain.

This pivotal component facilitates the management of SIP traffic within your VoIPBIN account. It accommodates incoming SIP requests from diverse sources, ensuring seamless communication and integration with VoIPBIN services. Businesses and developers can leverage the SIP Domain resource to create bespoke DNS hostnames, seamlessly integrate VoIPBIN services into existing systems, and construct scalable, reliable SIP-based communication solutions. This capability is particularly beneficial for organizations seeking to manage SIP-based communications securely and efficiently.