Inbound call flow

When a call arrives for an assigned phone number, Alianza places a SIP call to your endpoint. From Alianza's side the flow is the same whatever platform your endpoint runs on:

  1. A caller dials the assigned phone number. Alianza receives the call.
  2. Alianza answers the caller and plays a consent announcement.
  3. Alianza sends an INVITE to your SIP endpoint over TLS, with an SRTP offer and the Alianza headers.
  4. Your endpoint challenges with 401 Unauthorized or 407 Proxy Authentication Required. Alianza re-sends the INVITE with digest credentials.
  5. Your endpoint answers with 200 OK, and SRTP media flows between the caller and your endpoint through Alianza.
  6. Either side ends the call with a BYE, which Alianza propagates to the other side.

Because Alianza has already answered the caller at step 2, your endpoint's 180 Ringing and 200 OK are not passed to the caller. The caller hears the consent announcement before your agent, so your agent's greeting comes after it.

Everything that happens behind your SIP endpoint, such as how your agent receives audio or learns that a call has started or ended, is between you and your platform. Alianza does not see it and does not require any particular mechanism.

Headers to capture

Header Why it matters
X-Alianza-Correlator-Id Unique per-call identifier from Alianza. Log it: it is the value Alianza support will ask for when tracing a specific call. You do not need it to transfer: transfers use an in-dialog REFER, which Alianza correlates from the dialog itself.
X-Alianza-Experience-Id Sent on every call: the ID of the Experience the call was routed for. Use it to tell Experiences apart if you host several behind one endpoint.

Number formats for the Request-URI and caller ID are on the SIP interface page.

Platform examples

Two common ways to build a Virtual Agent behind the SIP interface are shown below. They differ only in what sits behind your endpoint. Alianza's side of the call is identical in both.

Direct SIP to a voice AI platform Through a CPaaS (Twilio)
SIP endpoint Alianza calls The voice AI platform Twilio
How your agent gets the call Natively, inside the platform Twilio webhook → TwiML → WebSocket media stream
Hops for media Caller → Alianza → platform Caller → Alianza → Twilio → your agent
Good fit when Your agent is built on a platform that accepts SIP Your agent is your own code, or you already run on Twilio

Example: direct SIP to a voice AI platform

If your agent runs on a platform that accepts SIP, Alianza calls the platform directly with nothing in between. Configure the platform's inbound SIP to match the SIP interface contract:

  • Transport: TLS, port 5061 unless agreed otherwise.
  • Media: SRTP.
  • Authentication: digest, with the username and password agreed with Alianza during onboarding.
  • Number: the assigned number without a leading + (for example 13855467129), so that it matches the Request-URI Alianza sends.
  • Source IPs: allowlist Alianza's addresses, if your platform supports it.

Set the SIP endpoint in your Experience Connection to the platform's SIP host, then place a test call to the assigned number. The agent answers directly.

Direct SIP inbound delivery has been verified on two platforms so far — see Verified platforms on the SIP interface page. Before you go live on another, and especially if your agent uses Transfer to business, ask your Alianza onboarding contact for a test call on your platform.

Example: Twilio

Alianza calls Twilio as your SIP endpoint, and Twilio hands the call to your agent through its own APIs. Steps 2–3 below are Twilio-specific and happen between Twilio and your agent, not with Alianza.

  1. Alianza sends the INVITE to your Twilio SIP host over TLS. Twilio challenges and Alianza re-sends with digest credentials.
  2. Twilio calls your agent's voice webhook. Your agent responds with TwiML that answers the call and opens a media stream.
  3. Your agent receives and sends audio over the Twilio WebSocket media stream.
  4. When either side hangs up, the BYE passes between Alianza and Twilio, and Twilio sends a status callback to your agent.

In Twilio, configure the inbound number in the same no-+ format, or normalise it in your webhook handler.

Failure modes

  • If no target for your endpoint answers, the call fails. There is no fallback re-routing to the business. See Failure behaviour.
  • If your endpoint returns a non-2xx final response, the call is rejected and the caller hears a treatment from the upstream switch.