'', "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(); ?>