Voice AI Ecosystem
Connect Exotel SIP trunking to NLPearl.AI
12 min
this guide connects exotel sip trunking to https //platform nlpearl ai/ using nlpearl’s custom voip feature, where exotel is the sip carrier behind nlpearl (nlpearl’s portal drives the ai agent; exotel provides the pstn did and sip trunk) github repo (reference) https //github com/exotel/agentstream voiceaiecosystem applicability ui driven + api driven (custom voip configuration in nlpearl portal; optional outbound via api) edge hostnames you may see (india) in voip exotel com 5070 (tcp) and in voip exotel com 443 (tls) use the exact host/ip + port + transport exotel assigns see exotel trunk api snippets md nlpearl (from official docs) topic detail custom voip https //developers nlpearl ai/pages/custom voip — inbound sip domain shown after save; outbound requires sip trunk url + user part + optional auth getting started getting started outbound api https //developers nlpearl ai/pages/outbound api /api and https //developers nlpearl ai/api reference/v1/outbound/make call variables / calldata https //developers nlpearl ai/pages/variables — calldata used in make call / lead apis flows (what you configure) direction what to configure outbound (nlpearl → exotel → pstn) exotel trunk + did + digest credentials nlpearl custom voip outbound with sip trunk url (exotel trunk domain) + user part + optional credentials auth inbound (pstn → exotel → nlpearl) nlpearl custom voip inbound (choose ip auth or credentials) → save to get a sip domain exotel set trunk destination uris to that nlpearl sip domain (plus transport/port) exotel flow connect using sip \<trunk sid> important outbound does not need destination uris inbound does part a — nlpearl portal (custom voip) a1 prepare the ai agent create and publish your agent (pearl) in platform nlpearl ai ensure the agent supports your required language/flow and is ready for inbound/outbound usage a2 add custom voip phone number open settings → phone numbers click custom voip enter your exotel did in e 164 (display/reference) choose call direction inbound, outbound, or both a3 configure outbound (exotel as sip trunk) in the outbound configuration section ( https //developers nlpearl ai/pages/custom voip ) tls (srtp) encryption enable only if you will use sip tls to exotel and exotel confirms tls/srtp requirements for your account sip trunk url set to exotel trunk sip domain sip ${account sid} pstn exotel com (recommended form), or ${account sid} pstn exotel com if nlpearl ui expects host only user part use one of your exotel trunk digest username , or your did in e 164 (if you want the sip from user to mirror the did) authentication methods (credentials authentication) if enabled, set the same username/password as exotel post /credentials data center pick the closest region to exotel’s sip edge for latency transfer call using sip refer keep off initially turn it on only after you confirm exotel supports/accepts refer behavior for your trunk a4 configure inbound (nlpearl receives from exotel) in the inbound configuration section (custom voip docs) tls (srtp) encryption enable only if you will use tls/srtp and exotel confirms authentication credentials authentication recommended when you don’t have stable ips and want strict auth ip address authentication only if exotel provides the fixed ips nlpearl should accept traffic from after saving inbound settings, nlpearl shows a sip domain to connect you will copy that domain into exotel destination uris (part b) part b — exotel apis auth api key\ api token\@api in exotel com · 200 requests/minute (sip trunk apis) · exotel trunk api snippets md b1 create trunk + map did + set digest credentials (outbound prerequisite) use the shared snippets create trunk map phone number (did) post /credentials for nlpearl outbound , these digest credentials should match what you configure in nlpearl’s outbound auth section docid\ jq98jrrnxtzaudyogodmz b2 inbound routing set destination uri toward nlpearl sip domain once nlpearl gives you a sip domain , set it as the trunk destination uri curl s x put "https //${api key} ${api token}@${subdomain}/v2/accounts/${account sid}/trunks/${trunk sid}/destination uris" \\ h "content type application/json" \\ d '{ "destinations" \[ { "destination" "your nlpearl sip domain 5061;transport=tls" } ] }' notes use the exact domain nlpearl shows after saving inbound config align port + transport with how you configured nlpearl (tls vs tcp) if you’re unsure, start with what exotel supports for your sip trunking and what nlpearl’s custom voip expects b3 exotel flow connect applet in your exotel flow, use applet connect dial whom sip \<trunk sid> (trunk sid is the value returned by create trunk; it is not a sip uri ) tests (quick) outbound (nlpearl → pstn) in nlpearl, create/assign an outbound activity using the custom voip number trigger a test call from the ui and confirm exotel sees sip invites on the trunk if using api driven outbound, use the make call endpoint per docs https //developers nlpearl ai/api reference/v1/outbound/make call inbound (pstn → nlpearl) call the exotel did from a mobile phone verify exotel routes to trunk (flow connect sip \<trunk sid>) and then to the trunk destination uris (nlpearl sip domain) confirm nlpearl receives the call and the assigned agent answers troubleshooting symptom likely cause fix 401/403 on outbound sip digest mismatch ensure nlpearl outbound credentials match exotel post /credentials exactly inbound reaches exotel but not nlpearl missing/wrong destination uris paste nlpearl sip domain exactly; confirm port/transport; re get destination uris tls failures tls/srtp toggles mismatched keep tls/srtp off on both sides for first smoke test unless exotel confirms required tls/srtp; then enable consistently confusing auth failures after enabling allowlist acl + digest interaction remove whitelisted ips unless you have dedicated /32 static ip requirements; rely on digest and coordinate with exotel
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.
