How can I implement a ringing or calling application with Vonage Video API?
- Vonage Video API
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:
- User A sends its intention to ring user B (includes user B's UID) to App Server.
- App Server uses a designated Vonage API key and secret to create a session ID and 2 tokens (1 for each user).
- App Server sends the common session id and respective token to user A and B.
- 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.
- 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.
- 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.