I am trying to add delay between two incoming calls. eg. worker get first incoming call and he rejects it. then second incoming call should only assigned to the same worker after certain timeframe(eg. 2 sec).
Asked
Active
Viewed 69 times
1 Answers
0
Twilio developer evangelist here.
When you reject a reservation in the JS SDK you can set a activity SID which the worker will be placed into once the rejection is complete. If you set that activity SID to be an Activity which is marked as not available then the worker won't receive any further reservations while in that activity.
You could then set a timer to update the activity again, so that the worker becomes available to receive reservations again.

philnash
- 70,667
- 10
- 60
- 88
-
This is correct. I also came up with another way by using worker attributes. by making worker availibility true and false and also using workflow expression or taskQueue expression.so when we reject call we will update attribute with false and for the same attribute we will also add expression in workflow or taskqueue so when it is false twilio won't be assigning call to that worker. after certain timeout we will update it to true and so worker will be available to assigning call. – Nikunj Pithadiya Aug 26 '21 at 09:37
-
I guess that would work too. I think using activities will avoid you having to do anything to the workflow, so could simplify things slightly. – philnash Aug 27 '21 at 00:23