Skip to content

Instantly share code, notes, and snippets.

@hunnycode
Created May 25, 2017 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hunnycode/9695f9443ef8634cf9b2fbba9fb6f5aa to your computer and use it in GitHub Desktop.
Save hunnycode/9695f9443ef8634cf9b2fbba9fb6f5aa to your computer and use it in GitHub Desktop.
<?php
$numbers = array("<number to call n>", "<number to call n>", "<number to call n>");
$number_index = isset($_REQUEST['number_index']) ? $_REQUEST['number_index'] : "0";
$DialCallStatus = isset($_POST['DialCallStatus']) ? $_POST['DialCallStatus'] : "";
header("content-type: text/xml");
if($DialCallStatus!="completed" && $number_index == 2){
$number_index = 0;
}
if($DialCallStatus!="completed" && $number_index<count($numbers)){
?>
<Response>
<Dial callerId="+8150xxxxyyyy" timeout="10" action="callscreen.php?number_index=<?php echo $number_index+1 ?>">
<Number>
<?php echo $numbers[$number_index] ?>
</Number>
</Dial>
</Response>
<?php
} else {
?>
<Response>
<Hangup/>
</Response>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment