Connecting a Twilio Number
Twilio can deliver a number's calls two ways, and which one you use is your choice rather than a fixed property of the number. An existing number can be associated with an Elastic SIP Trunk whenever you like, and disassociated again later — moving a number onto a trunk does not release it from your account.
We suggest the trunk, because it needs no code. Use the TwiML route if you would rather leave the number on Programmable Voice, or you already run a voice webhook you want to keep.
Over an Elastic SIP Trunk (recommended)
Twilio hands trunk calls straight to your SIP infrastructure. It does not send a username and password with them — it expects the far end to recognise Twilio by the addresses the calls arrive from — so connect the number here with Fixed IP addresses rather than credentials.
- In Abacus.AI, connect the number and choose Fixed IP addresses. Enter the signalling IP addresses Twilio publishes for your region.
- In the Twilio Console open Elastic SIP Trunking → Trunks and either pick your trunk or create one.
- Open Origination and add an Origination SIP URI of
sip:sip-trunk.abacus.ai:5080. Twilio fills in the user part of the address from the number that was dialled, so you do not put the number in the URI yourself. - Open Numbers and choose Associate an existing Twilio number with this trunk to move your number onto it.
Twilio publishes its signalling addresses per edge location, and they differ by region. Take them from Twilio's own documentation for the edge your trunk uses rather than guessing, and add every address for that edge — a call arriving from an address you did not list is rejected.
With TwiML, keeping the number on Programmable Voice
Twilio asks your webhook what to do with each call, so you answer with TwiML that dials our SIP address. This path does carry a username and password, so connect the number here with Username & password, the default.
- In the Twilio Console open Phone Numbers → Manage → Active numbers and click your number.
- Under Voice Configuration, point A call comes in at TwiML that returns the block below. If you already run a voice webhook, return it from there; if you do not, a TwiML Bin hosts it for you with no server.
- Fill in the three placeholders from the SIP connection details shown when you connected the number.
<Response>
<Dial>
<Sip username="YOUR_SIP_USERNAME" password="YOUR_SIP_PASSWORD">sip:YOUR_NUMBER@sip.abacus.ai</Sip>
</Dial>
</Response>
YOUR_NUMBER is your number with the plus sign and country code, such as +14155550123, which makes the whole sip: line identical to the Route your number to value we show you.
- Save, then save the number.
If calls do not arrive
- On a trunk, the usual cause is a signalling address that is not on your allowlist. Check Twilio's current list for your edge against what you entered.
- On Programmable Voice, open Monitor → Logs → Calls in the Console and look at the call. Twilio records why it could not reach the SIP address there, which is more specific than anything the caller hears.