Hi there! 👋 I'd be happy to help you integrate your Asterisk VoIP number with Vapi AI.
I can provide you with several methods to integrate your Asterisk VoIP number with Vapi AI, including the primary approach using SIP trunking and some alternative methods if direct integration presents challenges.
## Primary Method: SIP Trunking
The most common way to integrate Asterisk with Vapi AI is through SIP trunking:
1. **Set up a SIP trunk in Asterisk for Vapi**:
- Configure a SIP trunk in Asterisk that points to Vapi's SIP endpoint
- Input Vapi's SIP hostname and credentials into your PBX configuration
- [According to the documentation](
https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1331674878092382218), you'll need to configure both outbound and inbound routes
2. **Configure outbound routes in Asterisk**:
- Set up your dial plan to route outbound calls through the Vapi SIP trunk
- Ensure proper authentication is configured (Vapi expects authentication credentials in the SIP Authorization header)
- [The documentation notes](
https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334238882660618250) that the username must be your SIP username, and the password can be anything except "test"
3. **Set up inbound routes in Asterisk**:
- Configure a DID (Direct Inward Dialing) number in Asterisk
- Point it to Vapi's SIP URI to receive calls
- Configure the
sipUri
attribute within the
forwardingPhoneNumbers
array to specify the destination SIP address
- [According to the information found](
https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334821142204121088), ensure your system can handle SIP REFER messages for call transfers
## Alternative Methods
If direct SIP integration proves challenging, here are some alternatives:
1. **Using Twilio as a SIP Bridge**: