<?PHP

  require_once('phpagi.php');

  declare(ticks = 1);
  function sig_handler($signo)
  {
    //Put your cleanup commands here
    global $asm;

    if (isset($asm)) {
      $asm->exec('NoOp', '"Received SIGHUP. Exiting."');
      $asm->destroy();
    }

    exit(0);
  }

  pcntl_signal(SIGHUP, "sig_handler");

  $asm = new AGI();

  $test=1;
  while ($test==1) { 
  $asm->exec('Dial', '"SIP/michelv_pc,5"');
  }

  $asm->destroy();
  exit(0);

?>

