Use BuildBindSdk.
Builds the per-session SDK binding that wires the REAL Twilio bindings (REST client + the per-call media registry) onto the telephony driver — overriding the package's default unbound SDK. The SDK is wrapped so the tracker learns of every call end (releasing the max-duration timer).
Cancels every timer and drops tracked state (server shutdown).
Handles Twilio's async answering-machine verdict. A machine or fax hangs the call up unless
onMachine is 'continue' (then the verdict is only logged). human/unknown verdicts are ignored.
Admits an INBOUND call: resolves the dialed DID to a pinned agent, registers the call + its media-socket
token, and starts the bridge session in the background. Returns as soon as the call is admitted so
the voice webhook can answer inside Twilio's short timeout; the Media-Streams socket (and any audio the
caller speaks) is buffered until the session is ready. Returns { accepted:false } (never throws) when
no agent identity matches the DID, so the webhook can answer with a polite "no agent" message.
Handles a Twilio status-callback event. A terminal status (busy, no-answer, failed, canceled,
completed) ends the call's bridge session — an unanswered outbound call never opens a media socket, so
without this the session would linger. Non-terminal statuses are ignored.
Places an OUTBOUND call from a given agent identity to a destination number, after the shared outbound
gate (agent permission, destination policy, rate limit) has authorized it. The bound
RealTwilioBindings.createCall issues the Twilio REST POST /Calls with the <Connect><Stream> TwiML;
the returned Call SID is the bridge's external connection id.
The placed Call SID.
Starts Twilio bridge sessions. One instance per server, constructed alongside the telephony router and sharing the TwilioCallMediaRegistry with the Media-Streams WSS server.