Intercom mode

Updated at: 2025-03-14 02:12

This topic describes how to use AICallKit SDK to enable intercom mode.

Usage notes

Overview

Enable intercom mode

Switches from natural conversation mode to intercom mode.

45050f7ef32c1acc391ab1b18c7b171e

Start speaking

Presses and holds the Speak button to start communicating with the agent.

lQDPJww8JdHXqQHNCMbNBDiwZR5mz6fv448HV0koHPV0AA_1080_2246

Note

This feature is included in the integration solution with a UI.

How it works

In intercom mode, each input from a user and each response from the intelligent agent are treated as independent events, similar to how traditional intercoms work. This mode makes the interaction between the users and intelligent agent more structured and orderly. In intercom mode, users can communicate with the intelligent agent in a more efficient and organized manner.

API details

API operation

Description

API operation

Description

enablePushToTalk

Enables or disables intercom mode. The status is indicated by the onPushToTalk callback.

startPushToTalk

Presses and holds to start speaking. This call is valid only after intercom mode is enabled. During this period, the agent will remain in the listening state, and what the user says will be displayed in real time.

Note

We recommend that you call this API operation in the press event, and not in the release event.

finishPushToTalk

Releases to finish speaking. The intelligent agent enters the thinking state, and soon broadcasts the results.

cancelPushToTalk

Releases to cancel speaking. The intelligent agent does nothing and immediately returns to the waiting state of holding down to start speaking.

Sample code

Android
Web
// By default, intercom mode is disabled. In this example, true is passed to enable intercom mode.
mARTCAICallEngine.enablePushToTalk(enable: true)

// Press and hold to start speaking.
mARTCAICallEngine.startPushToTalk()

// Release to finish speaking.
mARTCAICallEngine.finishPushToTalk()

// Release to cancel speaking.
mARTCAICallEngine.cancelPushToTalk()

// Handle callback events.
ARTCAICallEngine.IARTCAICallEngineCallback mCallEngineCallbackWrapper = new ARTCAICallEngine.IARTCAICallEngineCallback() {
    
    @Override
    public void onPushToTalk(boolean enable) {
        // Indicate whether the onPushToTalk callback is configured for the current call.
        // The onPushToTalk callback will tell you if intercom mode has been enabled or disabled.
    }
}
// By default, intercom mode is disabled. In this example, true is passed to enable intercom mode.
engine.enablePushToTalk(enable);

// Press and hold to start speaking.
engine.startPushToTalk();

// Release to finish speaking.
engine.finishPushToTalk();

// Release to cancel speaking.
engine.cancelPushToTalk();

engine.on('pushToTalkChanged', (enable) => {
  // Indicate whether the onPushToTalk callback is configured for the current call.
  // The onPushToTalk callback will tell you if intercom mode has been enabled or disabled.
  console.log('AICallPushToTalk', enable);
});

  • On this page (1, T)
  • Usage notes
  • Overview
  • How it works
  • API details
  • Sample code
Feedback