SIP Trunking
Credential Authentication
Authenticate SIP traffic using username and password (digest auth).
Authenticate SIP traffic using username and password with SIP digest authentication. This method is ideal when your PBX or SBC does not have a static IP address or when you prefer credential-based security.
How It Works
- Create credentials for your trunk
- Configure your PBX/SBC to authenticate with these credentials
- TryVox's Kamailio proxy validates SIP REGISTER and INVITE messages using digest authentication
- Authenticated traffic is allowed through to the PSTN
Create Credentials
POST
https://api.tryvox.io/v1/account/{auth_id}/trunks/{trunk_id}/credentialsRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | yes | SIP authentication username |
| password | string | yes | SIP authentication password. Use a long random value. |
| realm | string | no | Digest realm. Defaults to the trunk's sip_domain. |
| enabled | boolean | no | Default true |
Example Request
curl -X POST https://api.tryvox.io/v1/account/$TRYVOX_AUTH_ID/trunks/$TRUNK_ID/credentials \
-u $TRYVOX_AUTH_ID:$TRYVOX_AUTH_TOKEN \
-H "Content-Type: application/json" \
-d '{
"username": "pbx-prod-01",
"password": "replace-with-a-long-random-password"
}'Response
201 Created:
{
"data": {
"id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
"trunk_id": "4a5b6c7d-8e9f-4a1b-9c2d-3e4f5a6b7c8d",
"account_id": "TJab12cd34",
"username": "pbx-prod-01",
"realm": "e91f03b2.sip.tryvox.io",
"enabled": true,
"created_at": "2026-10-30T10:35:00Z",
"updated_at": "2026-10-30T10:35:00Z"
}
}The password is never returned.
Configure Your PBX
Once you've created credentials, configure your PBX or SBC with:
- SIP Server/Proxy: the trunk's
sip_domain(e.g.e91f03b2.sip.tryvox.io) - Port:
5060(UDP/TCP) or5061(TLS) - Realm: the credential's
realm - Username: The username you created
- Password: The password you created
- Auth Username: Same as username
- Register: Optional (recommended for inbound calls)
List, Get, Update, Delete
GET /v1/account/{auth_id}/trunks/{trunk_id}/credentials
GET /v1/account/{auth_id}/trunks/{trunk_id}/credentials/{credential_id}
PUT /v1/account/{auth_id}/trunks/{trunk_id}/credentials/{credential_id}
DELETE /v1/account/{auth_id}/trunks/{trunk_id}/credentials/{credential_id}PUT accepts any of username, password, realm, and enabled. The list returns data as an array of credential objects.
Account-Level Credentials
The same operations exist without a trunk:
/v1/account/{auth_id}/credentials
/v1/account/{auth_id}/credentials/{credential_id}Attach an account-level credential to a trunk with credential_uuid on Update Trunk.
Security Best Practices
- Use strong passwords (minimum 12 characters, mix of letters, numbers, and symbols)
- Rotate credentials regularly
- Use unique credentials for each PBX or device
- Enable TLS (port 5061) for encrypted signaling