Overview
This guide explains how to connect your Vonage (formerly Nexmo) account to Smallest AI using the Voice API with SIP connectivity. Vonage provides global voice services with excellent reliability and feature-rich APIs.Prerequisites
Before you begin, make sure you have:- An active Vonage API account
- Access to the Vonage API Dashboard
- Phone numbers in your Vonage account (or ability to purchase new ones)
- API credentials (API key and secret)
Step 1: Create a Voice API Application
- Log in to the Vonage API Dashboard
- Navigate to Applications in the left sidebar
- Click Create a new application
- Enter application details:
- Name: Give it a descriptive name (e.g., “Smallest AI Voice App”)
- Capabilities: Enable Voice capability
- Configure voice event URLs:
- Answer URL: This will be configured to route to Smallest AI
- Event URL: Optional webhook URL for call events
- Click Generate new application
Step 2: Configure SIP Settings
Set Up SIP Endpoint
- In your application settings, navigate to SIP or Voice Configuration
- Add Smallest AI’s SIP endpoint as a destination:
- Configure the SIP connection settings:
- Transport: UDP or TCP (UDP recommended)
- Media Encryption: SRTP if required
- Save your SIP configuration
Generate SIP Credentials
- In your application, go to the Authentication or Security section
- Generate SIP credentials if using credential-based authentication:
- Note your SIP Username
- Note your SIP Password
- Alternatively, configure API key-based authentication:
- Use your Vonage API key and secret
- Save your authentication settings
Step 3: Configure Voice Answer URL
Set up how incoming calls are handled:Option 1: Direct SIP Routing
Configure your answer URL to route directly to Smallest AI:- In your application settings, set the Answer URL
- Configure it to return a connect action to Smallest AI’s SIP endpoint
- Use NCCO (Nexmo Call Control Objects) format:
Option 2: Webhook-Based Routing
- Set up a webhook endpoint on your server
- Configure the webhook to dynamically route calls
- Return NCCO with SIP connect action based on business logic
Step 4: Get Your Outbound SIP URI
For outbound calls from Smallest AI to Vonage:- In your Vonage dashboard, find your SIP Endpoint
- Your Vonage outbound SIP URI typically follows this format:
sip:sip.nexmo.com
- Or a region-specific endpoint like
sip:sip-us.nexmo.com
- Note this URI - you’ll need it when importing numbers on Smallest AI
- Verify the URI includes any authentication parameters if needed
Step 5: Link Numbers to Your Application
Connect your phone numbers to the Voice API application.For Existing Numbers
- Navigate to Numbers → Your Numbers in the Vonage dashboard
- Find the number you want to use with Smallest AI
- Click Edit next to the number
- Under Application, select your newly created Voice API application
- Ensure the number is configured for:
- Voice capability enabled
- Correct answer URL configured
- Save your changes
For New Numbers
- Navigate to Numbers → Buy Numbers
- Search for numbers by:
- Country
- Features (Voice, SMS)
- Number type (mobile, landline)
- Purchase your desired number
- After purchase, link it to your Voice API application
- Configure voice settings
Step 6: Configure Authentication
Choose your authentication method for SIP connections:API Key Authentication
- Use your Vonage API key and secret
- These will be used in the SIP Termination URL:
- Format:
sip:sip.nexmo.com;username=API_KEY;password=API_SECRET
- Format:
- Store these credentials securely
JWT Authentication
For enhanced security:- Generate a JWT token using your application private key
- Configure JWT authentication in your application settings
- Use JWT token in SIP authentication headers
- Token expiration and refresh handled automatically
JWT authentication is more secure and recommended for production use. API key authentication is simpler for
testing and development.
Step 7: Import Numbers on Smallest AI
Now import your Vonage numbers into Smallest AI.- Navigate to Phone Numbers in your Smallest AI dashboard
- Click Buy Numbers button
- Select the Import SIP Number tab
-
Fill in your number details:
-
Phone Number: Your Vonage number in E.164 format
- Example:
+12025551234
for a US number - Example:
+442071234567
for a UK number
- Example:
-
SIP Termination URL: Your Vonage SIP endpoint
- Example:
sip:sip.nexmo.com
- Or region-specific:
sip:sip-us.nexmo.com
- Include authentication if required
- Example:
-
Display Name (Optional): A friendly name for this number
- Example: “Support Hotline”
- Username: Your Vonage API key or SIP username
- Password: Your Vonage API secret or SIP password
-
Phone Number: Your Vonage number in E.164 format
- Copy the SIP Origination URL shown
- Click Add Custom Number
Ensure the phone number format matches exactly with your Vonage number, including country code.
Step 8: Test Your Setup
After importing your number:- Assign the imported Vonage number to one of your AI agents
- Make a test inbound call to your Vonage number
- Verify the call connects to your AI agent properly
- Test an outbound call from your agent
- Check audio quality in both directions
- Monitor call events in Vonage dashboard
Troubleshooting
Inbound Calls Not Connecting
Check Application Configuration:- Verify your Voice API application has the correct Answer URL
- Ensure NCCO returns proper SIP connect action
- Check that SIP endpoint URI is correct:
sip:5rdbhjuwtlk.sip.livekit.cloud
- Confirm the number is linked to your Voice API application
- Verify voice capability is enabled on the number
- Check that answer URL is accessible and responding
- Navigate to Reports → Call logs in Vonage dashboard
- Check for error messages in call events
- Look for webhook delivery failures
Outbound Calls Failing
Verify SIP Termination URI:- Ensure the SIP URI in Smallest AI matches your Vonage endpoint
- Check for typos or extra spaces
- Verify region-specific endpoints if using them
- Confirm API key and secret are correct
- Check that credentials are properly formatted
- Verify authentication method matches your configuration
- Ensure outbound calling is enabled in Vonage account
- Verify you have sufficient account balance
- Check geographic permissions for destination country
One-Way Audio Issues
Check Media Settings:- Verify both sides support the same codecs
- Ensure firewall allows RTP traffic on required ports
- Check NAT/firewall traversal settings
- If using SRTP, ensure it’s configured on both ends
- Try disabling SRTP to isolate the issue
- Verify encryption keys match if using SRTP
- Check that common codecs are enabled (G.711, Opus)
- Review codec negotiation in call logs
- Ensure codec preferences match on both sides
Call Quality Problems
Network Issues:- Check network latency and bandwidth
- Verify packet loss is minimal
- Test from different network locations
- Use Opus for better quality when available
- Ensure G.711 is available as fallback
- Adjust codec priorities in application settings
- Use region-specific SIP endpoints when available
- Route calls through closest Vonage edge servers
- Monitor call quality metrics in Vonage analytics
Authentication Errors
“401 Unauthorized” errors:- Verify API key and secret are correct
- Check that credentials haven’t expired
- Ensure authentication method is properly configured
- Verify JWT token is properly signed
- Check token expiration time
- Ensure private key is correct
Advanced Configuration
Webhook Event Handling
Set up webhooks to receive call events:- Configure Event URL in your application
- Set up an endpoint to receive webhook notifications
- Handle events such as:
- Call started
- Call answered
- Call completed
- Recording available
- Use events to trigger custom business logic
Call Recording
Enable call recording in Vonage:- In your NCCO, add a record action:
- Receive recording URL via webhook
- Download and store recordings as needed
Conversation API Integration
For advanced features, integrate with Vonage Conversation API:- Create conversations for each call
- Enable multi-party calls
- Add text messaging capabilities
- Store conversation history
Call Screening & Routing
Implement intelligent call routing:- Set up answer webhook with custom logic
- Screen calls based on:
- Caller ID
- Time of day
- Call volume
- Geographic location
- Route calls dynamically to appropriate agents
- Implement IVR menu options if needed
Number Masking
Protect privacy with number masking:- Purchase virtual numbers for masking
- Configure proxy numbers in your application
- Route calls through proxy numbers
- Hide actual numbers from both parties
Monitoring & Analytics
View Call Analytics
Monitor your calls in Vonage dashboard:- Navigate to Reports → Analytics
- View metrics such as:
- Total calls
- Call duration
- Success rate
- Geographic distribution
- Export data for further analysis
Real-Time Monitoring
Track active calls:- Go to Reports → Real-time calls
- View currently active calls
- Monitor call status and quality
- Check for any issues or errors
Set Up Alerts
Configure notifications for important events:- Navigate to Settings → Notifications
- Enable alerts for:
- Failed calls
- Low balance warnings
- High error rates
- Unusual activity
- Choose notification methods (email, SMS, webhook)
Cost Considerations
When using Vonage with Smallest AI: Vonage charges:- Monthly number rental fees (varies by country)
- Per-minute inbound call costs
- Per-minute outbound call costs (varies by destination)
- Optional features (recording, CNAM, etc.)
- Standard per-minute call rates for AI conversation
- No additional fees for SIP trunk configuration
- No monthly rental fees for imported numbers
Best Practices
- Use JWT authentication for production environments for better security
- Implement webhook handlers to track call events and status
- Monitor call quality metrics regularly in Vonage analytics
- Set up proper error handling in your answer URL logic
- Use region-specific endpoints when available for better latency
- Keep credentials secure and rotate them periodically
- Test failover scenarios to ensure reliability
- Implement rate limiting to prevent abuse
Need Help?
If you encounter issues not covered in this guide:- Email Support: support@smallest.ai
- Include in your message:
- Your Vonage phone number
- Your application ID
- Description of the issue
- Any error messages from call events
- Join our Community: Discord
- Vonage Support: For Vonage-specific issues, contact Vonage Support
Related Documentation
- SIP Trunking Overview - General SIP trunking concepts
- Phone Numbers - Managing phone numbers on Smallest AI
- Vonage Voice API Docs - Official Vonage documentation
- Vonage NCCO Reference - NCCO action reference