Programmable Voice APIs
Dialer Implementation Guide
12 min
objective this document provides a detailed, implementation ready plan for building a scalable, real time predictive dialer using exotel’s programmable legs and bridge apis it is designed to help customers maximise engage leads at scale, maximize agent productivity, reduce wait time, and ensure precision in call flow orchestration using exotel as a programmable telephony layer approach summary the customer's leg is dialed first using exophones call events are streamed in real time via grpc to detect pickup and leg status upon confirmation of pickup, an ideal agent is dynamically selected and dialled the agent leg can also be pre dialled and held live using our nailed up connection a waiting message (ivr) can be played to the customer until the agent is bridged once both legs are active, a bridge is created to establish a conversation calls can be recorded; all call metadata is accessible through the api and events retry logic, timeouts, and crm disposition updates are managed by the customer step by step implementation using exotel legs apis step 1 lead selection and dial planning customer’s backend dialer logic should dynamically determine whom to dial and when, using real time agent availability crm driven lead prioritization historical lead pickup trends and sla commitments responsibility customer is responsible for implementing this logic and using exotel apis to programmatically control all legs and session cycles step 2 initiate customer leg api post /legs use an exophone did as the caller id set network type to pstn attach a leg event endpoint (grpc) for real time event tracking set timeout and time limit to define ringing and call duration expected events leg ringing, leg answered, leg terminated, step 3 handle customer leg events when the following is received leg answered then optionally play a message using startsay or startplay (e g , “please hold…”) continue monitoring until agent leg is ready ensure ivr playback is stopped once the bridge is established step 4a dial agent leg on demand api post /legs trigger agent leg only after the customer leg is answered use the same exophone did attach leg event endpoint to track agent leg events important use reference leg sid (customer leg sid) if your use case involves connecting to the pre defined agent if you are allocating an agent dynamically on availability basis you can ignore this step { "contact uri" "+91xxxxxxxxxx", "exophone" "080xxxxxxx", "reference leg sid" "2mf7xxxxxx", "custom param" { "session id" "sess 12345" } } expected events leg ringing, leg answered, leg terminated step 4b (optional) pre dial agent leg create the agent leg before the customer leg , with a high time limit (e g , 1800 seconds) optionally play a hold tone or message using startsay use get /legs/{agent leg sid} to poll for leg status (status = answered) once the customer answers, bridge them immediately with the pre connected agent leg this reduces latency and is useful when predictive decisions are made in advance step 5 create bridge between legs api post /bridges use both leg sids (agent and customer) to create a bridge attach bridge event endpoint to track bridge created, bridge terminated, and other events stop any active ivr playback on either leg before the bridge is initiated step 6 enable call recording (optional) api post /bridges/{bridge sid}/actions initiate recording at the bridge level exotel will emit recording available events with urls, metadata, and recording durations step 7 post call analytics and crm sync using events api get /legs/{leg sid} retrieve call duration termination reason recording links push this data to the customer’s crm for lead status updates retry and follow up logic best practices and implementation considerations area recommendation event delivery use grpc endpoints for low latency, ordered event streams bridging consistency use reference leg sid to ensure connecting to a pre defined agent with low latency ivr playback handling use startsay or startplay after customer leg is answered; stop playback once the bridge is created exophone support fully supported for outbound pstn legs; use as per your compliance and pickup rate needs leg identifiers use leg sid as the unique reference for all api interactions; exotel does not use a unified callsid model retry handling monitor leg failed to create, leg terminated session tracking use custom param session id consistently across legs and bridges for traceability leg status polling use get /legs/{leg sid} to validate leg state (initiated, ringing, answered, terminated) when needed conclusion using exotel’s legs and bridge apis, customer can deploy a powerful, scalable predictive dialer that supports fully api driven orchestration of customer agent calling real time control using grpc event streams flexible leg creation with ivr, amd, and pre connection support clean session tracking and crm sync using custom param future readiness with nailed up connections and intelligent retry apis this design ensures operational efficiency, lead quality, and agent productivity—all while maintaining full control through exotel's programmable voice stack please drop an email to hello\@exotel com or reach out to your account manager if you'd like support with sandbox setup, grpc streaming samples, or reference flows to accelerate your implementation
🤔
Have a question?
Our 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.