簡體   English   中英

將工作室流程重定向到前線

[英]Redirect studio flow to Frontline

我有一個 Studio Flow,可以發送和接收來自 whatsapp 用戶的消息,以提供某種支持中心。

在此處輸入圖像描述

我現在需要的是,如果用戶在 whatsapp 消息上回復“連接到代理”選項,則流程會將對話重定向到 Twilio Frontline。

我使用 Twiml 響應來重定向:

<Response>
    <Connect>
        <Conversation serviceInstanceSid="ISdb207483328841f7a849739ded09bdea" />
      </Connect>
</Response>

但它不起作用,Frontline 沒有創建對話

有沒有人設法做到這一點?

我相信您需要創建一個函數來將此對話發送給特定的 Frontline 代理,請遵循可用於使用 Twilio Function 將隨機代理添加到對話的代碼示例

const users = await twilioClient.conversations.users.list();

const randomWorkerIndex = Math.floor(Math.random() * users.length);

//adding the agent to conversation
const agent = await conversation.participants().create({
  identity: users[randomWorkerIndex].identity,
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM