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.
25 lines
713 B
25 lines
713 B
#!/usr/bin/php -q |
|
<?php |
|
include("bd.php"); |
|
include("util/util.php"); |
|
|
|
$TBL_AGENTES = "pbx_supervisor_agentes"; |
|
$path = "/var/log/asterisk/log_erro_pabx.log"; |
|
$p1 = trim($argv[1]); |
|
|
|
try { |
|
if (!$p1) { |
|
GeraExcept("Parametros de entrada invalidos, Arg1:$p1"); |
|
} |
|
|
|
$query = "UPDATE $TBL_AGENTES SET intercalar = '0' WHERE ramal = '$p1'"; |
|
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); |
|
}
|
|
|