Voice AI Ecosystem
Exotel SIP trunk API Reference for Voice AI Ecosystem
10 min
use these snippets from the support articles for elevenlabs , livekit , retell , bolna , pipecat (via daily sip) , smallest ai (atoms) , vocallabs , rapida ai , and nlpearl ai integrations replace placeholders; do not commit real secrets github repo (reference) https //github com/exotel/agentstream voiceaiecosystem placeholder description account creation https //my in exotel com api key exotel api key https //my in exotel com/apisettings/site#api credentials ) api token exotel api token account sid exotel account sid subdomain api in exotel com (india) or api exotel com (singapore) trunk sid returned when you create a trunk (trunk sid in response) authentication http basic — https //api key\ api token\@subdomain/ trunk api rate limit 200 requests per minute on these trunk configuration apis (exotel sip api reference) outbound call rate (default) exotel typically allows 200 outbound call attempts per minute by default (account level) if you need a higher outbound initiation limit, contact your csm where to get api credentials api settings (india) (or your cluster dashboard) headers content type application/json on post/put exotel edge ip and port exotel documents sip signaling toward their gateway using edge ip addresses and ports — for example tls on port 443 or tcp on port 5070 — per exotel network and firewall use the ip\ port (and transport) exotel gives you in onboarding or support exotel may also share edge hostnames (instead of raw ips) common india examples you may see are tcp in voip exotel com 5070 tls in voip exotel com 443 use the exact host/ip + port + transport exotel assigns to your account/cluster if a provider ui requires an ipv4 literal (no hostname), resolve the hostname to the ipv4 exotel intends you to use (or request the explicit edge ips from exotel support) the domain name field in create trunk is exotel’s account sip domain for the trunk record ({account sid} pstn exotel com) that is separate from the edge ip\ port your voice ai platform uses to send sip to exotel outbound trunk vs inbound sip trunk flow exotel api steps outbound sip (voice ai → exotel → pstn) 1 create trunk → 2 map did → 3 post /credentials (digest) optional post /whitelisted ips only if the voice ai provider gives you a fixed static egress ip to allow — see below do not use destination uri for this path unless exotel instructs you otherwise inbound sip (pstn → exotel → voice ai) after trunk + did, map destination uri on the trunk to the partner’s sip host/port/transport use flow → connect with sip \<trunk sid> in dial whom (see support articles) trunk acl (whitelisted ips) exotel trunk acl is for static ip allowlisting from your voice ai provider when they give you a single fixed egress ip exotel does not support cidr range whitelist on the trunk — use one ip per post with mask 32 if the provider only offers non static or range based egress, use digest credentials and coordinate with exotel on what is supported trunk acl (whitelisted ips) exotel trunk acl is for static ip allowlisting from your voice ai provider when they give you a single fixed egress ip exotel does not support cidr range whitelist on the trunk — use one ip per post with mask 32 if the provider only offers non static or range based egress, use digest credentials and coordinate with exotel on what is supported important (auth precedence) avoid mixing ip allowlisting and digest auth unless exotel support has confirmed the expected behavior for your account in some sip deployments, once an ip allowlist is enabled, the platform may treat source ip as the primary trust signal, and digest behavior can become confusing (especially if a provider publishes shared / multi tenant egress ranges) if your provider only publishes cidr ranges (no dedicated static /32 ips), do not attempt to “whitelist the range” on exotel — rely on digest and work with exotel/provider support for the correct model create trunk post /v2/accounts/{account sid}/trunks curl s x post "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks" \\ h "content type application/json" \\ d '{ "trunk name" "my trunk name", "nso code" "any any", "domain name" "'"${account sid}"' pstn exotel com" }' trunk name alphanumeric + underscores, max 16 characters map phone number (did) to trunk post /v2/accounts/{account sid}/trunks/{trunk sid}/phone numbers curl s x post "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}/phone numbers" \\ h "content type application/json" \\ d "{\\"phone number\\" \\"+9198xxxxxxxx\\"}" optional "mode" "flow" for streamkit/voice ai routing save the returned id for updates create sip digest credentials (outbound auth) post /v2/accounts/{account sid}/trunks/{trunk sid}/credentials use the same user name and password on the voice ai platform (elevenlabs sip digest, livekit authusername / authpassword, retell termination, etc ) curl s x post \\ "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}/credentials" \\ h "content type application/json" \\ d '{ "user name" "sip user", "password" "sip pass", "friendly name" "voice ai platform" }' whitelist ip (acl) — static provider ip only post /v2/accounts/{account sid}/trunks/{trunk sid}/whitelisted ips use only when your voice ai provider gives a single static egress ip you must allow repeat the call for each distinct static ip (no cidr ranges on trunk) curl s x post "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}/whitelisted ips" \\ h "content type application/json" \\ d '{"ip" "203 0 113 50", "mask" 32}' set destination uri (inbound sip — pstn toward voice ai partner) post /v2/accounts/{account sid}/trunks/{trunk sid}/destination uris used for inbound routing pstn → exotel → your sip partner (fqdn or host/port/transport per partner docs) not part of the minimal outbound sip setup curl s x post "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}/destination uris" \\ h "content type application/json" \\ d '{ "destinations" \[ { "destination" "partner example com 5061;transport=tls" } ] }' verify (get) curl s "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}" curl s "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}/phone numbers" curl s "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}/whitelisted ips" curl s "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}/destination uris"
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.
