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.
 
 

49 lines
1.1 KiB

<?php
require "SGP.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());
$sgp = new SGP(CONF_TOKEN_API, CONF_URL_API, CONF_USERID_API, CONF_LOGGER_ATIVO);
$sgp->db()->setRegistros($registros);
if (CONF_AUDIO_ERROR) {
$sgp->db()->setIdAudioError(CONF_AUDIO_ERROR);
}
$desbloqueado = false;
$documento = $sgp->agi()->get_variable('DOCUMENTO', true);
$clienteDados = $sgp->identificarDocumento($documento);
foreach($clienteDados['contratos'] as $cliente){
if(!strstr($cliente['contratoStatusDisplay'], "Ativo")){
$liberado = $sgp->liberacaoPromessa($cliente['contratoId']);
if($liberado['status']){
$desbloqueado = true;
}
}
}
if($desbloqueado){
$sgp->agi()->exec_goto($sgp->db()->getAnuncio('INT_DESBLOQUEIO_SUCESSO'));
}else{
$sgp->agi()->exec_goto($sgp->db()->getAnuncio('INT_DESBLOQUEIO_FALHA'));
}
$sgp->db()->atualizaIntegracao();
?>