Hey everyone,
I’m working on a custom IVR overlay for our agents using the Genesys Cloud JavaScript SDK. We need a way for the agent to mute/unmute their microphone directly from our external UI, rather than relying on the default softphone controls. The goal is to sync this state with our CRM dashboard.
I’ve got the GenesysCloudWebMessaging and GenesysCloudTelephony modules initialized. I can successfully join a conversation and get the conversationId. The tricky part is finding the right method to toggle the audio stream.
I tried calling telephonyClient.audio.setMuted(true) on the active conversation object, but it throws a TypeError: Cannot read properties of undefined (reading 'setMuted'). I also looked into the REST API, but the available endpoints for conversations seem to be limited to messaging integrations and recording states (like PUT /api/v2/conversations/cobrowsesessions/{conversationId}/recordingstate), which don’t offer a direct way to toggle the local microphone mute state from the system side.
Here’s what my current setup looks like:
const telephonyClient = genesyscloud.telephony;
const activeCall = telephonyClient.activeCall;
// This fails
try {
activeCall.audio.setMuted(true);
} catch (err) {
console.error("Mute failed:", err);
}
The error log just says the method is undefined. I checked the SDK docs, but the examples are mostly for Web Messaging, not Voice. Is there a specific property on the activeCall object that exposes the audio controls? Or do I need to use a different API call entirely to just toggle the local mute state without affecting the conversation participant status?
Any pointers would be appreciated. We’re on the latest SDK version (2.10.x). I’m in PST, so replies might be a few hours out.