Making a call

Call feature is essential for the modern day communication. Call sdk allows users to make a audio/video call with the another sdk users.

warning

Before making the call, make sure you have implemented the helper object.

Make a voice call#

Initiate a call by providing the callee’s user JID into the makeVoiceCall method. Once the call initiated successfully, a callStatusListener callback will be triggered and callee user call status will be received here.

await SDK.makeVoiceCall(['USER1_JID', 'USER2_JID'...]);

Request Params#

ParamDescriptionTypeRequired
[USER_JID]User JIDArraytrue

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString

Make a video call#

Initiate a call by providing the callee’s user JID into the makeVideoCall method. Once the call initiated successfully, a callback callStatusListener will be triggered and callee user call status will be received here.

await SDK.makeVideoCall(['USER1_JID', 'USER2_JID'...]);

Request Params#

ParamDescriptionTypeRequired
[USER_JID]User JIDArraytrue

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString

Make a group voice call#

Initiate a call by providing the callee’s user JID & Group ID into the makeVoiceCall method. Once the call initiated successfully, a callStatusListener callback will be triggered and callee user call status will be received here.

await SDK.makeVoiceCall(['USER1_JID', 'USER2_JID'...], 'GROUP_ID');

Request Params#

ParamDescriptionTypeRequired
[USER_JID]Pass User JID in array formatStringtrue
GROUP_IDGroup IDStringtrue

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString

Make a group video call#

Initiate a call by providing the callee’s user JID & Group ID into the makeVideoCall method. Once the call initiated successfully, a callback callStatusListener will be triggered and callee user call status will be received here.

await SDK.makeVideoCall(['USER1_JID', 'USER2_JID'...], 'GROUP_ID');

Request Params#

ParamDescriptionTypeRequired
[USER_JID]Pass User JID in array formatStringtrue
GROUP_IDGroup IDStringtrue

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString

Receive incoming call#

To receive an incoming call, a incomingCallListener callback should already be registered in the callee’s client app. Whenever a user make call to a user, the callee user will receive the calling data in this callback.

// Callback Response Argument Structure
{
callTime: 1615878543994005,
callType: "audio|video",
groupId: null|GROUP_ID,
roomId: "wmupbheao",
status: "calling",
toUsers: ["USER_JID"]
userJid: "FROM_USER_JID"
}

Response Params#

ArgumentsDescription
callTimeCall intiated time in timestamp format.
callTypeDescribe the audio or video call.
groupIdContain the group ID If the call is group call. Otherwise, the value will be NULL.
roomIdCall room ID.
statusStatus of the call(calling, ringing, connecting, connected).
toUsersArray of User JID of callee users.
userJidUser JID who intiated the call

Answer a call#

To answer a call use the answerCall method.

await SDK.answerCall();

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString

End a call#

To end a call use the endCall method.

await SDK.endCall();

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString

Decline a call#

To decline a call use the declineCall method.

await SDK.declineCall();

Response Params#

ArgumentsDescriptionType
statusCodeStatus CodeNumber
messageSuccess/Error MessageString