Legacy Dev Forum Posts

 View Only

Sign Up

How to make chatbot handle multiple conversations transfer?

  • 1.  How to make chatbot handle multiple conversations transfer?

    Posted 06-05-2025 18:49

    leochan | 2019-09-09 08:43:51 UTC | #1

    Hi,

    I have built an Microsoft chatbot following the example on https://bitbucket.org/eccemea/mypurecloud-bot-dialogs2/src/master/ The bot itself could funtion well until the users require transfer to Purecloud agent. It failed to initiate a separate chat session for the agent when more than one users required transfer. All messages from different users are routed to the same session.

    Could someone give me a hint on how to handle chatbot mulltiple conversation transfer? Is the problem associated with the bot side or with the purecloud api side?

    Thanks!


    tim.smith | 2019-09-09 16:41:18 UTC | #2

    @Szlaski_Daniel can you help with this question about the bot example?


    Szlaski_Daniel | 2019-09-10 07:33:59 UTC | #3

    Hi Leochan,

    I didn't try to run this example with multiple users support, but what you need to take care is multiple web sockets. Currently when you initiate new ChatSession, after it's created results are assigned to the 1 global const WebSocket.

    Line 64: ` webSocket = new WebSocket(info.eventStreamUri);`

    I believe you should give a try to build local array of objects (WebSockets) for each new conversation from Bot side. Once you'll have such array, in case of new transfer req , you initiate new Chat Session and assign results to dedicated WebSocket from an array. That should give you possibility to handle multiple async messages from different WebSockets / conversations. The same rules goes for outbound messages (from Customer to PureCloud Agent), you've got saved in master array all conversation details (ChatId , AgentId, conversationId) so you should know where to send messages.

    Regards, Daniel


    system | 2019-10-11 07:34:02 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 5987