PABX criado para pesquisas
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.
 
 
 
 
 
 

33 lines
896 B

<?php
include_once '/var/lib/asterisk/scripts/integracao/localDataBase.php';
function GetConfigIntegracao($db, $nomeIntegracao, $params) {
$query = "select itgc_nome, itgc_host, itgc_port, itgc_database, itgc_user, itgc_password, opcao, acao from pbx_integracao_configuracao where itgc_nome = '$nomeIntegracao'";
$result = pg_query($db, $query);
if (!$result || !pg_num_rows($result)) {
return array();
}
$row = pg_fetch_array($result, null, PGSQL_ASSOC);
$config = array();
foreach ($params as $param) {
$config[$param] = $row[$param];
}
return $config;
}
function RegistraInfo($metodo, $a, $script, $erro = false) {
$msg = $a;
if (is_array($a)) {
$msg = '';
foreach ($a as $key => $value) {
$msg .= sprintf("%s: %s\n", $key, $value);
}
}
__logStr($metodo, $msg, $script, $erro);
}