This project demonstrates the integration of Eleven Labs Conversational AI with Twilio to enable seamless real-time interactions during outbound and inbound phone calls. The system leverages WebSockets for media streaming and integrates Eleven Labs' advanced conversational AI capabilities for human-like interactions.
- Outbound Call Integration: Programmatically initiate outbound calls using Twilio’s API.
- Real-Time Media Streaming: Connect calls to Eleven Labs via WebSockets for audio input and output.
- AI-Powered Conversations: Use Eleven Labs Conversational AI to create dynamic, human-like dialogues.
- Simple API Setup: Easily configure and deploy the project for real-time call control and monitoring.
Follow these steps to set up and run the project:
git clone https://github.com/esplanadeai/11labs_Outbound.gitcd 11labs_Outboundnpm installCreate a .env file in the root directory and populate it with your credentials:
ELEVENLABS_AGENT_ID=your-eleven-labs-agent-id;
TWILIO_ACCOUNT_SID=your-twilio-account-sid;
TWILIO_AUTH_TOKEN=your-twilio-auth-token;
TWILIO_PHONE_NUMBER=your-twilio-phone-number;
PORT=8000
node index.jsExpose your local server to the internet using Ngrok. Run the following command in a new terminal:
ngrok http 8000For Outbound Calls: Send a POST request to the /make-outbound-call endpoint with the recipient’s phone number:
curl -X POST http://localhost:8000/make-outbound-call \
-H "Content-Type: application/json" \
-d '{"to": "+1234567890"}'