Making a call
#
Make a callCall feature is essential for the modern day communication. Call sdk allows users to make a one to one audio/video call with the another sdk user.
Note: You need to check the required runtime permissions before calling call sdk methods. if required permissions are not available
isSuccess
will befalse
and error message will be given in callback.
#
Required runtime permissionsFor audio call, we need a below permissions:
You can use the below method to check audio call permissions:
- Java
- Kotlin
For video call, we need below permissions:
You can use the below method to check video call permissions:
- Java
- Kotlin
From Android 12, ensure that
android.permission.BLUETOOTH_CONNECT
andandroid.permission.READ_PHONE_STATE
runtime permissions are granted for your app for seameless audio routing and gsm call handling. If theandroid.permission.BLUETOOTH_CONNECT
permission is not granted, call audio will not be routed to BT Headset even though it is connected. If theandroid.permission.READ_PHONE_STATE
permission is not granted, gsm call related functionalities will not work in sdk.
Note: From Android 13, CallSDK need below permission to show ongoing call notification.
You can use the below method to check call notification permission:
- Java
- Kotlin
Argument | Type | Description |
---|---|---|
TO_JID | String | jid of the call receiver |
CALLBACK | CallActionListener | callback to observe the action status |
#
Call MetadataTo send custom data while making a call, use the optional metaData
parameter in all makecall methods.This parameter accepts an array of type CallMetadata
caution
Call SDK process only the first three metadata elements, and ensure the metadata doesn't include large data that could interfere with the successful transfer of the PUSH call payload.
#
Make a voice callMake voice call feature allows users to make a one to one audio call with the another sdk user along with call metadata.You can make a voice call using the below method.
- Java
- Kotlin
caution
If one to one call feature unavailable for your plan then it will throw 403 exception.
#
Make a video callMake video call feature allows users to make a one to one video call with the another sdk user along with call metadata.You can make a video call using the below method.
- Java
- Kotlin
caution
If one to one call feature unavailable for your plan then it will throw 403 exception.
#
Make a group voice callMake group voice call feature allows users to make a voice call with multiple sdk users along with call metadata. You can make a group voice call using the below method.
Argument | Type | Description |
---|---|---|
JID_LIST | List<String> | jid list of the callee's |
GROUP_ID | String | Group id of the group from which call initiated |
CALL_METADATA | [CallMetadata] | Optional Call metadata information (Maximum size is 3) |
CALLBACK | CallActionListener | callback to observe the action status |
- Java
- Kotlin
caution
If group call feature unavailable for your plan then it will throw 403 exception.
#
Make a group video callMake group video call feature allows users to make a video call with multiple sdk users along with call metadata. You can make a group video call using the below method.
Argument | Type | Description |
---|---|---|
JID_LIST | List<String> | jid list of the callee's |
GROUP_ID | String | Group id of the group from which call initiated |
CALL_METADATA | [CallMetadata] | Optional Call metadata information (Maximum size is 3) |
CALLBACK | CallActionListener | callback to observe the action status |
- Java
- Kotlin
caution
If group call feature unavailable for your plan then it will throw 403 exception.
#
Add participants to the callAfter call is connected, you can able to add users to the ongoing call. sdk provides methods to invite users to the call, once they accepted the incoming call, they will join in the ongoing call.
Argument | Type | Description |
---|---|---|
JID_LIST | List<String> | jid list of the callee's |
CALLBACK | CallActionListener | callback to observe the action status |
- Java
- Kotlin
caution
If group call feature unavailable for your plan then it will throw 403 exception.
#
Receiving a incoming audio/video callWhenever you receive the audio/video call from the another sdk user, call sdk will show notification if device android
version is greater than or equal to Android 10 (API level 29), otherwise the activity which you set using the
CallManager.setCallActivityClass()
method during call sdk initialisation will be started with the call details.
sample call ui will be available for quick integration.
caution
Please don't forget to set activity class for call sdk using CallManager.setCallActivityClass()
.
#
Answer the incoming callWhenever you receive the audio/video call from the another sdk user, depending upon the android version, you activity may be started so whenever user presses accept button from your call UI , you need to call the below sdk method to answer the call and notify the caller.
Note: if the required permissions are not available then call be will be automatically declined even though you answered a call
Argument | Type | Description |
---|---|---|
CALLBACK | CallActionListener | callback to observe the action status |
- Java
- Kotlin
#
Decline the incoming callWhenever you receive the audio/video call from the another sdk user, depending upon the android version, you activity may be started so whenever user presses decline button from your call UI , you need to call the below sdk method to decline the call and notify the caller.
- Java
- Kotlin
#
Disconnect the ongoing callWhenever you make the audio/video call to the another sdk user and you just want to disconnect the call before getting connected or if you want to just disconnect a connected call after the end of conversation, whenever user presses the disconnect button from your call UI , you need to call the below sdk method to disconnect the call and notify the caller.
Note: The below method accepts
CallActionListener
as a optional paramter. you can pass the listener to get disconnect success callback
- Java
- Kotlin
info
Call Sdk requires chat sdk integration for user management.