amazon-connect / amazon-connect-streams

Amazon Connect Streams - a browser-based contact center integration API, typically with CRM systems.
https://docs.aws.amazon.com/connect/latest/userguide/
Apache License 2.0
388 stars 311 forks source link

Issue with Monitoring Agent Chats Using Amazon Connect Streams API #919

Open SaqibOctave opened 2 weeks ago

SaqibOctave commented 2 weeks ago

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.

seiyako commented 2 weeks ago

Hi, did you load ChatJS as well?

SaqibOctave commented 2 weeks ago

hi @seiyako Yes, I have added the Chat_js streams as well, My whole functionality works perfect in normal cases but errors occure while monitoring

SaqibOctave commented 2 weeks ago

@jagadeeshaby

SaqibOctave commented 2 weeks ago

Hi @seiyako this is what i am doing 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)

            });
            and i got this
            Media Controller is no longer available for this connection.