Skip to main content

end()

Note: This API is supported from version 8.1.0-beta01.

The end() API ends the ongoing call anywhere within your application.

Parameter

  • callback (@Nullable ZohoSalesIQResultCallback<SalesIQCallAction>): A callback function that handle the result of the call termination It includes:
    • onSuccess(SalesIQCallAction action): Invoked when the call ends successfully, providing the final call status (missed, canceled, rejected, or ended).
    • onFailure(int errorCode, String errorMessage): Invoked when the call fails to end, returning an error code and message.

Pass null if you do not need to handle the result.

Syntax

Copiedvoid end(ZohoSalesIQResultCallback<SalesIQCallAction> callback);

Example

CopiedZohoSalesIQCalls.end();

//(or)

ZohoSalesIQCalls.end(new ZohoSalesIQResultCallback<ZohoSalesIQCalls.SalesIQCallAction>() {
    @Override
    public void onComplete(@NonNull SalesIQResult<ZohoSalesIQCalls.SalesIQCallAction> result) {
        if (result.isSuccess()) {
            ZohoSalesIQCalls.SalesIQCallAction action = result.getData();
        } else if (result.getError() != null) {
            Log.d("ZohoSalesIQCalls", "Failed to end call error, code: " + result.getError().getCode() + ", message: " + result.getError().getMessage());
        }
    }
});
CopiedZohoSalesIQCalls.end()

//(or)

ZohoSalesIQCalls.end { result ->
    if (result.isSuccess) {
        val action = result.data
    } else {
        Log.d("ZohoSalesIQCalls", "Failed to end call: ${result.error?.code} - ${result.error?.message}")
    }
}