Twilio
Integration
Overview
Connect your Twilio account to enable AutoCall to make outgoing and receive incoming calls seamlessly. This integration connects your Twilio phone numbers and SIP trunks to our platform.
1. Get Twilio Credentials
Log in to your Twilio Console. From the main dashboard, locate your Account SID and Auth Token.
Copy these credentials as you will need them to connect AutoCall to Twilio.
2. Buy a Phone Number
Navigate to Phone Numbers > Manage > Buy a number in the Twilio sidebar. Search for a number with voice capabilities and purchase it.
3. Setup Outgoing Calls (SIP Trunking)
To make outbound calls, you need to configure a SIP trunk.
- Go to Voice > Manage > SIP Domains and click Create new SIP Trunk.
- Provide a name for the trunk and configure the Origination URI with the IP address of your AutoCall server.
- Configure Termination by setting a unique Termination SIP URI.
4. Setup Incoming Calls (Webhook)
To receive incoming calls, route your Twilio number to AutoCall via a Webhook.
- Go to Phone Numbers > Manage > Active numbers and select your purchased number.
- Scroll down to the Voice & Fax section.
- Under A CALL COMES IN, select Webhook and
enter your AutoCall incoming webhook URL. Example:
https://yourdomain.com/api/twilio/incoming.
5. Get API Key and Secret (For Human Transfer)
To enable the human transfer feature, you need a Twilio API Key and
Secret (TWILIO_API_KEY and TWILIO_API_SECRET).
- Go to Account > API keys & tokens in the Twilio console.
- Click on Create API key.
- Provide a friendly name for the key and choose Standard as the key type.
- Click Create API Key. Copy the SID (this is your API Key) and the Secret securely.
6. Get TwiML App SID (For Human Transfer)
Along with the API Key and Secret, the human transfer feature also
requires a TwiML App SID (TWILIO_APP_SID).
- Navigate to Voice > Manage > TwiML Apps and click Create new TwiML App.
- Enter a Friendly Name for your app.
- Under the Voice section, enter your AutoCall Webhook URL in the Request URL field.
- Click Create and copy the TwiML App SID.
7. Configure Environment Variables
Once you have gathered all the necessary Twilio credentials, you need to store them securely in your application's environment configuration file.
- Open the
.envfile in the root directory of your backend project. - Locate the Twilio configuration variables and paste the values you just copied:
TWILIO_API_KEY=your_api_key_sid_here
TWILIO_API_SECRET=your_api_secret_here
TWILIO_APP_SID=your_twiml_app_sid_here
Save the file and restart your backend server to apply the changes.
What's Next?
Let's get started — your journey with AutoCall begins here!