Overview
Before you start
- A Twilio account with Elastic SIP Trunking enabled.
- One or more Twilio numbers with voice capability.
- Read SIP trunk setup for what each Callers setting does.
Step 1: Create the trunk in Twilio
1
Create a trunk
In the Twilio Console, go to Elastic SIP Trunking → Trunks and create a trunk, for example “Callers”.
2
Configure termination (outbound)
Under Termination, choose a Termination SIP URI, for example
callers-acme.pstn.twilio.com. Under Authentication, create a Credential List with a username and password. You’ll enter the same credentials in Callers.3
Configure origination (inbound)
Under Origination, add an Origination URI:
4
Assign numbers
Under Numbers, add the Twilio numbers that should use this trunk. Their calls now go through the trunk instead of a webhook or TwiML app.
Step 2: Create the SIP connection in Callers
Go to App Center → SIP Integration → + and fill in:
Then set up the gateways:
Click Next and add your trunk numbers in E.164 format.
Step 3: Test
- Open the SIP connection and click Test SIP. Choose a trunk number in Call from and your mobile in Call to. A 200 result means Twilio accepted the call. See Test your connection for other codes.
- Assign a number to an incoming agent and call it to test inbound.
- Check Monitor → Logs → Calls and Voice Insights in the Twilio Console for any failed calls.
Twilio Flex
If you use Twilio Flex, connect Callers through an Elastic SIP Trunk as above, and route calls between Flex and Callers over SIP:- Callers → Flex: transfer from the agent to a SIP URI or number that your Flex Studio flow handles. Contact variables travel as SIP headers when Send SIP Headers is on in the agent settings, so Flex can use them for routing.
- Flex → Callers: send calls to a Callers number on the trunk.
Good to know
- Regions: Twilio processes trunk calls in the region of the edge they use. Use the region closest to your callers for lower latency.
- Number format: send and store numbers in E.164.
- Geographic permissions: enable destination countries in Elastic SIP Trunking → Settings → Geographic Permissions.
Troubleshooting
Test SIP returns 401 or 403
Test SIP returns 401 or 403
Check that the Callers Auth username and Password match the credential list attached to the trunk’s termination, and that the destination country is allowed in geographic permissions.
Inbound calls don't reach Callers
Inbound calls don't reach Callers
Check that the number is assigned to the trunk, the Origination URI is
sip:sip.callers.ai, and Twilio’s signaling IP ranges are added as Incoming gateways.Calls drop or have no audio
Calls drop or have no audio
Review the call in Twilio Voice Insights and download the PCAP from the Callers call view. Share both with support.
Related
SIP trunk setup
Reference for every SIP setting.
Twilio
The simpler Account SID connection.
Telephony overview
Compare connection options.
Call transfers
Transfer calls to Flex or a PBX.