I need to modify current in-progress call. if A calls B, they are connected and have a talk, I need to redirect B to some Twiml URL, and to disconnect A from call (I can do this via JavaScript SDK .diconnect() function, since I am the "A" caller). I am using an example from Twilio docs (php SDK v4.x):
$call = $client->account->calls->get($callsid);
$call->update(array(
"Url" => "http://path-to-twiml.php",
"Method" => "POST"
));
but nothing happens. Is it possible to somehow do what I need without using Conference Twilio options?
PS: adding "Status" => "complete" parameter to update options causes disconnect for both sides of a call, since I need to disconnect only 1 (the one who initiated the call) and to leave other (redirected to specific twiml url)
Twilio.Device.connect(function (conn) { callsid = conn.parameters.CallSid; });
and then send it to php through ajax. – Yuri Shmelev