Agents in our call center all have a corporate Google Crome Extension installed in their browser. The extension needs to be able to accurately determine when the agent has started a call in Purecloud, when that call has ended, and retrieve the conversation ID and interaction ID for the given call at each of those points.
Currently, we are using the JS SDK to create a channel and subscribe to the v2.users.{id}.conversations.call
topic.
When an event is received, we grab data.eventBody.participants
. From there, we have to loop over the participants array checking what type of participant each is (external, ivr, or user), then for each participant we have to inspect their details to tell what state the call it self is in.
These checks require a lot of logic in our code to determine call state, especially when calls are transferred around as each transfer adds another participant to the participants array for the next user.
This process is quite arduous. Is there a better way to simply be notified via javascript when an Agent starts and ends a call and retrieve the conversation ID and interaction ID for the given call at each of those points?