sts-twilio is a server which enables calls made to your Twilio phone number to pass through to Deepgram's Voice Agent API, enabling the caller to talk to a voice agent/bot.
See the following Guide in our Documentation for more information.
You will need:
- A Twilio account with an active Twilio number (the free tier will work).
- A Deepgram API Key - get an API Key here.
- (Optional) ngrok to let Twilio access a local server.
- A valid
TwiML Bin
Configuration in your Twilio Console like the following:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say language="en">"This call may be monitored or recorded."</Say>
<Connect>
<Stream url="wss://a127-75-172-116-97.ngrok-free.app/twilio" />
</Connect>
</Response>
You should replace the url with wherever you decide to deploy sts-twilio. In the Guide in our Documentation we use ngrok to expose the server running locally and this is the recommended way for quick development.
This TwiML Bin
must also be connected to one of your Twilio phone numbers so that it gets executed whenever someone calls that number.
Install requirements:
pip install -r requirements.txt
If your TwiML Bin is setup correctly, you should be able to just run the server with:
pip install -r requirements.txt
If your TwiML Bin is setup correctly, you should be able to just run the server with:
python server.py
and then start making calls to the phone number the TwiML Bin is attached to!
For a guided tour of the code, see the following Guide in our Documentation.