Hey folks,
I’m trying to control the agent’s microphone state directly through the Genesys Cloud JavaScript SDK (specifically the @genesyscloud/webclient-sdk or the newer platform-client if that’s even possible for this). We’ve got a custom softphone UI where the agent might mute themselves via a third-party hardware button, and we need the Genesys client to reflect that state immediately without them clicking the mute button in the standard widget.
I’ve been digging through the documentation for the Conversation object. I see methods like conversation.mute() but those seem tied to the UI component’s internal state rather than a direct API call I can trigger from outside the widget context. When I try to access the underlying call object and call muteAudio(), it throws a type error because the method isn’t defined on the returned promise.
Here’s what I’ve got so far:
const { Conversation } = require('@genesyscloud/webclient-sdk');
// Attempting to get the active call
const activeCall = Conversation.getInstance().getActiveCall();
if (activeCall) {
console.log('Active call found:', activeCall);
// This fails
activeCall.muteAudio(true);
} else {
console.log('No active call');
}
The error I’m seeing in the console is TypeError: activeCall.muteAudio is not a function.
Is there a specific method I’m missing on the Call or Conversation instance to programmatically toggle the mic? Or do I have to resort to simulating a click on the DOM element (which feels hacky and brittle)?
Thanks.