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.
 
 

57 lines
2.0 KiB

<?php
include 'HubSoft.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());
$hub = new HubSoft(
CONF_URL_API,
CONF_USERID_API,
CONF_TOKEN_API,
CONF_USER_API,
CONF_PASSWORD_API,
CONF_LOGGER_ATIVO
);
$hub->db()->setRegistros($registros);
if (CONF_AUDIO_ERROR) {
$hub->db()->setIdAudioError(CONF_AUDIO_ERROR);
}
$documento = $hub->agi()->get_variable('URA', true);
$retorno = $hub->identificarDocumento($documento);
$reg_pass = $hub->agi()->get_variable("REG_PASS", true);
// INFORMACOES ESSENCIAIS
$hub->agi()->set_variable('CODCLIENTE', $retorno['clientes'][0]['codigo_cliente']);
$hub->agi()->set_variable('IDCLIENTESERVICO', $retorno['clientes'][0]['servicos'][0]['id_cliente_servico']);
$hub->agi()->set_variable('NOME', $retorno['clientes'][0]['nome_razaosocial']);
$hub->agi()->set_variable('TELEFONEPRIMARIO', $retorno['clientes'][0]['telefone_primario']);
$hub->agi()->set_variable('ALERTAMSG', $retorno['clientes'][0]['alerta_mensagens'][0]);
// INTEGRACAO DE TELA
$hub->agi()->set_variable('CPF_CNPJ', $documento);
$hub->agi()->set_variable('EMAILCLIENTE', $retorno['clientes'][0]['email_principal']);
if ($retorno['clientes']) {
$hub->agi()->exec_goto($hub->db()->getAnuncio('INT_REDIR_PARADA_TECNICA')); // Sucesso
} else if ($reg_pass <= 1) {
$reg_pass += 1;
$hub->agi()->set_variable("REG_PASS", $reg_pass);
$hub->agi()->exec_goto($hub->db()->getAnuncio('INT_CADASTRO_FALHA')); // Falha
} else {
$hub->agi()->exec_goto($hub->db()->getAnuncio('INT_TRANSFERE_ATENDIMENTO'));
}
$hub->db()->atualizaIntegracao();
?>