Building a custom control panel for our agent desktop extension. I need to programmatically mute and unmute the agent’s microphone during an active call.
I’m using the JavaScript Embeddable Client App SDK. I can see the conversation object in the SDK state, and I’ve tried calling conversation.mute() on the active call instance. The call object looks correct, but the mute state doesn’t change in the UI or the actual audio stream.
Here’s the code snippet I’m using:
const activeCall = sdk.conversations.activeCall;
if (activeCall) {
activeCall.mute();
console.log('Mute requested');
}
The console logs the message, but no error is thrown. The agent remains audible. I’ve also tried accessing the media object directly, but it seems read-only in this context.
I checked the API docs for the REST endpoint PATCH /api/v2/conversations/calls/{id} which accepts a mute parameter, but I’d prefer to handle this client-side if possible to avoid latency.
Is there a specific method on the conversation object I’m missing? Or do I have to fire a REST request from the client app to toggle the mute state? I’ve tried activeCall.media.mute = true as well, but that doesn’t seem to trigger the state change event properly.