Provider
Overview
VoIPBIN’s Provider API enables management of telecommunication service providers that handle external call routing. Providers are SIP trunking services that connect VoIPBIN to the PSTN (Public Switched Telephone Network) and other external networks.
With the Provider API you can:
Configure SIP trunk providers
Set technical parameters for call routing
Manage provider credentials
Define routing preferences
Monitor provider status
How Providers Work
Providers connect VoIPBIN to external telephone networks.
Provider Architecture
+-----------------------------------------------------------------------+
| Provider System |
+-----------------------------------------------------------------------+
VoIPBIN Provider External
| | |
| Outbound call | |
+------------------------------>| |
| | Route to PSTN |
| +-------------------------->|
| | |
| | Call connects |
|<------------------------------|<--------------------------+
| | |
+-------------------+ +-------------------+ +-----------+
| VoIPBIN | | Provider | | PSTN |
| Platform |<------>| (SIP Trunk) |<------>| Network |
+-------------------+ +-------------------+ +-----------+
|
+---------+---------+
| |
v v
+---------+ +---------+
| Telnyx | | Twilio |
+---------+ +---------+
Key Components
Provider: A SIP trunk service for external call routing
Hostname: The SIP server address
Tech Prefix/Postfix: Number formatting rules
Tech Headers: Custom SIP headers for authentication
Provider Configuration
Configure providers with technical parameters.
Provider Properties
Property |
Description |
|---|---|
id |
Unique identifier for the provider |
name |
Display name of the provider |
type |
Protocol type (e.g., “sip”) |
hostname |
SIP server address (e.g., sip.telnyx.com) |
tech_prefix |
Prefix to add to dialed numbers |
tech_postfix |
Suffix to add to dialed numbers |
tech_headers |
Custom SIP headers for the provider |
Example Provider Configuration
{
"id": "provider-uuid-123",
"name": "Telnyx Production",
"type": "sip",
"hostname": "sip.telnyx.com",
"tech_prefix": "",
"tech_postfix": "",
"tech_headers": {
"X-Custom-Header": "value"
},
"tm_create": "2024-01-01T00:00:00Z"
}
Provider Types
VoIPBIN supports various provider configurations.
SIP Provider
+--------------------------------------------+
| SIP Provider |
+--------------------------------------------+
| Protocol: SIP (Session Initiation Protocol)|
| Used for: Voice calls |
| Example: Telnyx, Twilio, Bandwidth |
+--------------------------------------------+
Outbound Call Flow:
VoIPBIN -> SIP INVITE -> Provider -> PSTN
Number Formatting
Providers may require specific number formats.
Tech Prefix/Postfix Usage
Original Number: +15551234567
With Prefix "1":
+--------------------------------------------+
| Dialed: 1+15551234567 |
+--------------------------------------------+
With Postfix "@provider.com":
+--------------------------------------------+
| Dialed: +15551234567@provider.com |
+--------------------------------------------+
With Both:
+--------------------------------------------+
| Dialed: 1+15551234567@provider.com |
+--------------------------------------------+
Common Scenarios
Scenario 1: Primary Provider Setup
Configure main outbound provider.
Provider: "Main Carrier"
+--------------------------------------------+
| name: "Telnyx Production" |
| hostname: "sip.telnyx.com" |
| type: "sip" |
| |
| Used for: All outbound calls |
+--------------------------------------------+
Scenario 2: Multi-Provider Configuration
Configure multiple providers for failover.
Primary Provider: "Telnyx"
+--------------------------------------------+
| hostname: "sip.telnyx.com" |
| Priority: 1 (first choice) |
+--------------------------------------------+
Secondary Provider: "Twilio"
+--------------------------------------------+
| hostname: "sip.twilio.com" |
| Priority: 2 (failover) |
+--------------------------------------------+
Routing Logic:
1. Try primary provider
2. If failed -> try secondary
Scenario 3: Regional Providers
Use different providers for different regions.
US Provider: "Telnyx US"
+--------------------------------------------+
| For numbers: +1xxx |
| Optimal routing for US calls |
+--------------------------------------------+
EU Provider: "Telnyx EU"
+--------------------------------------------+
| For numbers: +44, +49, +33... |
| Optimal routing for EU calls |
+--------------------------------------------+
Best Practices
1. Provider Selection
Choose providers with good coverage for your regions
Consider pricing, quality, and reliability
Test providers before production use
2. Configuration
Keep provider credentials secure
Document provider-specific requirements
Test number formatting thoroughly
3. Failover
Configure multiple providers
Set up proper failover routing
Monitor provider health
4. Monitoring
Track call success rates per provider
Monitor latency and quality
Set up alerts for provider issues
Troubleshooting
Connection Issues
Symptom |
Solution |
|---|---|
Calls not connecting |
Verify hostname is correct; check provider credentials; test network connectivity |
Authentication failures |
Check tech_headers for auth info; verify credentials with provider |
Routing Issues
Symptom |
Solution |
|---|---|
Wrong number format |
Check tech_prefix and tech_postfix; verify provider requirements |
Provider rejecting calls |
Check account status with provider; verify number is allowed |
Provider
Provider
{
"id": "<string>",
"name": "<string>",
"detail": "<string>",
"type": "<string>",
"hostname": "<string>",
"tech_prefix": "<string">,
"tech_postfix": "<string>",
"tech_headers": {
"<string>": "<string">,
},
"tm_create": "<string>",
"tm_update": "<string>",
"tm_delete": "<string>"
}
id: Provider’s id.
name: Provider’s name.
detail: Provider’s detail.
type: Provider’s type. See detail here.
tech_prefix: Tech prefix. Will be attacehd to the beginning of the destination. Valid only the type sip.
tech_postfix: Tech postfix. Will be attacehd to the end of the destination. Valid only the type sip.
tech_headers: Key/value fair of SIP headers. Valid only the type sip.
example
{
"id": "4dbeabd6-f397-4375-95d2-a38411e07ed1",
"type": "sip",
"hostname": "sip.telnyx.com",
"tech_prefix": "",
"tech_postfix": "",
"tech_headers": {},
"name": "telnyx basic",
"detail": "telnyx basic",
"tm_create": "2022-10-22 16:16:16.874761",
"tm_update": "2022-10-24 04:53:14.171374",
"tm_delete": "9999-01-01 00:00:00.000000"
}
Type
Defines types of provider.
Type |
Description |
|---|---|
sip |
SIP service provider. |
Tutorial
Get list of providers
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/providers?token=<YOUR_AUTH_TOKEN>'
{
"result": [
{
"id": "4dbeabd6-f397-4375-95d2-a38411e07ed1",
"type": "sip",
"hostname": "sip.telnyx.com",
"tech_prefix": "",
"tech_postfix": "",
"tech_headers": {},
"name": "telnyx basic",
"detail": "telnyx basic",
"tm_create": "2022-10-22 16:16:16.874761",
"tm_update": "2022-10-24 04:53:14.171374",
"tm_delete": "9999-01-01 00:00:00.000000"
}
...
],
"next_page_token": "2022-10-22 16:16:16.874761"
}
Get detail of provider
Example
$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/outplans/d5fb7357-7ddb-4f2d-87b5-8ccbfd6c039e?token=<YOUR_AUTH_TOKEN>'
{
"id": "d5fb7357-7ddb-4f2d-87b5-8ccbfd6c039e",
"name": "test outplan",
"detail": "outplan for test use.",
"source": {
"type": "tel",
"target": "+15559876543",
"target_name": "",
"name": "",
"detail": ""
},
"dial_timeout": 30000,
"try_interval": 60000,
"max_try_count_0": 5,
"max_try_count_1": 5,
"max_try_count_2": 5,
"max_try_count_3": 5,
"max_try_count_4": 5,
"tm_create": "2022-04-28 01:50:23.414000",
"tm_update": "2022-04-30 12:01:13.780469",
"tm_delete": "9999-01-01 00:00:00.000000"
}
Create a new provider
Example
$ curl --location --request POST 'https://api.voipbin.net/v1.0/providers?token=<YOUR_AUTH_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": "sip",
"hostname": "test.com",
"tech_prefix": "",
"tech_postfix": "",
"tech_headers": {},
"name": "test domain",
"detail": "test domain creation"
}'
Update provider
Example
$ curl --location --request PUT 'https://api.voipbin.net/v1.0/providers/4dbeabd6-f397-4375-95d2-a38411e07ed1?token=<YOUR_AUTH_TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Cookie: token=<YOUR_AUTH_TOKEN>' \
--data-raw '{
"type": "sip",
"hostname": "sip.telnyx.com",
"tech_prefix": "",
"tech_postfix": "",
"tech_headers": {},
"name": "telnyx basic",
"detail": "telnyx basic"
}'
Delete provider
Example
$ curl --location --request DELETE 'https://api.voipbin.net/v1.0/providers/7efc9379-2d3e-4e54-9d36-23cff676a83e?token=<YOUR_AUTH_TOKEN>'