twilio-professional-services / plugin-chat-sms-transfer Goto Github PK
View Code? Open in Web Editor NEWTransfer Chat/SMS Tasks in Twilio Flex
Transfer Chat/SMS Tasks in Twilio Flex
Hi I'm getting this error and don know were to look to solve it
Error: only absolute urls are supported
at plugin-chat-sms-transfer.js:11501
at new Promise ()
at new Fetch (plugin-chat-sms-transfer.js:11496)
at Fetch (plugin-chat-sms-transfer.js:11487)
at transferOverride (plugin-chat-sms-transfer.js:30222)
at plugin-chat-sms-transfer.js:30206
at e. (twilio-flex.min.js:142)
at twilio-flex.min.js:142
at Object.next (twilio-flex.min.js:142)
at twilio-flex.min.js:142
at new Promise ()
at r (twilio-flex.min.js:142)
at e.invokeAction (twilio-flex.min.js:142)
at Object. (twilio-flex.min.js:142)
at twilio-flex.min.js:142
at Object.next (twilio-flex.min.js:142)
at twilio-flex.min.js:142
at new Promise ()
Hello,
when trying to transfer a chat to agent or queue I get spinning wheel and nothing happens, no error in Debugger, no error in Web Browser Console (see image below).
The only action I can do is to end the chat , if I try to transfer it again to queue or agent, still spinning wheel.
Any idea what could be the issue?
Max
It might be a good idea to change taskSid
attribute of messages channel after creating a new task.
Especially if you want to use this plugin in conjunction with:
https://github.com/twilio-professional-services/example-customer-end-chat
/*
let newAttributes = JSON.parse(originalTask.attributes);
.........
.........
let newTask = await client.taskrouter.workspaces(__).tasks.create(__);
*/
const originalChannel = await client
.chat
.services(context.TWILIO_CHAT_SERVICE_SID)
.channels(newAttributes.channelSid)
.fetch();
let channelAttributes = JSON.parse(originalChannel.attributes);
channelAttributes.taskSid = newTask.sid;
await client
.chat
.services(context.TWILIO_CHAT_SERVICE_SID)
.channels(newAttributes.channelSid)
.update({ attributes: JSON.stringify(channelAttributes)});
but, it requires additional environment variable.
Hi,
We are assigning the task to a queue instead of an agent, the task won't get assigned to an agent in the queue instead the task is assigned back to someone else in the old queue.
Thanks...
Apologies if this is the wrong channel for suggestions.
In transfer-chat.js
, we have:
// create New task
let newTask = await client.taskrouter.workspaces(context.TWILIO_WORKSPACE_SID).tasks.create({
taskChannel: originalTask.taskChannelUniqueName,
attributes: JSON.stringify(newAttributes)
// workflowSid: 'WWxxx'
// Might need to add workflowSid
});
According to TaskRouter docs, "If there is only one Workflow defined for the Workspace that you are posting a task to, then this is an optional parameter, and that single workflow will be used."
Might be a good idea to add a comment there to let a user know that they might need to pass an additional workflowSid
property.
Thanks! :)
Hi there,
I am receiving the below CORS rejection when attempting to transfer. I'm sure I am missing something, but not sure where to look. Can anyone point me in the right direction? Thanks!
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at [my-twiloi-url]. (Reason: header ‘user-agent’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response).
Will raise PR to fix.
Is there a way to migrate this plugin to "@twilio/flex-ui" version: "^2.0.0" ??
npm start
it should say twilio flex:plugins:start
since I believe it was upgraded to CLI v4npm run ...
refs (scripts not in package.json)functions
dir, the Function URL will be: https://plugin-chat-sms-transfer-**functions**-xxxx-dev.twil.io/transfer-chat (from /functions/package.json)The Twilio Channel Janitor Service is responsible for cleaning up chat channels for completed chat tasks.
If enabled on your Flex Flow, the transfer plugin will not work because the Channel Janitor Service thinks the channel is stale as soon as the initial agent initiates the transfer.
I can implement the transfer to individual agent rule with one filter and one expression
transferTargetType == 'worker'
and worker.sid == task.targetSid
respectively.
However, I can't figure out how to dynamically route to a queue without making a filter rule for each one and checking for task.targetSid == WQ6407...
(btw, please add #15 answer to the documentation, as it seem required and undocumented)
Otherwise, it's working great!
plugin-chat-sms-transfer % npm start
> [email protected] prestart /Users/mbermudez/plugin-chat-sms-transfer
> flex-check-start
ERROR Could not find public/appConfig.js.
Check your public/ directory for appConfig.example.js, copy it to appConfig.js and modify your Account SID and Service Base URL.
@johnfischelli - I can submit a PR for this, but want to add my GH-specific tutorial notes here.
Flex uses the Twilio Chat product under the hood to service the chat communication channel. The Twilio Chat product has a limitation of the number of chat channels and chat user can join. Flex sets up a chat channel for each task that is handled by an agent and automatically joins them to the channel, and handles removing them from the channel upon task completion.
Transfers were not natively supported by Flex on the chat channel (voice is 👍 ) and I aimed to solve that gap by introducing this plugin. Unfortunately one approach we initially used to handle how Flex treats chat channels and chat users during transfers resulted in agents never leaving the chat channel.
Transfer too many chat tasks, and eventually the Twilio Chat product starts to prevent you from joining more chat tasks.
Hi, I am having an issue. When an agent transfers one chat to another agent, he still hears every message that comes from that chat. The Flex plugin is receiving events corresponding to the previous chat that was already transferred. This is my code:
manager.conversationsClient.on("messageAdded", (event) => {
console.log({eventMessage: event})
alertSound2.play();
});
I am using Flex version 2.5.1.
Thanks in advance.
after I click the transfer, the loading sign pop out.
loading loading loading loading...................
It doesn't work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.