Make your first call, Mute/Unmute the audio/video stream, Video call switch, Inivite users, Get the mute status of the user & End call features methods are described here.
Make a call#
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.
Request Params#
Param | Description | Type | Required |
---|
[USER_JID ] | User JID | Array | true |
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
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.
Request Params#
Param | Description | Type | Required |
---|
[USER_JID ] | User JID | Array | true |
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
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.
Request Params#
Param | Description | Type | Required |
---|
[USER_JID ] | Pass User JID in array format | String | true |
GROUP_ID | Group ID | String | true |
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
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.
Request Params#
Param | Description | Type | Required |
---|
[USER_JID ] | Pass User JID in array format | String | true |
GROUP_ID | Group ID | String | true |
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
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.
Response Params#
Arguments | Description |
---|
callTime | Call intiated time in timestamp format. |
callType | Describe the audio or video call. |
groupId | Contain the group ID If the call is group call. Otherwise, the value will be NULL. |
roomId | Call room ID. |
status | Status of the call(calling, ringing, connecting, connected). |
toUsers | Array of User JID of callee users. |
userJid | User JID who intiated the call |
Answer a call#
To answer a call use the answerCall method.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
End a call#
To end a call use the endCall method.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Decline a call#
To decline a call use the declineCall method.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Audio Mute/Unmute#
Pass the boolean value true for mute & false for unmute into muteAudio method.
Request Params#
Param | Description | Type | Required |
---|
BOOLEAN | true - Mute the audio false - Unmute the audio | BOOLEAN | true |
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Video Mute/Unmute#
Pass the boolean value true for mute & false for unmute into muteVideo method.
Request Params#
Param | Description | Type | Required |
---|
BOOLEAN | true - Mute the video false - Unmute the video | BOOLEAN | true |
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Inivite users#
Inivite users by providing the callee’s user JID in array format into the inviteUsers method.
Request Params#
Param | Description | Type | Required |
---|
[USER_JID ] | Invite users JID list in array format | Array | true |
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Video Call Switch#
To initiate the video call switch process, a callSwitchListener callback should already be registered in the client app to receive the request, accept, decline & cancel status information. Because whenever user perform any action related to this call switch, Client app will receive the user action status in this callback.
Request the Call Switch#
To send the call switch request, call the requestVideoCallSwitch method.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Cancel the request#
To cancel the call switch request which is aready sent to the remote user, call the cancelVideoCallSwitchRequest method.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Accept the request#
To accept the call switch request, call the acceptVideoCallSwitchRequest method.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Decline the request#
To decline the call switch request, call the declineVideoCallSwitchRequest method.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Send the Custom Data#
To send the custom data to other users in call by providing the data which user want to pass as a argument into sendCustomData method. Once a user send the custom data, a customDataListener callback will be triggered and sent data will be received in the first argument of this callback.
Request Params#
Param | Description | Type | Required |
---|
DATA | Custom data. User could send any type of data such as OBJECT, STRING, ARRAY, BOOLEAN | any | true |
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Get Call Logs Details#
Get the call logs details by calling getCallLogs method.
Request Params#
Arguments | Description | Type |
---|
pageNumber | Page number | Number |
Response Params#
Arguments | Description | Type |
---|
data | Array of object | Array |
statusCode | Status Code | Number |
message | Success/Error Message | String |
Display Browser Notification#
Display the browser notification by providing the notification object into the showCallNotification method. Notification would display when a user receive a call or end call while user on different screen instead of on webchat application screen.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Call Join Via Link#
Get call link#
When you are in ongoing audio/video call, you can get the call link by using getCallLink method. This method will return call link when you are connected to a call or else it will return error.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
data | Call link to share with the others to join the ongoing call | String |
Subscribe call#
Subscribe a call by providing the room link and users display name into the subscribeCall method. A callback method also need to given as an input to handle the success/error of this method. It will hold the success and error object as params.
Once the call subscribed successfully, callback with the success object will be triggered. After this callback success, you can show the Join Now button in the screen.
Same time callUsersUpdateListener will also triggered that will hold the list of users on the call. You can use this event to show the users list in the preview screen. This event callUsersUpdateListener will be triggered whenever there is a change in users list. So you can add/remove users from the preview UI. If callUsersUpdateListener triggered with empty users list, then the call has been ended. You need to close the preview screen and show the message like Call Ended.
If the callback with the error object is triggered, then there is some issue in subscribing the call. You can get the error code and error message from the error object. Based on that you can show alerts or redirect to any other screen in the UI.
Request Params#
Param | Description | Type | Required |
---|
CALL_LINK | Call link | String | true |
USERNAME | Display Name of the current user | String | true |
CALLBACK | Callback method to handle success/error | Function | true |
Success/Error Object#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Join a call#
When you are in the preview screen, to join a call use the joinCall method.
A callback method need to given as an input to handle the success/error of this method. It will hold the success and error object as params. Once the call joined successfully, callback with the success object will be triggered. Then you will receive the normal call events.
If the callback with the error object is triggered, then there is some issue in joining the call. You can get the error code and error message from the error object. Based on that you can show alerts or redirect to any other screen in the UI.
Request Params#
Param | Description | Type | Required |
---|
CALLBACK | Callback method to handle success/error | Function | true |
Success/Error Object#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
Unsubscribe a call#
When you are in the preview screen and decided to close the UI without joining the call, you need to clear/unsubscribe the call data by using the unsubscribeCall method.
Response Params#
Arguments | Description | Type |
---|
statusCode | Status Code | Number |
message | Success Message | String |
Get call users username#
When you are in ongoing audio/video call or in the preview screen for joining the call, you can get the call user's username by using getCallUsername method. This method will return username when you are connected/subscribed to a call or else it will return error.
Request Params#
Param | Description | Type | Required |
---|
USER_ID | User id of the user | String | true |
Response#
Username of the user to show in the UI.