hitagi-entrada/hitagi-entrada.php

45 lines
1014 B
PHP
Raw Normal View History

2024-12-12 19:27:10 +00:00
#!/usr/bin/php -q
2024-12-12 14:00:09 +00:00
<?php
2024-12-12 18:39:48 +00:00
require 'vendor/autoload.php';
require 'includes/wrapper-noswoole.php';
2024-12-12 14:00:09 +00:00
2024-12-14 01:14:11 +00:00
use Hitlabs\Hitagi\AGIEntrada;
2024-12-12 14:00:09 +00:00
$stdin = fopen('php://stdin', 'r');
$stdout = fopen('php://stdout', 'w');
2024-12-16 19:01:16 +00:00
$fgId = (isset($argv[1])) ? $argv[1] : null; // Numero do DID
$hostname = (isset($argv[2])) ? $argv[2] : gethostname();
$hostip = (isset($argv[3])) ? $argv[3] : 'localhost';
// $fgId = '8999';
// $hostname = 'hitpbx-050';
// $hostip = '177.107.205.248';
2024-12-12 18:39:48 +00:00
$logEnabled = true;
2024-12-14 01:14:11 +00:00
$isXampp = file_exists('C:\xampp');
2024-12-12 14:00:09 +00:00
$appdir = dirname(__FILE__);
2024-12-16 19:01:16 +00:00
2024-12-12 14:00:09 +00:00
chdir($appdir);
date_default_timezone_set('America/Bahia');
2024-12-14 01:14:11 +00:00
$agientrada = new AGIEntrada(
2024-12-12 14:00:09 +00:00
array(
'agiRunCmd' => agiRunCmdWrapper($stdin, $stdout),
2024-12-14 01:14:11 +00:00
'agiLog' => agiLogWrapper()
2024-12-12 14:00:09 +00:00
),
array(
2024-12-12 18:39:48 +00:00
'fgId' => $fgId,
2024-12-16 19:01:16 +00:00
'hostname' => $hostname,
'hostip' => $hostip,
2024-12-12 18:39:48 +00:00
'logEnabled' => $logEnabled,
'appdir' => $appdir,
'isXampp' => $isXampp
2024-12-12 14:00:09 +00:00
)
);
$agientrada->run();
fclose($stdin);
fclose($stdout);
2024-12-16 19:01:16 +00:00
exit();