Twilio setup
Stellar integrates directly with Twilio to handle inbound voice calls with your AI agents. Twilio forwards calls to Stellar via a TwiML webhook, and Stellar streams audio in real time to power the conversation.
Prerequisitesโ
Twilioโ
- Twilio account with voice capabilities
- One or more Twilio phone numbers
- Admin access to the Twilio console
Stellarโ
- Agent configured and tested in Studio
- Per-environment configuration set up (secrets, variables, auth connectors)
Setupโ
Step 1: Create a phone connector in Studioโ
- Navigate to Phone connectors in Studio
- Click Add connector
- Select Twilio as the type
- Choose which agent should handle calls
- Select the environment (Development, Staging, or Production)
- Choose the version mode:
- Published: Always uses the latest published version
- Draft: Uses the current draft version
- Pinned: Uses a specific agent version
- Save the connector
The connector generates a webhook URL in the format:
https://platform.stellarcs.ai/v1/agents/{connector-identifier}/twilio-config
Step 2: Configure Twilioโ
- Log in to the Twilio Console
- Navigate to Phone Numbers > Manage > Active Numbers
- Select the phone number to integrate
- Scroll to Voice Configuration
- Under A Call Comes In, select Webhook
- Enter the webhook URL from your Stellar connector
- Select HTTP GET as the method
- Click Save
To route multiple phone numbers, configure each number's webhook to point to the same connector, or create separate connectors for different agents, environments, or versions.
Step 3: Test the integrationโ
- Call your Twilio number
- Verify the AI agent answers
- Test the conversation flow and actions
- Trigger a handover and verify it completes
- Check that recordings and transcripts appear in Studio
Step 4: Go liveโ
- Monitor the first production calls closely
- Use listen & intervene if needed
- Gradually increase call volume
Handover configurationโ
Twilio handovers transfer calls to phone numbers:
- Go to your agent's Actions tab in Studio
- Create an action of type Handover
- Select handover type: Phone
- Enter the destination phone number with country code (e.g.,
+31201234567)
You can create multiple handover actions for different destinations (e.g., transfer_to_sales, transfer_to_support). The agent chooses the appropriate handover based on the conversation.
Twilio Studio integrationโ
You can use Twilio Studio for initial call routing before handing off to Stellar:
- Build an IVR flow in Twilio Studio (e.g., "Press 1 for sales, 2 for support")
- Route the selected option to the Stellar webhook URL
- Stellar's AI agent handles the conversation from there
Troubleshootingโ
Calls not reaching Stellarโ
- Verify the webhook URL is correct in the Twilio console
- Confirm the URL uses HTTPS and the method is HTTP POST
- Check that the phone number is active in Twilio
- Review error logs in the Twilio console
Audio quality issuesโ
- Check network connectivity and bandwidth
- Review Twilio's call quality metrics in the console
- Contact Stellar support for diagnostics
Handover not workingโ
- Verify the destination phone number format (include country code)
- Confirm the destination number can receive calls
- Check that outbound calling is enabled on your Twilio account
- Test calling the handover number directly