How can I implement a ringing or calling application with Vonage Video API? How can I implement a ringing or calling application with Vonage Video API?

How can I implement a ringing or calling application with Vonage Video API?

Vonage API Support

Objective

How can I implement a ringing or calling application with Vonage Video API?

Applies To

  • Vonage Video API
  • Ringing
  • Calling

Procedure

Calling or ringing another user is not a feature of the Vonage Video API. Nonetheless, the ringing or calling logic can be implemented separately in the application. Once App users have rung or called each other, and agreed to proceed with the call, Vonage Video API can be used to implement the actual audio or video call.

Below, we have an illustration of how the ringing or calling logic might be established.

In this illustration:

  • User A wants to call user B using the App.
  • Both user A and user B are registered in the application server (App Server) with a unique ID (UID), for example, their email address, or a unique ID provided by the system.
  • Vonage session IDs and tokens are generated securely by the App Server, which holds Vonage API keys and secrets and do not reveal these to users.

A simple sequence of events can be as follows:

  1. User A sends its intention to ring user B (includes user B's UID) to App Server.
  2. App Server uses a designated Vonage API key and secret to create a session ID and 2 tokens (1 for each user).
  3. App Server sends the common session id and respective token to user A and B.
    • The sending method can be via a cloud messaging method that sends a server push notification to the device of each user.
    • Examples of cloud messaging providers include Firebase Cloud Messaging, OneSignal, Airship, etc.
  4. Upon receiving the push notification, the App at user B can perform a "ringing" operation to alert user B to the call.
    • User B can decide to accept or decline the call.
    • This decision is sent to the App Server.
    • App Server informs user A of this decision.
  5. If user B accepted the call:
    • Using the session id and token (from the server push notification), both user A and B can connect to the same session for a Vonage Video API powered video call.
  6. If user B declined the call, the App at both users terminates the ringing feature.

The above is only meant as a simple illustration of how ringing or calling can be implemented and used together with Vonage Video API. Many improvements can be made, for example, session and tokens can be generated and sent to users only after user B accepts the call.

Additional Information

For details on session creation, please refer to our documentation below.

Vonage Video API Opentok Environment

Vonage Video API Unified Environment

For information about token creation, please refer to our developer documentation below.

Vonage Video API Opentok Environment

Vonage Video API Unified Environment

How to recognize if I'm using Vonage Video API Unified Environment or Vonage Video API OpenTok environment?