- How inbound and outbound calls flow through Zero Runtime.
- Adding a phone number by import or SIP configuration.
- 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)
Every phone number in Zero Runtime gets both an inbound and an outbound gateway. In the Zero Runtime Dashboard, go to Telephony > Phone Numbers and add a number in one of three ways:- Buy a Phone Number: choose a new number from a supported provider and activate it on your account.
- Import Existing Number: import a Twilio or Plivo number with its API credentials. Zero Runtime creates both gateways for you.
- Configure SIP: connect a number from any other SIP provider, such as Vonage or Telnyx.
Import a Twilio or Plivo Number
- Click Add Number, choose Import Number, and select Twilio or Plivo.
- Enter the number in E.164 format (e.g.,
+14155552671) and the provider credentials: Account SID and Auth Token for Twilio, Auth ID and Auth Token for Plivo. Give the number a Name For Phone Number. - Submit. Zero Runtime validates the credentials and configures both gateways.
Configure SIP
Click Add Number > Configure SIP and fill in the SIP Configuration panel:- Name: A descriptive name for the configuration.
- Phone Number: The number in E.164 format. Click Add Number to add more.
- Inbound tab: Copy the Inbound Gateway URL and set it as the destination for inbound calls in your SIP provider (origination URI or FQDN).
- Outbound tab:
- Outbound Gateway Address: Your provider’s termination SIP address or domain.
- SIP Username and SIP Password: The outbound credentials set in your provider.
- Transport: Protocol to use (UDP, TCP, or TLS).
- SIP Region: Leave as Auto, or pin a region for media anchoring.
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, click Configure Rule on it and choose Create New Routing Rule (or Assign Existing Rule). A routing rule has:- Routing Rule Info:
- Routing Rule Name and API Key.
- Call Direction: Inbound to receive calls, or Outbound to place them.
- Phone Numbers: The number(s) this rule applies to.
- Room Configuration:
- Dynamic: A new room is created for each call. Set the room ID with a Room 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. Set the room ID with a Room Prefix:
- Agent Configuration: Enter the Agent Name or ID and click Verify Agent ID. Optionally add Agent Meta Data as key-value pairs.
- Access Control (optional): Limit calls to Allowed Numbers or Allowed IP Addresses.
Configure using Dashboard
This video shows a Twilio number being imported. Zero Runtime creates both gateways, and the number is ready for a routing rule.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