$query = "select status,matricula,dac,replace(upper(modo_atendimento),'Á','A') as modo_atendimento from pbx_supervisor_agentes where ramal = '$ramal' and org_id = $org_id";
$result = pg_query($dbcon, $query);
$row = pg_fetch_array($result);
@ -66,7 +69,8 @@ switch ($tipo) {
$consulta = substr(strrchr(read(), "("), 1, -1);
if (strtoupper($row["status"]) != "PAUSA") {
$ramal = $argv[2];
write("DATABASE GET ORG_RAMAL " . $argv[2]);
$ramal = substr(strrchr(read(), "("), 1, -1);
$bina = $argv[3];
$idorigem = $argv[4];
$canal_agente = $argv[5];
@ -90,9 +94,11 @@ switch ($tipo) {
//Roda em atendimento manual, apos o agente atender a chamada
case 'FILA':
$canal_agente = $argv[2];
$ramal = $argv[3];
$query = "select matricula from pbx_supervisor_agentes where ramal = '$ramal' and org_id = $org_id";
write("GET VARIABLE CALLERID(num)");
$ramal = substr(strrchr(read(), "("), 1, -1);
$query = "select matricula from pbx_supervisor_agentes where ramal = '$ramal' and org_id = $org_id";
// * Não é necessario invocar este script, agente_dial.php já cumpre esta função.
// */
// return;
// /*
// * Trata classificação
// * Verifica se a classificação esta ativa
// * Verifica se é exigida a classificação
// */
//
// $query = "select b.prm_agente_classifica, a.exige_classificacao as prm_exige_classificacao
// from pbx_queues_grupos a, pbx_parametros b
// where nome = (select dac from pbx_supervisor_agentes where matricula = '$matricula')";
//
//
// $result = pg_query($conexao, $query);
// $dados = pg_fetch_row($result);
// if ($dados[0] && $dados[1]) {
// /*
// * Registra a obrigatoriedade da classificação para o agente logado quando configurado.
// */
// $query = "insert into pbx_registra_classificacao(id_dac, matricula, rgc_entrada, uid, id_login, reg_proc)values((select id from pbx_dacs where nome = (select dac from pbx_supervisor_agentes where matricula = '$matricula')), '$matricula', now(), '$uniqueid', (select max(id) from pbx_eventos_agentes where matricula = '$matricula' ), 'info_agente.php')";