repositório com os arquivos utilizados para integração entre o sistema SimplesIP e diversos sistemas.
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.
 
 

46 lines
1.7 KiB

<?php
require 'Zendesk.php';
$registros = array(
"id" => '',
"reg_ura" => $ura,
"reg_tronco" => $tronco,
"reg_uniqueid" => $uid,
"reg_id_metodo" => $idMetodo,
"reg_uniqueid" => $uid,
"reg_uniqueid_old" => $uidOld,
"reg_fone" => $numero,
"reg_status_exec" => '1',
"reg_inicio" => date());
$connPG = pg_connect(GetDefStrDb());
//$zd = new Zendesk("leandro.gabriel@al5bank.com.br/token:dRP3HcmtvRNw6aUp2py1rcjADFDfaWfg7s4p7LZE", "al5bank", true);
$zd = new Zendesk("atendimento@al5bank.com.br/token:dRP3HcmtvRNw6aUp2py1rcjADFDfaWfg7s4p7LZE", "al5bank", true);
$zd->db()->setRegistros($registros);
if ($zd->agi()->get_variable('GEN_PROTOCOLO', true)) {
$protoAgente = $zd->agi()->get_variable('GEN_PROTOCOLO', true);
} else {
$protoAgente = GeraProtocolo($connPG, $uid);
$zd->agi()->set_variable('GEN_PROTOCOLO', $protoAgente);
$itgcTela = array(
"PROTOCOLO_SAC" => $protoAgente
);
$createTicket = $zd->openTicket(45, 'Atendimento Telefone AL5 Ouvidoria',
"Protocolo Atendimento: " . $zd->agi()->get_variable('URA', true) .
"\n Protocolo Ouvidoria: " . $zd->agi()->get_variable('GEN_PROTOCOLO', true) .
"\n\n Mensagem: Ticket aberto pela central telefonica.", 'urgent', str_replace('-', '', $protoAgente));
$zd->integracaoAgente($itgcTela, array('PROTOCOLO_SAC'));
}
$vocaliza = str_split($protoAgente);
foreach ($vocaliza as $value) {
$zd->agi()->say_digits($value);
}
$zd->agi()->exec_goto($zd->db()->getURA('INT_REPETE_PROTOCOLO_OUVIDORIA'));
$zd->db()->atualizaIntegracao();
?>