Skip to content

Dialing via Voice API v2

Beta

Dialing via Voice API v2 is currently in beta. It is fully functional, but interfaces and behavior may change before general availability. Voice API v2 itself is available as a public preview.

The Android SDK can place calls that are routed through the Sinch Voice API v2 platform. We call these calls dials. A dial starts in your app, just like any other outgoing call, but how it's handled is decided by your Voice API v2 configuration. You can use dials to reach phone numbers, SIP endpoints, audio streams and Voice Relay.

Why use dial?

Calls made from your app with dials are handled by the Voice API v2 platform. This lets you:

  • Control the call from your Voice API v2 service. The call follows your service configuration. That can be predefined SVAML commands or webhooks to your backend that decide what happens next in real time. See how Voice API v2 works.
  • Reach more destinations from the app. Besides phone numbers and SIP endpoints, a dial can connect the user to an audio stream or to Voice Relay. This makes it easy to, for example, connect your users to an AI voice agent.
  • Use Voice API v2 features. Dials use the same call model, events and features as the rest of Voice API v2. See What is new in Voice v2? for an overview.

Supported destinations

DestinationDescriptionLearn more
Phone numberA phone on the regular telephone network (PSTN). Specify the number in E.164 format, prefixed with +.Outbound calls
SIP endpointA SIP destination, such as your PBX or contact center.SIP outbound
Audio streamA two-way audio stream to your WebSocket server.Voice Streams, Audio streaming
Voice RelayA WebSocket connection with speech-to-text and text-to-speech, for example for chatbots and AI agents.Voice Relay, Call chatbots with Voice Relay
Service configuration takes precedence

The SDK provides a dial method for each destination type, but your Voice API v2 service has the final say on where the call goes. Your service configuration in the dashboard can set the destination statically, using service call behaviors, or dynamically, using webhooks to your backend. If such a configuration is present, it always takes precedence over the destination passed to the SDK dial method.

Note

App-to-app calls, including video calls, aren't available via Voice API v2 yet. They continue to use the existing in-app calling on Voice API v1. See Audio calling and Video calling.

Before you begin

Note:

You can choose which Voice API v2 service handles a dial. If you don't specify a service, your project's default service is used.

Placing a dial

Dials are placed using the CallController, just like other calls. There is one dial method for each destination type: phone number, SIP endpoint, audio stream and Voice Relay. Each method takes the destination and optional, destination-specific options, such as the Voice API v2 service to use, the caller identifier or custom call headers. For the full list of methods and options, see the Reference Documentation.

val callController = sinchClient.callController
val call = callController.dialPhoneNumber("+14155550101")
call.addCallListener(...)

For complete examples of each destination type, see the dialing samples in the Sinch reference applications (Android) on GitHub.

Handling the call

A dial returns a regular Call object. Follow its progress with the same CallListener you use for other outgoing calls: you're notified when the call is progressing, answered, established and ended. See Audio calling for details.

More resources