Twilio
Connect your Twilio account to give your AI agent phone and SMS channels.
What is Twilio?
Twilio integration allows you to connect BotPenguin with Twilio's powerful voice and SMS communication platform. It enables data exchange between systems, allowing you to make and receive phone calls, send SMS messages, and automate customer communication workflows seamlessly. With Twilio, you can leverage SIP trunking for reliable voice connectivity and manage your phone numbers and billing all from one platform.
When should you use this?
Use this integration when:
You want to connect BotPenguin with Twilio's voice communication services
You need to enable outbound and inbound calling capabilities for your agents
You are trying to automate voice-based customer interactions and workflows
You need to manage multiple phone numbers across different regions
You want to handle compliance requirements for phone numbers in specific countries
Benefits of Twilio Integration
🔗 Enables seamless voice and SMS communication between BotPenguin and Twilio
⚡ Automates outbound and inbound call workflows with SIP trunking
🎯 Improves customer engagement through reliable voice connectivity
🔄 Ensures real-time call routing and configuration management
📈 Reduces communication setup complexity with integrated number management
Expected Outcome
After setting this up:
Your Twilio account will be successfully connected to BotPenguin
Data will flow between BotPenguin ↔ Twilio
You will be able to make and receive calls through your Twilio phone number
Your agents will have access to both inbound and outbound calling capabilities
🔐 Prerequisites
Before setting up this integration, ensure you have:
An active Twilio account (sign up at https://www.twilio.com/)
Completed the Twilio verification process with your account
Purchased at least one phone number from Twilio
Admin or Owner access to your Twilio account
Billing information added to your Twilio account (payment method on file)
Compliance verification completed for your country (required for phone numbers)
How to Use Twilio Integration
Phase 1: Set Up Your Twilio Account
Visit the Twilio website at https://www.twilio.com/ and sign up for a free Twilio account.
Complete the Twilio verification process to set up your account with your country information and required documentation.
Once verified, log into the Twilio Console at https://console.twilio.com.

Phase 2: Purchase a Phone Number
From your Twilio Console home page, navigate to "Phone Numbers" in the left sidebar.
Click on "Buy a Number" button to purchase a new phone number.

Filter the available numbers by:
Country: Select the country where you want the number
Capabilities: Select "Voice"

Select the phone number you want to purchase and click "Buy".

Configure the purchased number:
Set a Friendly Name (internal name for your reference)
Review the number configuration
Click "Buy this Number" to complete the purchase
Phase 3: Create an Elastic SIP Trunk
In the Twilio Console, navigate to "Elastic SIP Trunking" → "Manage" → "Trunks".
Click "Create new SIP Trunk" and give it a friendly name (e.g., "BotPenguin Trunk" or "LiveKit Trunk")
Click "Create" to create your new trunk. You will now configure both Origination (inbound) and Termination (outbound) on this single trunk.
Phase 4: Configure Origination (Inbound Calls)
Origination is how Twilio forwards incoming calls to your BotPenguin agent.
Inside your trunk, go to the "Origination" tab.
Click "Add New Origination URI" and enter the following as the SIP URI:
Set the following values:
Priority: 1
Weight: 1
Enabled: Make sure this is checked
Click "Save".
Attach Your Phone Number to the Trunk
Inside your trunk, go to the "Numbers" tab.
Click "Add an Existing Number" and select your Twilio phone number from the dropdown.
Click "Save".
Phase 5: Configure Termination (Outbound Calls)
Termination is how your BotPenguin agent sends outbound calls through Twilio. The values configured here will be used in the installation form.
Inside your trunk, go to the "Termination" tab.
Set a Termination SIP URI. Pick any unique subdomain, for example:
Click "Save".
Under "Authentication" → "Credential Lists", click the "+" icon to create a new credential list.
Create a Username and a strong Password inside that credential list.
Click "Save" to create the credential list.
Back on the trunk Termination tab, make sure the credential list you just created is attached under "Termination" → "Authentication" → "Credential Lists".
Click "Save" to finalize your Termination configuration.
Phase 6: Fill in the "Install Myself" Form
Now that your Elastic SIP Trunk is configured in Twilio, you'll connect it to BotPenguin using the installation form.
Go to the "Third Party Apps" section in BotPenguin from the left sidebar.
Locate "Twilio" and click "Connect".

Expand the "Install Myself" panel to access the installation form.
Fill in the form fields with the following information:
Country Code
Country code of your Twilio number (e.g., +1, +44)
Select from dropdown before Phone Number
Phone Number
Your Twilio phone number without country code
Twilio → Phone Numbers → Manage → Active Numbers
Termination URI
Your Twilio Termination SIP URI (e.g., yourname.pstn.twilio.com)
Twilio → Elastic SIP Trunking → Trunks → your trunk → Termination
Username
The username from your Credential List
Twilio → Elastic SIP Trunking → Credential Lists
Password
The password from your Credential List
Twilio → Elastic SIP Trunking → Credential Lists
Outbound Transport
TCP
Select from dropdown (default)

Click "Configure" to complete the installation. Installation can take up to 30 seconds.
💡 Tip: Keep your Twilio console open during this process to reference the correct values from your trunk and credential list configuration.
Phase 8: Test the Twilio Setup
After configuration completes, test both inbound and outbound calls to ensure everything is working correctly.
Inbound Call Test
From any phone, call your Twilio phone number.
Your BotPenguin agent should answer the call.
Outbound Call Test
In the BotPenguin agent dashboard, trigger an outbound call to your phone number.
Your phone should ring and you should be able to hear the agent speak.
If Something Fails
Check Twilio's call logs under Monitor → Logs → Calls for error details.
Check BotPenguin call logs for any connection errors
Verify that:
Your Termination SIP URI is correctly formatted (e.g., yourname.pstn.twilio.com)
Your username and password match your credential list exactly
Your phone number is attached to the correct Origination URI
All credentials are correctly entered in the BotPenguin form
💡 Common Issue: Make sure you entered the Termination URI without the
sip:prefix. The form should receive only the domain (e.g., yourname.pstn.twilio.com)
Best Practices
💡 Always test the integration with both inbound and outbound test calls before deploying to production.
⚠️ Store your SIP credentials and Auth Token securely and never share them in plain text communications.
🚀 Use clear, descriptive names for your inbound and outbound trunks to avoid confusion during troubleshooting.
🎯 Monitor Twilio logs regularly to identify and resolve connectivity or configuration issues early.
📋 Keep your billing information current and monitor your account balance to ensure uninterrupted service.
🔄 Ensure compliance documentation is kept up-to-date, as requirements may change by region.
Troubleshooting
FAQ's
Support
If you still have questions for our team, write to us at support@botpenguin.com. We'll get back to you within 48 hours.
🎉 Completion
🎉 Congratulations, you have successfully set up the Twilio integration! You can now enable your agents to make and receive calls, automate voice workflows, and enhance your customer communication capabilities with reliable voice connectivity through Twilio.
Last updated