- How inbound and outbound calls flow through Zero Runtime.
- Configuring a phone number with inbound + outbound gateways.
- Setting up routing rules.
- Initiating outbound calls via the API.
videosdk.live is expected here. Zero Runtime runs on VideoSDK’s real-time infrastructure, so its SIP, media, and API endpoints are served from the videosdk.live domain. Use the hostnames and URLs exactly as shown.Understanding Inbound Call Flow
- User Initiates Call: A user dials a phone number using their phone or SIP device.
- SIP Provider Receives Call: The call is received by your SIP provider (such as Twilio, Plivo, Telnyx, or Vonage).
- Forward to Zero Runtime: The SIP provider is configured to forward the call to your organization’s Zero Runtime SIP URI (e.g.,
orgId.sip.videosdk.live). - Inbound Gateway: The call reaches the Inbound Gateway in Zero Runtime, which acts as the entry point for all SIP traffic.
- Routing Rules: The Inbound Gateway applies your configured Routing Rules to determine how the call should be handled. Routing is decided based on the number.
- Zero Runtime Cloud: Based on the routing, the call is either:
- Connected to a User: The caller is connected into a Zero Runtime room with any other participants.
- Routed to an AI Agent: An AI agent is invoked into the same room.
Understanding Outbound Call Flow
- Initiate Outbound Call via API: An outbound call is triggered from Zero Runtime Cloud by making a POST request to
/v2/sip/callusing the API. This can be done programmatically or via the dashboard. - Routing Rules: The call request is processed by the configured Routing Rules, which determine how and where the call should be routed (e.g., to a user or an AI agent) and which outbound gateway to use.
- Outbound Gateway: The call is sent to the Outbound Gateway based on the matched routing rule, which holds the SIP provider configuration (termination address, credentials, etc.).
- SIP Provider: The Outbound Gateway sends a SIP INVITE to the configured SIP provider (such as Twilio, Plivo, Telnyx, or Vonage) using the provided authentication credentials.
- User Receives Call: The SIP provider places the call to the destination user (phone number or SIP endpoint). The user receives the call and can answer it on their device.
- Connect or invoke: The caller is connected to the Zero Runtime room, and an AI Agent is invoked depending on the routing rule.
Configure Phone Number (Inbound + Outbound)
With Zero Runtime’s unified flow, creating a phone number provisions both the inbound and outbound gateways for that number. You can do this from the dashboard or via the API.Configure your provider
For the provider you want to use, you need:-
The SIP URI to forward inbound calls to Zero Runtime:
Replace
$YOUR_ORG_IDwith your actual Zero Runtime organization ID.If you want to restrict calls to a specific region, you can use:Available regions:in1→ Indiaus2→ US
- The termination SIP address and authentication credentials (username/password) of your provider, used for outbound calls.
Create the Phone Number
When creating a phone number in Zero Runtime, provide the following:- Phone Number: The number in E.164 format (e.g.,
+14155552671). - Inbound Gateway: Created automatically when you add a number from your SIP provider. It becomes the entry point for incoming SIP calls.
- Outbound Gateway:
- Gateway Name: A descriptive name for your gateway.
- Termination Address: The SIP URI or IP address where outbound calls should be sent.
- Authentication Credentials: Username and password for your SIP provider.
- Transport: Protocol to use (e.g., UDP, TCP, TLS).
By default, the SIP server region for outbound calls is automatically selected based on the location nearest to the number being dialed. To pin a specific region, update the outbound gateway using the
geoRegion property via the API.Available regions:us002→ USin001→ India
Setup Routing Rules
Once your phone number is configured, define Routing Rules to determine how calls are routed.-
Routing Rule Configuration:
- Gateway: Select the gateway you created.
- Number: Specify the phone number(s) associated with this rule.
- Dispatch: Choose how calls should be routed.
-
Room Configuration:
- Dynamic: A new room is created for each call. You can customize the room ID using a prefix:
- random: Generates a random room ID for each call.
- participant number: Uses the caller’s phone number as part of the room ID.
- SIP number: Uses the SIP number (the number you purchased) as part of the room ID.
- Static: All calls are routed to a fixed, pre-defined room.
- Dynamic: A new room is created for each call. You can customize the room ID using a prefix:
Configure using Dashboard
Configure using APIs
You can create a phone number with both inbound and outbound gateways in a single API call. See the Create Phone Numbers + SIP Gateways API for the full request and response schema.Initiate an Outbound Call
Once your phone number is configured, you can initiate outbound calls using the Zero Runtime API. This allows you to dial out from a room to any external phone number or SIP endpoint. Parameters:sipCallFrom: The source phone number (E.164 format) to place the call from.sipCallTo: The destination phone number (E.164 format).routingRuleId: ID of the routing rule to use for this call.destinationRoomId: (Optional) The room ID to connect the call to.
The routing rule referenced by
routingRuleId must be of type outbound, and the business number provided in sipCallFrom must be associated with that routing rule. The call will be rejected if either condition is not met.API Reference
Phone Number APIs
- Create Phone Numbers + SIP Gateways API
- List Phone Numbers API
- Get Phone Number by e164 API
- Update SIP Gateway API
- Detach Gateway from Phone Number API
- Release Phone Number API