Bridge APIs - Introduction
14 min
a bridge represents a multi party audio conference that allows multiple legs to be connected together bridges are commonly used for conferencing , agent handoffs , supervisor monitoring , and multi leg call flows bridge apis allow you to create a bridge retrieve bridge details update bridge configuration dynamically join or remove legs using leg actions key concepts a bridge exists independently of legs a bridge becomes active when at least one leg joins legs are added or removed using \<joinbridge> \<leavebridge> bridge state changes are emitted as external events base url https //cpaas api in exotel com/v2/accounts/ https //cpaas api in exotel com/v2/accounts/{accountsid} authentication use basic authentication authorization basic \<base64 apikey apitoken> content type application/json api credentials can be found in my exotel com → developer settings related apis post /bridges — create a bridge get /bridges/ — get bridge details put /bridges/ — update bridge configuration leg actions — joinbridge / leavebridge notes for developers bridge updates apply only to future participants active legs are not dropped when updating bridge configuration use joinbridge / leavebridge leg actions to manage participants dialer implementation guide using exotel legs apis this guide shows you how to build an end to end predictive dialer on top of the legs and bridge apis described above 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 you 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 you step by step implementation using exotel legs apis step 1 lead selection and dial planning your 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 you are 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 your crm for lead status updates retry and follow up logic agent performance scoring 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, you 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 mailto\ 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 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.
