Callback Listeners
#
Add Callback Event ListenersAdd all following callback methods while initializing the SDK. Callback listeners are functions that will be called whenever the specified event happens.
Note: Callback Listener name should be the same as described below.
#
Helper ObjectFor getting the logged-in user display name in the SDK, You need to implement the following helper object in your code. The helper should have the following methods implemented.
This should return the display name of the logged-in user.
#
Sample Implementation:#
Incoming Call ListenerWhen a user receives the incoming call, this callback event called.
#
Sample Response:#
Response Property Details:Arguments | 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. |
#
Call Status ListenerHandles Call Status, triggered whenever user call status changes.
#
Sample Response:#
Response Property Details:Property | Description |
---|---|
status | user call status. |
userJid | From user JID |
localUser | User JID is current logged in user or another user. |
sessionStatus | Describe whether the call is closed or not. If the value is CLOSED means, no user in the call & call is disconnected completely. Otherwise call is in progress. |
usersStatus | Array of users with call details. |
#
Possible Status:Status | Description |
---|---|
ringing | Callee user received the incoming call payload & Acknowledged it. |
connecting | User attended the received call |
connected | Connection is established between the users |
reconnecting | There is a problem in connection between users |
engaged | When a user is in another call |
busy | When a user disconnect the call in ringing state |
disconnected | User disconnected from the call |
ended | When another user ended the ongoing call |
#
User Track ListenerIn this listener, receive the local & remote users audio tracks. We have localUser property to differentiate the remote & local users.
#
Sample Response:#
Response Property Details:Property | Description |
---|---|
localUser | Identify whether the track is belongs to local or remote user true - Local user false - Remote user. |
track | Track object |
trackType | Contain audio or video to identify type of track. |
userJid | From user JID |
usersStatus | Array of users with call details. |
#
Mute Status ListenerWhenever a user mute/unmute the video/audio, this event listener will be called with mute/unmute status details.
#
Sample Response:#
Response Property Details:Property | Description |
---|---|
isMuted | Indetify whether the track is muted/unmuted. true - Muted false - Unmuted. |
trackType | Contain audio or video to identify type of track is muted/unmuted. |
userJid | From user JID. |
#
Call Switch ListenerWhen a user Request, Cancel, Accept & Decline a video call switch process, this event listener will be called with status information.
#
Sample Response:#
Response Property Details:Property | Description |
---|---|
status | Status of the call switch process. |
userJid | From user JID. |
localUser | User JID is current logged in user or another user |
usersStatus | Array of users with the details of the call. |
#
Possible Status:Status | Description |
---|---|
request | When a user initiate the call switch request, the current user will receive the request status |
cancel | When a user who initiate the call switch cancel the request, the current user will receive the cancel status |
accept | When a user accept the request, the call switch initiator will receive the accept status |
decline | When a user decline the request, the call switch initiator will receive the decline status |
timeout | No response from user |
#
Missed Call ListenerWhen a user already in call & the same user receives a call from the third user, this second call will be consider as a missed call & at this time this event will be called with second call details.
#
Sample Response:#
Response Property Details:Property | 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). |
toUsers | Array of User JID of callee users. |
userJid | User JID who intiated the call |
#
Media Error ListenerWhen user deny the microphone permission or audio devices are not able to read by app, at the time this event will be called with error details.
#
Sample Response:#
Response Property Details:Property | Description |
---|---|
action | In which action error occurred(makeCall, answerCall). |
device | Name of the device which has error (mic, camera, mic & camera) |
error | Describe the error type |
statusCode | Status Code |
message | Error meesage |
#
Possible Error:Error | Description |
---|---|
Microphone permission denied | Microphone Permission denied. |
#
Call Speaking ListenerHandles the audio level, triggered whenever there is a change in the audio level of the current user or any other users on the call.
#
Sample Speaking Response:#
Response Property Details:Property | Description |
---|---|
userJid | Speaking user JID |
isSpeaking | Whether the user is speaking or not |
localUser | Speaking user JID is current logged in user or another user. |
volumeLevel | Volume level is at which the user is speaking. Based on this level you can show the mic indicator for a particular user. Possible values will be between 0 to 10. When the value is 0, it’s referred to as the silent. When the value is 10, it’s referred to as the loudest. |
#
Call Log ListenerIf any of the call log is deleted or cleared, the userCallLogListener function will be triggered and return a response.
#
Sample CallLog Response:#
Response Property Details:Property | Description |
---|---|
type | It returns the type as calllog |
deleteType | It returns clearCallLog when clearing all the call logs otherwise, It returns deleteCallLog |
callLogIds | It returns the callLogIds that were deleted from the log. |