I am using Twilio Task router.
I have been stuck in issues and there is no free support from twilio side.
I am trying to update the call to the new TWMIL URL but when I do the task is wrapped up and completed automatically.
How can I prevent the task from being completed while updating the call? Here is how I update the call for both legs parent and child.
$twilio->calls($callData['call_sid'])->update([
"method" => "POST",
"url" => url('Twiml URL'),
]);
From my understanding, what you have described is by design according to the Lifecycle Task State document. The image diagram shows that a call that is marked as completed will transition the task to the Completed state. Redirecting a call can end a call leg as it is redirected to a new call leg.
In addition, the written docs say:
It only shows "reservation.conference" but other activities will complete a task.
The taskrouter tasks are really only meant to be transient and not long lived. Redirecting is a handling of the task since it often results in a new or different call leg.
If you really need the task to stay active you could create another task after you redirect and then assign that new task to the worker.
Also, and I haven't tried this, but if you manually create the tasks then it probably won't end after you redirect the call.