Connecting a number via SIP
# support
q
Hello! I'm trying to connect a third-party provider number via SIP using api.vapi.ai/credential But I also need to specify a login and password. Please help me figure out how to do this?
s
@quki To set up SIP authentication for connecting a third-party provider number. Here's how to do it: ## 1. Create BYO SIP Trunk Credential ### API Endpoint POST https://api.vapi.ai/credential ### Curl Example curl -X POST https://api.vapi.ai/credential \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "provider": "byo-sip-trunk", "name": "My SIP Trunk", "gateways": [ { "ip": "your.sip.provider.ip", "port": 5060, "inboundEnabled": true, "outboundEnabled": true } ], "outboundAuthenticationPlan": { "authUsername": "your_outbound_username", "authPassword": "your_outbound_password", "sipRegisterPlan": { "realm": "your.sip.provider.domain", "username": "your_register_username", "domain": "your.sip.provider.domain", "publicIpInContactEnabled": false } } }' ### Response { "id": "credential_id", "provider": "byo-sip-trunk", "name": "My SIP Trunk", ... } ## 2. Create Phone Number with Credential ### API Endpoint POST https://api.vapi.ai/phone-number ### Curl Example curl -X POST https://api.vapi.ai/phone-number \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "provider": "byo-phone-number", "number": "your_phone_number", "credentialId": "credential_id_from_step_1" }' ## Authentication Components Explanation The outbound authentication has two main components: a. Basic Authentication: - authUsername: Username for outbound call authentication - authPassword: Password for outbound call authentication b. SIP Registration (Optional): - sipRegisterPlan: Configuration for SIP REGISTER if your provider requires registration - realm: SIP realm for registration - username: Username for registration (can be different from auth username) - domain: Domain for registration - publicIpInContactEnabled: Whether to use public IP in Contact header The outbound authentication is processed during call setup and registration, ensuring secure communication with your SIP provider while maintaining compatibility with standard SIP authentication mechanisms.
q
Hello. Thanks. Hi, thanks! I have another question about this doc: https://docs.vapi.ai/advanced/sip I did as it was written there. I'm trying to do a redirection from a phone number to the sipUri I created. But when I try to connect, I get the status - CONGESTION in my number. The provider's support said that this is a problem with the endpoint. What could be the problem? https://cdn.discordapp.com/attachments/1341469652366266408/1342219705997459456/image.png?ex=67b8d703&is=67b78583&hm=ef7e996bef3347c48674cd678f264fb0012648bc21c12c3e9d2b05b4a6ee57d1& https://cdn.discordapp.com/attachments/1341469652366266408/1342219706634862744/image.png?ex=67b8d703&is=67b78583&hm=5877fef3235c8393b538224883a9f880ba189a39155c5d253c138b72f0386144&
s
hey can you share the call ID or PCAP associated with these calls?
4 Views