request("/$ApiVersion/Accounts/$AccountSid/Calls/$callSid", "POST", array( "CurrentUrl" => $url."accept_twiml.php" // the URL you want to redirect to )); if($response->IsError) { $err = urlencode($response->ErrorMessage); header("Location: accept.php?CallSid=$callSid&msg=$err"); die; } else { /* redirect back to the main page with CallSid */ $msg = urlencode("Call Removed from Queue... "); header("Location: completed.php?CallSid=$callSid&msg=$msg"); die; } } ?>