我計劃建立一個連續撥號twilio程序和到目前爲止,我的代碼一點點,我有點卡住....我應該怎麼做或者我可以做,使Twilio呼叫數字,如果這個數字犯規拿起調用數組中的下一個數字,如果數字犯規拿起電話另一號碼....twilio PHP的連續撥號
<?php
require "twilio.php";
// initiate response library
$response = new Response();
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$PhoneNumbers= array('4167841543','6478704858');
$variableToCall=$PhoneNumbers[0];
if(($_REQUEST['DialStatus'] == "busy" || $_REQUEST['DialCallStatus'] == "no-answer" || $_REQUEST['DialCallStatus'] == "failed" || $_REQUEST['DialCallStatus'] == "canceled")) {
$variableToCall=$PhoneNumbers[1];
}
?>
<Response>
<Dial> <?php echo $variableToCall ?> </Dial>
</Response>