Making a call
Call feature is essential for the modern day communication. Call sdk allows users to make a audio call with the another sdk user.
warning
Before making the call, make sure you have implemented the helper object.
#
Make a voice callInitiate 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.
caution
If One to one call feature is unavailable for your plan, then it will throw 403 exception
#
Request ParamsParam | Description | Type | Required |
---|---|---|---|
[USER_JID ] | User JID | Array | true |
#
Response Format#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
callType | Call type value as "audio" | String |
roomId | Unique ID | String |
note
To receive the user track, a userTrackListener callback should already be registered in the caller's client app. Whenever you make the call to a user, you will receive your own track and the callee's track in the same callback method. To differentiate the user, You can use the 'localUser' and 'userJid' param.
You need to supply the track object which was received in the callback method to the audio element based on the track type that you have received.
#
Make a video callInitiate 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.
caution
If One to one call feature is unavailable for your plan, then it will throw 403 exception
#
Request ParamsParam | Description | Type | Required |
---|---|---|---|
[USER_JID ] | User JID | Array | true |
#
Response Format#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
callType | Call type value as "video" | String |
roomId | Unique ID | String |
note
To receive the user track, a userTrackListener callback should already be registered in the caller's client app. Whenever you make the call to a user, you will receive your own track and the callee's track in the same callback method. To differentiate the user, You can use the 'localUser' and 'userJid' param. You will receive both Audio and Video track in the same callback method.
You need to supply the track object which was received in the callback method to the audio element based on the track type that you have received.
warning
You shouldn't play your own Audio track.
#
Receive incoming callTo 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 ParamsArguments | Description |
---|---|
allUsers | JID's of the users in the call. |
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. |
localUser | To determine local user or not |
roomId | Call room ID. |
roomLink | Call room Link. |
status | Status of the call(calling, ringing, connecting, connected). |
toUsers | Array of User JID of callee users. |
userDetails | User details object of the callee users. |
userJid | User JID who intiated the call |
usersStatus | Array of users with the details of the call. |
from | One to one call User JID of callee users / One to many call User JID who intiated the call. |
to | One to one call User JID who intiated the call / One to many call Group JID. |
callMode | Mode of call. |
#
Answer a callTo answer a call use the answerCall method.
#
Response Format#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
#
End a callTo end a call use the endCall method.
#
Response Format#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |
#
Decline a callTo decline a call use the declineCall method.
#
Response Format#
Response ParamsArguments | Description | Type |
---|---|---|
statusCode | Status Code | Number |
message | Success/Error Message | String |