Skip to content

Commit

Permalink
Properly extract sid from everyone queue for direct conversations tra…
Browse files Browse the repository at this point in the history
…nsfers
  • Loading branch information
stephenhand committed Nov 5, 2024
1 parent db1d3a6 commit f2e13c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions functions/transferChatStart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,16 @@ export const handler = TokenValidator(

let newTaskSid;
if (isConversation && transferTargetType === 'worker') {
console.info(
`Transferring conversations task ${taskSid} to worker ${targetSid} by creating interaction invite.`,
console.debug(
`Transferring conversations task ${taskSid} to worker ${targetSid} - looking up queues.`,
);
// Get task queue
const taskQueues = await client.taskrouter
.workspaces(context.TWILIO_WORKSPACE_SID)
.taskQueues.list({ workerSid: targetSid });

const taskQueueSid =
taskQueues.find((tq) => tq.friendlyName === DIRECT_TRANSFER_QUEUE_FRIENDLY_NAME) ||
taskQueues.find((tq) => tq.friendlyName === DIRECT_TRANSFER_QUEUE_FRIENDLY_NAME)?.sid ||
taskQueues[0].sid;

console.info(
Expand Down

0 comments on commit f2e13c5

Please sign in to comment.