This guide covers the controls available on a live voice call - muting the microphone, placing the call on hold, sending DTMF tones, and disconnecting - applicable to both inbound and outbound voice interactions.
Personas: Agent - controls their live voice call (mute, hold, DTMF, disconnect).
Voice call controls are available on any Interaction where communicationType === InteractionCommType.PHONE and the call leg is active (i.e. after InteractionEventType.INTERACTION_CALL_ESTABLISHED has fired). Each control is gated by a can*() method that evaluates platform rules and current call state (always check before invoking).
Call state changes (mute, hold) triggered by any surface (another tab, a supervisor, the platform) surface as events on the interaction. Subscribe to these events to keep your UI authoritative.
communicationType === InteractionCommType.PHONE.Both are simple toggles with a corresponding can*() gate. Subscribe to the events to drive UI state when changes are done externally (supervisor, system or other tab):
// Mute / Unmute
if (interaction.canMute()) {
await interaction.mute();
}
if (interaction.canUnmute()) {
await interaction.unmute();
}
// Hold / Resume
if (interaction.canHold()) {
await interaction.holdCall();
}
if (interaction.canResume()) {
await interaction.resumeCall();
}
// Subscribe to state changes (those triggered externally)
interaction.subscribe(InteractionEventType.INTERACTION_CALL_MUTED, () => showMuteIndicator());
interaction.subscribe(InteractionEventType.INTERACTION_CALL_UNMUTED, () => hideMuteIndicator());
interaction.subscribe(InteractionEventType.INTERACTION_CALL_HELD, () => showHeldBanner());
interaction.subscribe(InteractionEventType.INTERACTION_CALL_RESUMED, () => hideHeldBanner());
Interaction.sendDtmf is synchronous (returns void, not a Promise) and immediately dispatches the tone into the active call. Gate on Interaction.canSendDtmf before calling. Accepted digits: 0-9, *, #, a-d, and A-D.
if (interaction.canSendDtmf()) {
interaction.sendDtmf("1");
}
Use this to navigate IVR menus when the agent transfers to an external number.
Interaction.disconnectCall hangs up the voice leg. The interaction itself moves to wrap-up - it is not yet closed. Gate on Interaction.canDisconnectCall:
if (interaction.canDisconnectCall()) {
await interaction.disconnectCall();
showWrapUpPanel();
}
// Customer or platform can also disconnect at any time - handle externally-initiated disconnects
interaction.subscribe(InteractionEventType.INTERACTION_CALL_DISCONNECTED, () => {
showWrapUpPanel();
});
await interaction.disconnectCall() resolves only after the server confirms the disconnect, so UI state driven from the resolved promise is safe. The subscription covers the external case (customer or platform hanging up) where your code never calls disconnectCall() at all.
Failures surface as typed AvayaInfinityAgentSdkErrors with stable codes from AvayaInfinityAgentSdkErrorCodes. Errors that occur on the call control path belong to the ASE_4xxx family - match error.code against AvayaInfinityAgentSdkErrorCodes to identify the specific failure. If no specific code applies, the SDK falls back to ASE_4000.
Mid-call voice failures (network drop, media error, platform hangup) surface asynchronously as InteractionEventType.INTERACTION_CALL_FAILED on the interaction - not as a rejection on the control methods. Subscribe to that event to surface a recovery UI.