Overview
This guide demonstrates how to start call using Cometchat’s calling sdk. Before you begin, we strongly recommend you read the calling setup guide.Generate Call Token
Prior to starting the call session, it is necessary to have a call token. A call token can be generated using thegenerateToken method of CometChatCalls class.
- JavaScript
- TypeScript
On success of
generateToken method you will get the response object containing call token with key named token.
Start Call Session
The most important class that will be used in the implementation is theCallSettings class. This class allows you to set the various parameters for the call/conference. In order to set the various parameters of the CallSettings class, you need to use the CallSettingsBuilder class. Below are the various options available with the CallSettings class.
The mandatory parameters that are required to be present for any call/conference to work are:
- callToken: The unique token for the call/conference session.
- callSettings: The object of CallSettings class.
- JavaScript
- TypeScript
setIsAudioOnlyCall() method allows you to set if the call is supposed to be an audio call or an audio-video call. If set to true, the call will be an audio-only call else when set to false the call will be an audio-video call. The default is false, so if not set, the call will be an audio-video call.
The
OngoingCallListener listener provides you with the below callback methods:
Settings
TheCallSettings class is the most important class when it comes to the implementation of the Calling feature. This is the class that allows you to customize the overall calling experience. The properties for the call/conference can be set using the CallSettingsBuilder class. This will eventually give you and object of the CallSettings class which you can pass to the startSession() method to start the call.
The options available for customization of calls are: