forked from Claudio/integracao
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.
53 lines
1.7 KiB
53 lines
1.7 KiB
<?php |
|
|
|
include 'IxcSoft.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()); |
|
|
|
$ixc = new IxcSoft(CONF_TOKEN_API, CONF_URL_API, CONF_LOGGER_ATIVO); |
|
$ixc->db()->setRegistros($registros); |
|
|
|
if (CONF_AUDIO_ERROR) { |
|
$ixc->db()->setIdAudioError(CONF_AUDIO_ERROR); |
|
} |
|
|
|
$idcliente = $ixc->agi()->get_variable('IDCLIENTE', true); |
|
$unlock = false; |
|
$contratos = $ixc->listarContrato($idcliente); |
|
|
|
foreach ($contratos['registros'] as $item){ |
|
if ($item['status_internet'] == 'CA'){ |
|
$ret_unlock = $ixc->desbloqueiaCliente($item['id']); |
|
if ($ret_unlock['tipo'] == 'sucesso'){ |
|
$unlock = true; |
|
} |
|
} |
|
} |
|
|
|
$itgcTela = array( |
|
"NOME" => utf8_decode($ixc->agi()->get_variable('NOME', true)), |
|
"CONTRATO" => utf8_decode($ixc->agi()->get_variable('CONTRATO', true)), |
|
"BLOQUEIO" => utf8_decode($ixc->agi()->get_variable('BLOQUEIO', true)), |
|
"IP" => utf8_decode($ixc->agi()->get_variable('IP', true)), |
|
"BAIRRO" => utf8_decode($ixc->agi()->get_variable('BAIRRO', true)) |
|
); |
|
|
|
$ixc->integracaoAgente($itgcTela, array('NOME', 'CONTRATO', 'BLOQUEIO', 'IP', 'BAIRRO')); |
|
if(!$unlock){ |
|
$ixc->agi()->exec_goto($ixc->db()->getAnuncio('INT_DESBLOQUEIO_FALHA')); |
|
}else{ |
|
$ixc->agi()->exec_goto($ixc->db()->getAnuncio('INT_DESBLOQUEIO_SUCESSO')); |
|
} |
|
|
|
$ixc->db()->atualizaIntegracao(); |
|
?>
|