forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
927 B
30 lines
927 B
2 years ago
|
#!/usr/bin/php -q
|
||
|
<?php
|
||
|
include("bd.php");
|
||
|
include("util/util.php");
|
||
|
|
||
|
$path = "/var/log/asterisk/log_erro_pabx.log";
|
||
|
$canal = trim($argv[1]);
|
||
|
$matricula = trim($argv[2]);
|
||
|
$origemDestino = trim($argv[3]);
|
||
|
|
||
|
try {
|
||
|
if (!$canal || !$matricula || !$origemDestino) {
|
||
|
GeraExcept("Parametros de entrada invalidos, Canal:$canal Matricula: $matricula Origem:$origemDestino");
|
||
|
}
|
||
|
|
||
|
$query = "UPDATE pbx_supervisor_agentes SET status = 'ORIGINANDO' ,canal = '{$canal}',duracao = now(),origem_destino = '{$origemDestino}' WHERE matricula = '{$matricula}'";
|
||
|
if (!pg_query($dbcon, $query)) {
|
||
|
RaiseExcept("Erro ao atualizar Base de dados: Cmd:[{$query}]");
|
||
|
}
|
||
|
$log .= sprintf("Script: %s Exec: OK Data: %s\n", $argv[0], date("Y-m-d H:m:i"));
|
||
|
WriteLog($log, $path);
|
||
|
} catch (Exception $ex) {
|
||
|
$log .= sprintf("Script: %s Data: %s\n", $argv[0], date("Y-m-d H:m:i"));
|
||
|
WriteLog($log, $path);
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|