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 endpoint PATCH /api/v2/conversations/voice/{id}/participants/{id} with a body like { "muted": true }, but that seems to mute the agent from the system side, not just their local mic, and it feels heavy-handed for a UI toggle.
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.