correct-apricot
correct-apricot3mo ago

BYOS

Hi! I would like to enable Bring Your Own SIP (BYOS) feature so I can connect my local Asterisk PBX and route calls to a Vapi agent via SIP.
2 Replies
Vapi
Vapi3mo ago
To enable BYOS and connect your Asterisk PBX to Vapi, create a SIP trunk credential in Vapi using your Asterisk server details. Here’s a sample API call:
curl -X POST "https://api.vapi.ai/credential" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
-d '{
"provider": "byo-sip-trunk",
"name": "Asterisk Trunk",
"gateways": [{ "ip": "YOUR_ASTERISK_SERVER_IP_OR_DOMAIN" }],
"outboundAuthenticationPlan": {
"authUsername": "YOUR_SIP_USERNAME",
"authPassword": "YOUR_SIP_PASSWORD"
}
}'
curl -X POST "https://api.vapi.ai/credential" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_VAPI_PRIVATE_KEY" \
-d '{
"provider": "byo-sip-trunk",
"name": "Asterisk Trunk",
"gateways": [{ "ip": "YOUR_ASTERISK_SERVER_IP_OR_DOMAIN" }],
"outboundAuthenticationPlan": {
"authUsername": "YOUR_SIP_USERNAME",
"authPassword": "YOUR_SIP_PASSWORD"
}
}'
Replace the placeholders with your actual details. After this, associate a phone number and configure your PBX to route calls to the Vapi SIP URI.
Tip: Make sure your Asterisk server allows SIP traffic from Vapi’s IPs and matches authentication settings. Source: - Vapi SIP Trunking Documentation
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
Shubham Bajaj
Shubham Bajaj3mo ago
Hey, You can check out this guide: https://docs.vapi.ai/advanced/sip/sip-trunk for details on integration. Note: This is a standard guide used by many telephony providers, so it should be helpful.

Did you find this page helpful?