Issue with Monitoring Agent Chats Using Amazon Connect Streams API

0

Hi,

I'm developing a custom supervisor dashboard using the Amazon Connect Streams API. The dashboard is designed to enable supervisors to monitor voice calls and chat interactions of agents. While the voice call monitoring and barge-in functionalities are working perfectly, I'm encountering an issue when trying to monitor chat sessions.

contact.getAgentConnection().getMediaController()

According to the documentation, getMediaController() should return the chatController promise for chat monitoring. However, when I attempt to monitor an agent's chat session, I receive the following error:

Media Controller is no longer available for this connection.

I'm not sure why this error is occurring. The voice monitoring works as expected, but chat monitoring fails with this error. Has anyone else encountered this issue or know what might be causing it? Any insights or suggestions on how to resolve this would be greatly appreciated.

S_Ali
asked 18 days ago50 views
1 Answer
0

Check the timing of your function calls. Make sure getMediaController() is invoked as soon as the chat session starts or when you need to monitor it, and not after the session ends.

Ensure that the session is active and valid before attempting to monitor it. You might need to handle reconnection or re-establishment of the session if it expires or disconnects unexpectedly.

Verify that you are indeed accessing the correct agent connection for the chat interaction. Ensure that contact.getAgentConnection() returns the connection specific to the chat session.

Make sure you are using the latest version of the Amazon Connect Streams API.

Test the functionality across different browsers and network conditions. Also, check for any errors or warnings in the browser's developer console that might provide more context.

profile pictureAWS
EXPERT
Deeksha
answered 18 days ago
  • Thansk Deekshitha, chat is active and agent is activly interacted with customer when i hit the monitor button on my custom dashboard. first i check the connection type with this method contact.getAgentConnection().getStatus().type === 'silent_monitor' after that i call contact.getAgentConnection().getMediaController() and when i console it give above error that i have mentioned in normal case it works fine and i have written the full functionality on that method.

  • hi @Deekshitha Urs this is what i am doing contact.onConnected(async (contact: any) => { this._timerService.startTimer(contact.contactId);

      this._snackBar.dismiss();
    
      var conns = contact.getConnections();
    
      if (contact.getAgentConnection().getMediaType() === "chat") {
    
        if(contact.getAgentConnection() && contact.getAgentConnection().getStatus().type === 'silent_monitor'){
    
          console.log("[Chat Controllers ] >>  agent connectipon", contact.getAgentConnection())
    
         
            // chat users
                contact.getAgentConnection().getMediaController()
                .then((controller : any)=>{
                 console.log("[Chat Controllers ] >>  controller", controller)
                }).catch((error)=>{
                 console.log("[Chat Controllers ] >>  controller", error)
    
                });
    

    Can you please help me to figure out the issue?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions