Connect Exotel SIP trunking to NLPearl.AI
This guide connects Exotel SIP trunking to 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 | Custom VoIP integration — inbound SIP Domain shown after save; outbound requires SIP Trunk URL + User Part + optional auth |
Getting started | Getting started |
Outbound API | Outbound/API and Make Call API request |
Variables / callData | 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 (Custom VoIP docs):
- 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.
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:[email protected] · 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.
B2. Inbound routing: set destination URI toward NLPearl SIP Domain
Once NLPearl gives you a SIP Domain, set it as the trunk destination URI:
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: Make Call API request.
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 |