Websocket manager error when creating new chat Session

2

I am trying to create a customer chat session from a custom agent control panel with amazon connect. If the agent has no current contacts this works fine. However, if the agent has customer already in their contacts, I get the following error: TypeError: this.websocketManager.closeWebSocket is not a function

code:

var initiateChatRequest = {
            ParticipantDetails: {
                DisplayName: 'John Doe'
            },
            ContactFlowId: contactFlowId,
            InstanceId: instanceId
        };
// get the connection token / ids
        const apiDetails = await fetch(apiGatewayEndpoint, {
            method: 'POST',
            body: JSON.stringify(initiateChatRequest)
        }).then((response)=> {
            if(response.ok){
                return response.json()
            }
            return Promise.reject(response)
          })

        const chatDetails =   apiDetails.data.startChatResult
        // create the chat session
        createChatSession = await connect.ChatSession.create({
            chatDetails: chatDetails,
            type: "CUSTOMER",
           // websocketManager: connect.core.getWebSocketManager()
        });
        // connect the chat session
        await createChatSession.connect().then((response) => {
            console.log("Successful connection: " + JSON.stringify(response));
            return response;
        }, (error) => {
            console.log("Unsuccessful connection " + JSON.stringify(error));
            return Promise.reject(error);
        });

Should I be creating the new chat session in a different way?

質問済み 2年前333ビュー
1回答
0

Hello, I'm unsure on this question. Have you already resolved it? I know it's been a while since you asked. If not, do you mind opening an AWS support case so we can help you dive into the issue and get it resolved?

profile pictureAWS
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ