All Products
Search
Document Center

Intelligent Media Services:API operation details

Last Updated:Dec 27, 2025

This topic describes the details of the Android software development kit (SDK) API operations.

API overview

Note

Older SDK versions contain deprecated parameters and methods. Upgrade the SDK to the latest version. For more information, see Android usage guide.

Class/Protocol

API

Description

ARTCAICallEngine

Defines the audio and video call engine API.

init

Initialization

setAICallAgentType

Sets the agent type.

call[1/2]

Creates and starts a call.

call[2/2]

Initiates an agent call through the client-side call API.

handup

Hangs up the call.

switchMicrophone

Switches the microphone status.

interruptSpeaking

Interrupt the robot.

enableVoiceInterrupt

Enables or disables smart interruption.

enableSpeaker

Switches between the speaker and earpiece.

muteAgentAudioPlaying

Stops or resumes the playback of the agent's audio stream.

enablePushToTalk

Enables or disables the push-to-talk mode.

isPushToTalkEnable

Checks whether the push-to-talk mode is enabled.

startPushToTalk

Push-to-talk mode: Starts speaking.

finishPushToTalk

Push-to-talk mode: Finishes speaking.

cancelPushToTalk

Push-to-talk mode: Cancels the current speech.

switchRobotVoice

Switches the voice.

getRobotVoiceId

Gets the current voice.

setEngineCallback

Registers a callback.

isMicrophoneOn

Checks whether the microphone is muted.

isSpeakerOn

Checks whether the speaker is used for playback.

isVoiceInterruptEnable

Checks whether smart interruption is enabled.

setAvatarAgentView (Deprecated)

Sets the view container for the digital human and specifies the rendering mode.

setVisionPreviewView (Deprecated)

Sets the local view container for visual understanding and specifies the rendering mode.

muteLocalCamera

Enable or disable the camera

isLocalCameraMute

Is the camera turned off?

switchCamera

Switches between the front and rear cameras.

getRtcEngine

You can obtain the RTC engine instance.

getIARTCAICallService

Gets the official protocol implementation.

sendTextToAgent

Sends a custom message to the large language model (LLM).

sendCustomMessageToServer

Sends a custom message to the business server. This operation must be called after the call is connected.

updateLlmSystemPrompt

Updates the system prompt for the LLM. This operation must be called after the call is connected.

updateBailianAppParams

Updates the parameters for the Alibaba Cloud Model Studio application center.

updateVcrConfig

Updates the VCR configuration.

startVisionCustomCapture

For a visual understanding agent, starts custom frame capture. After this is started, you cannot talk to the agent through voice. This operation must be called after the call is connected.

stopVisionCustomCapture

For a visual understanding agent, stops custom frame capture. This operation must be called after the call is connected.

setAgentView[1/2]

Sets the video view container for the agent.

setAgentView[2/2]

Sets the video view container for the agent and specifies the rendering mode.

setLocalView[1/2]

Sets the local preview view control.

setLocalView[2/2]

Sets the local preview view control and specifies the rendering mode.

getAgentInfo

Gets the runtime information of the current agent.

IARTCAICallEngineCallback

Engine callback events

onErrorOccurs

An error occurred.

onAgentStarted

The agent started successfully.

onCallBegin

The call started.

onCallEnd

The call ended.

onAliRtcEngineCreated

The underlying AliRtcEngine engine is created.

onAICallEngineRobotStateChanged

Robot state sync

onUserSpeaking

Callback for when the user is speaking.

onUserAsrSubtitleNotify

Synchronizes the text recognized by Automatic Speech Recognition (ASR) from the user's speech.

onAIAgentSubtitleNotify

Synchronous agent responses

onLLMReplyCompleted

The LLM has finished answering in the current call.

onNetworkStatusChanged

Callback for network status changes.

onVoiceVolumeChanged

The volume changed.

onVoiceIdChanged

The voice for the current call changed.

onVoiceInterrupted

The voice interruption setting for the current call changed.

onAgentVideoAvailable

Is the agent video active (stream ingest)?

onAgentAudioAvailable

The agent's audio stream is available.

onAudioDelayInfo

Audio loopback latency.

onAgentAvatarFirstFrameDrawn

The first video frame of the digital human is rendered.

onUserOnLine

Callback for when a user comes online.

onSpeakingInterrupted

The agent's current speech is interrupted.

onVisionCustomCapture

Custom frame capture mode is enabled for the current visual understanding call.

onAgentWillLeave

The current agent is about to leave the call.

onHumanTakeoverWillStart

A human agent is about to take over from the current agent.

onHumanTakeoverConnected

The human agent takeover is connected.

onReceivedAgentCustomMessage

A custom message from the agent is received.

onAgentEmotionNotify

Notification of the agent's emotion analysis result.

onAgentDataChannelAvailable

Callback for the availability of the agent's message channel.

onReceivedAgentVcrResult

A VCR result is received from the current agent.

API details

ARTCAICallEngine details

init

Initialization

/**
 * Initializes the engine.
 * @param config The initialization configuration.
 */
public abstract void init(ARTCAICallConfig config);

Parameters:

Parameter

Type

Description

config

ARTCAICallConfig

The initialization configuration.

setAICallAgentType

Sets the agent type.

/**
 * Sets the agent type.
 * @param aiAgentType
 */
public abstract void setAICallAgentType(ARTCAICallAgentType aiAgentType);

Parameters:

Parameter

Type

Description

aiAgentType

Set the agent type

call[1/2]

Creates and starts a call.

Note

This API operation is called on the client side when the agent is called from the server side. For more information about how to initiate an agent call from the server side, see Initiate an agent call through a server-side API operation.

/**
 * Creates and starts a call.
 */
public abstract void call(String rtcToken, String aiAgentInstanceId, String aiAgentUserId, String channelId);

Parameters:

Parameter

Type

Description

rtcToken

String

The token for joining the channel. This parameter cannot be empty.

aiAgentInstanceId

String

The instance ID. This parameter cannot be empty.

aiAgentUserId

String

The user ID of the agent. This parameter cannot be empty.

channelId

String

The channel ID. This parameter cannot be empty.

call[2/2]

Starts an agent call. This API operation is used to call an agent from the SDK. You must pass the ARTC channel token as the authentication token and set the agent ID, agent region, and related startup parameters in `mAiCallAgentTemplateConfig` of `ARTCAICallConfig`.

Note

This API operation is called when an agent is called from the client. This is the default call method. For more information, see Android usage guide.

/**
   * Starts an agent call.
   * @param rtcToken The authentication token for the local user to join the ARTC channel.
   * @detail This API operation uses the SDK to call an agent. You must pass the ARTC channel token and set the agent ID, agent region, and related startup parameters in `mAiCallAgentTemplateConfig` of `ARTCAICallConfig`.
   */
public abstract void call(String rtcToken);

Parameters:

Parameter

Type

Description

rtcToken

String

The token for joining the channel.

handup

Hangs up the call.

/**
 * Hangs up the call.
 */
public abstract void handup();

switchMicrophone

Switches the microphone status.

/**
 * Switches the microphone status.
 * @param on
 */
public abstract void switchMicrophone(boolean on);

Parameters:

Parameter

Type

Description

on

boolean

Specifies whether to mute the microphone.

interruptSpeaking

Interrupts the agent's speech.

/**
 * Interrupts the agent's speech.
 */
public abstract boolean interruptSpeaking();

enableVoiceInterrupt

Enables or disables smart interruption.

/**
 * Enables or disables smart interruption.
 */
public abstract boolean enableVoiceInterrupt(boolean enable);

Parameters:

Parameter

Type

Description

enable

boolean

Specifies whether to enable or disable smart interruption.

enableSpeaker

Switches between the speaker and the earpiece. `true` uses the speaker for playback. `false` uses the earpiece for playback.

/**
 * Switches between the speaker and the earpiece.
 */
public abstract boolean enableSpeaker(boolean enable);

Parameters:

Parameter

Type

Description

enable

boolean

Specifies whether to use the speaker or the earpiece. `true`: uses the speaker for playback. `false`: uses the earpiece for playback.

muteAgentAudioPlaying

Stops or resumes the playback of the agent's audio stream.

public abstract boolean muteAgentAudioPlaying(boolean mute);

Parameters:

Parameter

Type

Description

mute

Bool

Specifies whether to mute the playback.

enablePushToTalk

Enables or disables the push-to-talk mode.

/**
 * Enables or disables the push-to-talk mode. In push-to-talk mode, the agent reports the result only after `finishPushToTalk` is called.
 * @param enable
 * @return
 */
public abstract boolean enablePushToTalk(boolean enable);
Note
  • This API operation must be called after onCallBegin to take effect.

  • If you want to use push-to-talk mode by default, you can configure agentConfig.enablePushToTalk to true before the call.

Parameters:

Parameter

Type

Description

enable

boolean

Specifies whether to enable or disable the push-to-talk mode. In push-to-talk mode, the agent reports the result only after `finishPushToTalk` is called.

isPushToTalkEnable

Checks whether the push-to-talk mode is enabled.

/**
 * Checks whether the push-to-talk mode is enabled.
 * @return
 */
public abstract boolean isPushToTalkEnable();

startPushToTalk

In push-to-talk mode, this operation starts speaking.

/**
 * Push-to-talk mode: Starts speaking.
 * @return
 */
public abstract boolean startPushToTalk();

finishPushToTalk

In push-to-talk mode, this operation finishes speaking.

/**
 * Push-to-talk mode: Finishes speaking.
 * @return
 */
public abstract boolean finishPushToTalk();

cancelPushToTalk

In push-to-talk mode, this operation cancels the current speech.

/**
 * Push-to-talk mode: Cancels the current speech.
 * @return
 */
public abstract boolean cancelPushToTalk();

switchRobotVoice

Switches the agent's voice.

/**
 * Switches the voice.
 */
public abstract boolean switchRobotVoice(String voiceId);

Parameters:

Parameter

Type

Description

voiceId

String

Switch the voice

getRobotVoiceId

You can obtain the current voice.

/**
 * Gets the current voice.
 * @return
 */
public abstract String getRobotVoiceId();

setEngineCallback

Registers a callback.

/**
 * Registers a callback.
 * @param engineCallback
 */
public abstract void setEngineCallback(IARTCAICallEngineCallback engineCallback);

Parameters:

Parameter

Type

Description

engineCallback

IARTCAICallEngineCallback

Register a callback

isMicrophoneOn

Do you want to turn off the microphone?

/**
 * Checks whether the microphone is muted.
 * @return
 */
public abstract boolean isMicrophoneOn();

isSpeakerOn

Checks whether the speaker is used for playback. `true` indicates that the speaker is used. `false` indicates that the earpiece is used.

/**
 * Checks whether the speaker is used for playback.
 * @return
 */
public abstract boolean isSpeakerOn();

isVoiceInterruptEnable

Checks whether smart interruption is enabled.

/**
 * Checks whether smart interruption is enabled.
 * @return
 */
public abstract boolean isVoiceInterruptEnable();

setAvatarAgentView (Deprecated)

Sets the view container for the digital human and specifies the rendering mode.

Important

This method is deprecated in versions 2.5 and later. Use setAgentView[1/2] and setAgentView[2/2] instead.

public abstract void setAvatarAgentView(ViewGroup viewGroup, ViewGroup.LayoutParams avatarLayoutParams, ARTCAICallVideoCanvas canvas);

Parameters:

Parameter

Type

Description

viewGroup

ViewGroup

The rendering view for the digital human.

avatarLayoutParams

ViewGroup.LayoutParams

The layout parameters.

canvas

ARTCAICallVideoCanvas

The rendering view configuration. This includes the rendering view, rendering mode, mirror mode, and rotation mode.

setVisionPreviewView (Deprecated)

Sets the local view container for visual understanding and specifies the rendering mode.

Important

This method is deprecated in versions 2.5 and later. Use setLocalView[1/2] and setLocalView[2/2] instead.

public abstract void setVisionPreviewView(ViewGroup viewGroup, ViewGroup.LayoutParams visionLayoutParams, ARTCAICallVideoCanvas canvas);

Parameters:

Parameter

Type

Description

viewGroup

ViewGroup

The local rendering view.

avatarLayoutParams

ViewGroup.LayoutParams

The layout parameters.

canvas

ARTCAICallVideoCanvas

The rendering view configuration. This includes the rendering view, rendering mode, mirror mode, and rotation mode.

muteLocalCamera

Turn the camera on or off

/**
 * Mutes or unmutes the camera.
 */
public abstract boolean muteLocalCamera(boolean mute);

Parameters:

Parameter

Type

Description

mute

boolean

Turn the camera on or off

isLocalCameraMute

Is the camera off?

/**
 * Checks whether the camera is muted.
 * @return
 */
public abstract boolean isLocalCameraMute();

switchCamera

Switches between the front and rear cameras.

/**
 * Switches between the front and rear cameras.
 */
public abstract boolean switchCamera();

getRtcEngine

Obtain the RTC engine instance

/**
 * Gets the ARTC engine instance.
 * @return
 */
public abstract AliRtcEngine getRtcEngine();

getIARTCAICallService

Retrieves the official protocol implementation.

/**
 * Gets the official protocol implementation.
 * @return
 */
public abstract IARTCAICallService getIARTCAICallService();

sendTextToAgent

Sends a custom message to the Large Language Model (LLM).

/**
 * Sends a custom message to the LLM.
 * @param req
*/
public  boolean sendTextToAgent(ARTCAICallSendTextToAgentRequest req);

Parameters:

Parameter

Type

Description

req

ARTCAICallSendTextToAgentRequest

The message struct to send.

sendCustomMessageToServer

Sends a custom message to the business server. This operation must be called after the call is connected.

/**
 * Sends a custom message to the AppServer.
 * Reuses the agent's message channel to send a message to the AppServer. The AppServer must listen for a callback to get the custom message.
 * @param msg
 * @return true: The message was sent successfully. false: The message failed to be sent.
*/
public boolean sendCustomMessageToServer(String msg);

Parameters:

Parameter

Type

Description

msg

String

The content to send.

updateLlmSystemPrompt

Updates the system prompt for the LLM. This operation must be called after the call is connected.

/**
 * Updates the system prompt for the LLM. For example: "You are a friendly and helpful assistant focused on providing users with accurate information and advice."
 * @param prompt
 * @return true: The update was successful. false: The update failed.
*/
public boolean updateLlmSystemPrompt(String prompt)

Parameters:

Parameter

Type

Description

prompt

String

The prompt.

updateBailianAppParams

Updates the parameters for the Alibaba Cloud Model Studio application center.

public abstract boolean updateBailianAppParams(String params);

Parameters:

Parameter

Type

Description

params

String

The parameters for the Alibaba Cloud Model Studio application center.

updateVcrConfig

Updates the Video Content Recognition (VCR) configuration.

 public abstract boolean updateVcrConfig(ARTCAICallAgentVcrConfig config);

Parameters:

Parameter

Type

Description

config

ARTCAICallAgentVcrConfig

The VCR configuration.

startVisionCustomCapture

For a visual understanding agent, this operation starts custom frame capture. After this operation is called, you cannot talk to the agent by voice. This operation must be called after the call is connected.

/**
 * For a Vision agent, starts custom frame capture. After this is started, you cannot talk to the agent through voice.
 * @param request The request parameters.
 * @return true: The request was sent successfully. false: The request failed to be sent.
*/
public  boolean startVisionCustomCapture(ARTCAICallVisionCustomCaptureRequest request);

Parameters:

Parameter

Type

Description

req

ARTCAICallVisionCustomCaptureRequest

The configuration information.

stopVisionCustomCapture

For a visual understanding agent, this operation stops custom frame capture. This operation must be called after the call is connected.

public  boolean stopVisionCustomCapture();

setAgentView[1/2]

Sets the video view container for the agent.

    public abstract void setAgentView(ViewGroup viewGroup, ViewGroup.LayoutParams agentLayoutParams);

Parameters:

Parameter

Type

Description

viewGroup

ViewGroup

The rendering view for the digital human.

avatarLayoutParams

ViewGroup.LayoutParams

The layout parameters.

setAgentView[2/2]

Sets the video view container for the agent and specifies the rendering mode.

    public abstract void setAgentView(ViewGroup viewGroup, ViewGroup.LayoutParams agentLayoutParams, ARTCAICallVideoCanvas canvas);

Parameters:

Parameter

Type

Description

viewGroup

ViewGroup

The rendering view for the digital human.

agentLayoutParams

ViewGroup.LayoutParams

The layout parameters.

canvas

ARTCAICallVideoCanvas

The rendering view configuration. This includes the rendering view and rendering mode.

setLocalView[1/2]

Sets the local preview view control.

public abstract void setLocalView(ViewGroup viewGroup, ViewGroup.LayoutParams localLayoutParams);

Parameters:

Parameter

Type

Description

viewGroup

ViewGroup

The local capture view.

localLayoutParams

ViewGroup.LayoutParams

The layout parameters.

setLocalView[2/2]

Sets the local preview view control and specifies the rendering mode.

public abstract void setLocalView(ViewGroup viewGroup, ViewGroup.LayoutParams localLayoutParams, ARTCAICallVideoCanvas canvas);

Parameters:

Parameter

Type

Description

viewGroup

ViewGroup

The local capture view.

localLayoutParams

ViewGroup.LayoutParams

The layout parameters.

canvas

ARTCAICallVideoCanvas

The rendering view configuration. This includes the rendering view and rendering mode.

getAgentInfo

Retrieves the runtime information of the current agent.

public abstract ARTCAICallAgentInfo getAgentInfo();
Note
  • The agent information returned by this API operation is valid only after the onCallBegin callback indicates that a call has started.

  • If the agent runs abnormally, you can use this API operation to obtain the runtime information, especially the instanceId, and provide it to technical support for troubleshooting.

Return value:

This API operation returns an ARTCAICallAgentInfo object that contains the following parameters:

Parameter

Type

Description

agentId

String

The current agent ID.

agentType

ARTCAICallAgentType

The agent type.

agentUserId

String

The user ID of the agent in the RTC channel.

channelId

String

The RTC channel ID where the agent is located.

instanceId

String

The instance ID of the current running agent.

requestId

String

The request ID of the current running agent.

IARTCAICallEngineCallback details

onErrorOccurs

An error occurred.

/**
 * An error occurred.
 * @param errorCode The error code.
 */
void onErrorOccurs(AICallErrorCode errorCode);

Parameters:

Parameter

Type

Description

errorCode

AICallErrorCode

The error that occurred.

onAgentStarted

This callback is triggered when the agent starts successfully. If you use the client-side call[2/2] API operation to call the agent, this callback is received when the call is successful.

/**
 * The agent started successfully.
 */     
public void onAgentStarted() {}

onCallBegin

Joining the call

/**
 * The call started (the user joined the channel).
 */
void onCallBegin();

onCallEnd

You have left the meeting.

/**
 * The call ended (the user left the channel).
 */
void onCallEnd();

onAliRtcEngineCreated

An instance of the underlying AliRtcEngine is created.

 public void onAliRtcEngineCreated(AliRtcEngine engine)

Parameters

Parameter

Type

Description

engine

AliRtcEngine

The underlying AliRtcEngine engine object. This is used in scenarios where the AICallKit SDK API operations do not meet your needs and you must use the atomic API operations of the ARTC SDK.

onAICallEngineRobotStateChanged

Robot Status Synchronization

/**
 * The agent status is synchronized.
 * @param oldRobotState
 * @param newRobotState
 */
void onAICallEngineRobotStateChanged(ARTCAICallRobotState oldRobotState, ARTCAICallRobotState newRobotState);

Parameters:

Parameter

Type

Description

oldRobotState

ARTCAICallRobotState

The previous state.

newRobotState

ARTCAICallRobotState

The new state.

onUserSpeaking

This callback is triggered when the user is speaking.

/**
 * Callback for when the user is speaking.
 * @param isSpeaking Specifies whether the user is speaking.
 */
void onUserSpeaking(boolean isSpeaking);

Parameters:

Parameter

Type

Description

isSpeaking

boolean

Indicates that the user is speaking.

onUserAsrSubtitleNotify

Synchronous user speech recognition

/**
 * Synchronizes the text recognized by ASR from the user's speech.
 * @param text The specific text recognized by ASR.
 * @param isSentenceEnd Specifies whether the current text is the final result for this sentence.
 * @param sentenceId The ID of the sentence to which the current text belongs.
 * @param voicePrintStatusCode The voiceprint recognition status.
 */
void  void onUserAsrSubtitleNotify(String text, boolean isSentenceEnd, int sentenceId, VoicePrintStatusCode voicePrintStatusCode);

Parameters:

Parameter

Type

Description

text

String

The specific text recognized by ASR.

isSentenceEnd

boolean

Specifies whether the current text is the final result for this sentence.

sentenceId

int

The sentence ID.

voicePrintStatusCode

VoicePrintStatusCode

The voiceprint recognition status.

onAIAgentSubtitleNotify

Synchronous response from the agent

/**
 * Synchronizes the agent's response text.
 * @param text The agent's speech.
 * @param end Specifies whether the current response is complete.
 * @param userAsrSentenceId Indicates the LLM content that responds to the speech input with the corresponding sentenceId.
 */
void onAIAgentSubtitleNotify(String text, boolean end, int userAsrSentenceId);

Parameters:

Parameter

Type

Description

text

String

The agent's response.

end

boolean

Specifies whether the current response is complete.

userAsrSentenceId

int

The LLM content that responds to the speech input with the corresponding sentenceId.

onLLMReplyCompleted

The LLM has finished responding to the current call.

/**
 * The LLM has finished answering in the current call.
 * @param text The text output by the LLM.
 * @param userAsrSentenceId The ID of the sentence that answers the user's question.
 * @note This callback provides the complete answer from the LLM to a specific question and is not synchronized with the agent's voice playback. For real-time captions, use onAIAgentSubtitleNotify.
 */
public void onLLMReplyCompleted(String text, int userAsrSentenceId) {}

Parameters:

Parameter

Type

Description

text

String

The text output by the LLM.

userAsrSentenceId

Int

The ID of the sentence that answers the user's question.

onNetworkStatusChanged

Network Status Callback

/**
 * Callback for network status changes.
 * @param uid The ID of the user who joined the channel.
 * @param quality The network quality.
 */
void onNetworkStatusChanged(String uid, ARTCAICallNetworkQuality quality);

Parameters:

Parameter

Type

Description

uid

String

User ID

quality

ARTCAICallNetworkQuality

Network status

onVoiceVolumeChanged

Volume Changes

/**
 * The volume changed.
 * @param uid The user ID.
 * @param volume The volume, from 0 to 255.
 */
void onVoiceVolumeChanged(String uid, int volume);

Parameters:

Parameter

Type

Description

uid

String

User ID

volume

int

The volume, from 0 to 255.

onVoiceIdChanged

The current call's timbre has changed.

/**
 * The voice for the current call changed.
 */
void onVoiceIdChanged(String voiceId);

Parameters:

Parameter

Type

Description

voiceId

String

The voice for the current call changed.

onVoiceInterrupted

The barge-in settings for the current call have changed.

/**
 * The voice interruption setting for the current call changed.
 */
void onVoiceInterrupted(boolean enable);

Parameters:

Parameter

Type

Description

enable

boolean

The voice interruption setting for the current call changed.

onAgentVideoAvailable

Is there an active video stream from the agent (stream ingest)?

/**
 * The agent's video stream is available.
 */
void onAgentVideoAvailable(boolean available);

Parameters:

Parameter

Type

Description

enable

boolean

Specifies whether the agent's video stream is available.

onAgentAudioAvailable

Agent audio is active (stream ingest).

/**
 * The agent's audio stream is available.
 */
void onAgentAudioAvailable(boolean available);

Parameters:

Parameter

Type

Description

enable

boolean

Specifies whether the agent's audio stream is available.

onAudioDelayInfo

Audio loopback latency

/**
         * Audio loopback latency.
         *  @param id The statement ID.
         *  @param delay_ms The latency.
         */
public void onAudioDelayInfo(int id, int delay_ms) {}

Parameters:

Parameter

Type

Description

id

int

The statement ID.

delay_ms

int

The latency.

onAgentAvatarFirstFrameDrawn

First video frame rendering for a digital human

/**
*  The first video frame of the digital human is rendered.
*/
void onAgentAvatarFirstFrameDrawn();

onUserOnLine

User Online Status Callback

/**
*  Callback for when a user comes online.
*/
void onUserOnLine(String uid);

Parameters:

Parameter

Type

Description

uid

String

Callback for when a user joins the channel.

onSpeakingInterrupted

The agent was interrupted while speaking.

public void onSpeakingInterrupted(ARTCAICallSpeakingInterruptedReason reason);

Parameters:

Parameter

Type

Description

reason

ARTCAICallSpeakingInterruptedReason

The reason for the interruption, such as interruption by a specific word.

onVisionCustomCapture

Is the custom frame capture pattern enabled for the current visual understanding call?

public void onVisionCustomCapture(boolean enable)

Parameters:

Parameter

Type

Description

enable

Bool

Enable

onAgentWillLeave

The agent is about to disconnect from the current call.

/**
 * The current agent is about to leave the call.
 * @param reason The reason: 2001 (idle exit), 2002 (human takeover ended), 0 (other).
 * @param message A description of the reason.
 */
void onAgentWillLeave(int reason, String message);

Parameters:

Parameter

Type

Description

reason

int

The reason: 2001 (idle exit), 2002 (human takeover ended), or 0 (other).

message

String

A description of the reason.

onHumanTakeoverWillStart

When a live agent is about to take over from the current agent

public void onHumanTakeoverWillStart(String takeoverUid, int takeoverMode);

Parameters:

Parameter

Type

Description

takeoverUid

String

The human agent's UID.

takeoverMode

Int

1: A human voice is used for the output. 0: The agent's voice is used for the output.

onHumanTakeoverConnected

This callback is triggered when the human agent takeover is connected.

public void onHumanTakeoverConnected(String takeoverUid);

When a human agent is connected

Parameter

Type

Description

takeoverUid

String

The human agent's UID.

onReceivedAgentCustomMessage

Custom Agent Messages

/**
 * A custom message from the agent is received.
 * @param data The custom message body in a JSON string.
 */
public void onReceivedAgentCustomMessage(String data);

Parameters:

Parameter

Type

Description

data

String

The custom message body in a JSON string.

onAgentEmotionNotify

Agent Emotion Notifications

public void onAgentEmotionNotify(String emotion,int userAsrSentenceId);

Parameters:

Parameter

Type

Description

emotion

String

The emotion tag, such as neutral, happy, angry, or sad.

userAsrSentenceId

Int

The ID of the sentence that answers the user's question.

onAgentDataChannelAvailable

This callback is triggered when the agent's message channel becomes available. You can send messages to the agent only after this callback is triggered.

public void onAgentDataChannelAvailable() {}

onReceivedAgentVcrResult

This callback is triggered when a VCR result is received from the current agent. For more information, see ARTCAICallAgentVcrResult.

 public void onReceivedAgentVcrResult(ARTCAICallAgentVcrResult result) {}