diff --git a/app/controllers/MeetController.php b/app/controllers/MeetController.php new file mode 100644 index 00000000..622e7dd1 --- /dev/null +++ b/app/controllers/MeetController.php @@ -0,0 +1,109 @@ +post('/joinmeet', [self::class, 'joinMeet']); + $group->post('/participantleft', [self::class, 'participantLeft']); + $group->post('/conferenceleft', [self::class, 'conferenceLeft']); + }; + } + + function joinMeet(Request $request, Response $response, array $args) + { + try { + $this->serverRequest(); + $body = json_decode($request->getBody()->getContents(), true); + + $data = []; + $dados['org_id'] = $body['org_id']; + $dados['meet_id'] = $body['data']['roomName']; + $dados['nome'] = $body['data']['roomName']; + $dados['token'] = md5($body['data']['roomName']); + $dados['org_id'] = 1; + + $people = []; + $people['nome'] = $body['data']['displayName']; + $people['meet_id'] = $body['data']['roomName']; + $people['people_id'] = $body['data']['id']; + + $m = Meet::find(['meet_id' => $body['data']['roomName']]); + $meet = null; + if (!$m) { + $meet = Meet::create($dados); + } + $p = MeetPeople::create($people); + + if ($data) { + $response->getBody()->write(json_encode(['status' => true, 'data' => ['meet' => ['created' => $meet ?? 'OK'], 'user' => ['join' => $p ?? 'yes']]])); + } else { + $response->getBody()->write(json_encode(['status' => false, 'data' => $data])); + } + } catch (Exception $e) { + $response->getBody()->write(json_encode(['status' => false, 'data' => ["message" => "Nao foi possivel realizar a consulta! " . $e->getMessage()]])); + } + return $response; + } + + function conferenceLeft(Request $request, Response $response, array $args) + { + try { + $this->serverRequest(); + $body = json_decode($request->getBody()->getContents(), true); + + $mp = Meet::find(['nome' => $body['roomName']]); + $meet = null; + if ($mp) { + $meet = Meet::delete(['id' => $mp->id]); + MeetPeople::delete(['meet_id' => $body['roomName']]); + } + + if ($meet) { + $response->getBody()->write(json_encode(['status' => true, 'data' => ['meet' => ['deleted' => $meet ?? 'OK']]])); + } else { + $response->getBody()->write(json_encode(['status' => false, 'data' => ['message' => 'Nao foi possivel exluir participant']])); + } + } catch (Exception $e) { + $response->getBody()->write(json_encode(['status' => false, 'data' => ["message" => "Nao foi possivel realizar a consulta! " . $e->getMessage()]])); + } + return $response; + } + + function participantLeft(Request $request, Response $response, array $args) + { + try { + $this->serverRequest(); + $body = json_decode($request->getBody()->getContents(), true); + + $mp = MeetPeople::find(['people_id' => $body['id']]); + $meet = null; + if ($mp) { + $meet = MeetPeople::delete(['people_id' => $body['id']]); + } + + if ($meet) { + $response->getBody()->write(json_encode(['status' => true, 'data' => ['meet' => ['created' => $meet ?? 'OK'], 'user' => ['join' => $p ?? 'yes']]])); + } else { + $response->getBody()->write(json_encode(['status' => false, 'data' => ['message' => 'Nao foi possivel exluir participant']])); + } + } catch (Exception $e) { + $response->getBody()->write(json_encode(['status' => false, 'data' => ["message" => "Nao foi possivel realizar a consulta! " . $e->getMessage()]])); + } + return $response; + } +} diff --git a/app/models/Meet.php b/app/models/Meet.php new file mode 100644 index 00000000..434378e0 --- /dev/null +++ b/app/models/Meet.php @@ -0,0 +1,10 @@ +getMessage()); +} + +function getInfoMeet($dbcon, $token) +{ + $query = "SELECT * FROM pbx_meet WHERE token = '$token';"; + $result = pg_query($dbcon, $query); + if (!$result) { + throw new Exception("Não foi possível buscar a informação do reunião!"); + } + $dados = pg_fetch_assoc($result); + return $dados; +} + +function setVisitas($nome) +{ + $nomeUser = $_SESSION['SSnomeUser']; + $mat = GetMatricula() ?? 'Unknow'; + $name = rawurlencode($nome); + + $sql = "SELECT people_id FROM pbx_meet_people WHERE people_id = '$mat' AND meet_id = '$name';"; + $res = pg_query($sql); + $resp = pg_fetch_assoc($res); + + if (!$resp) { + $query = "INSERT INTO pbx_meet_people (meet_id, nome, people_id) VALUES('$name', '$nomeUser', '$mat');"; + pg_query($query); + } +} + +$smarty->assign("desabilitaLayout", 1); + +?> + + + + + + Simples IP - Teleconferência + + + + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/cadastros/meeting/meetings.php b/cadastros/meeting/meetings.php new file mode 100644 index 00000000..29026a06 --- /dev/null +++ b/cadastros/meeting/meetings.php @@ -0,0 +1,69 @@ +"; +$imgNovo = "$imgNovo NOVA REUNIÃO"; +$id = isset($_GET["id"]) ? $_GET["id"] : ''; +$idDelete = isset($_GET["idDelete"]) ? $_GET["idDelete"] : null; + +//Complete para buscar parâmetros (no caso multiempresas terá somente 1 que é nome) +$compl = ''; +if (isset($_REQUEST['paramPesquisa']) && $_REQUEST['paramPesquisa']) { + $compl = PreparaLike($filtro, true); + $compl = sprintf("AND (a.nome ILIKE %s )", $compl); +} + +$statusAtv = $statusAtivo ? "AND status = 1" : "AND status = 0"; +$query = "SELECT a.id, a.token, a.meet_id, a.nome, a.status, a.data_reg, count(b.id) as visitas +FROM pbx_meet a +INNER JOIN pbx_meet_people b ON a.meet_id = b.meet_id +WHERE 1 = 1 $compl "; +$query .= " GROUP BY a.id, a.meet_id, a.nome, a.status, a.data_reg"; +$params = "¶mPesquisa={$filtro}&status=$statusAtivo"; +$links = PaginaDados($idProg, $query, $params, $regPagina, $offSet, $pagMostra, true); + +$result = pg_query($dbcon, $query); +$linha = ""; +while ($dados = @pg_fetch_array($result)) { + $id = $dados["id"]; + $nome = mb_convert_encoding(urldecode($dados["nome"]), 'ISO-8859-1', 'UTF-8'); + $nome = strtoupper(RemoveAcentos($nome)); + //$invite = "ENTRAR NA REUNIÃO"; + $invite = "ENTRAR NA REUNIÃO"; + $visitas = $dados["visitas"]; + $status = GetStatusModulo($dados['status'], true); + $dataReg = date('d/m/Y H:i:s', strtotime($dados['data_reg'])); + + $delete = $dados['status'] == 1 ? "{$imgDelete}" : $imgDelete; + $linha .= " + $id + $nome + $visitas + $status + $dataReg + $invite + "; +} + +$smarty->assign('erro', $erro); +$smarty->assign("linhas", $linha); +$smarty->assign("paramPesquisa", $paramPesquisa); +$smarty->assign("imgNovo", $imgNovo); +$smarty->assign("imgLcFixo", $imgLcFixo); +$smarty->assign("links", $links); +$smarty->assign("pagMostra", $pagMostra); +$smarty->assign("totalReg", $totalReg); +$smarty->assign("status", $statusAtivo); +$smarty->assign("pgn", $_REQUEST["pgn"]); +$smarty->assign("bloco", $_REQUEST["bloco"]); +$smarty->assign("pg", $_REQUEST["pg"]); + +GetTemplate($smarty, $tpl); diff --git a/checaSessao.php b/checaSessao.php index 7b43a69c..89ef6b5c 100644 --- a/checaSessao.php +++ b/checaSessao.php @@ -34,6 +34,11 @@ if (($_SESSION["SSaut"] === "er") || (!$_SESSION["SSaut"])) { //if($siteError)$siteError->GetPhpError('include(\'login.php\')', "", "Erro ao carregar Login"); } +if (($_GET['action'] == 'meeting')) { + $tokenMeetting = $_GET['t']; + include("cadastros/meeting/cadMeet.php"); +} + if (isset($_GET['action']) && ($_GET['action'] == 'recovery_password')) { include("recuperarsenha.php"); } else if (isset($_GET['action']) && ($_GET['action'] == 'change_password')) { diff --git a/configGeral.php b/configGeral.php index 5ed5dcf5..add593b6 100644 --- a/configGeral.php +++ b/configGeral.php @@ -5,7 +5,7 @@ define("CONFIG_GERAL_SISTEMA", 1); define("CONFIG_SUPERVISOR", 3); define("CONFIG_AGENTE", 2); define("CONFIG_MANAGER", 4); -define("CONFIG_CHAT", 5); +define("CONFIG_SERVICE", 5); define("CONFIG_LICENCA", 6); $query = ""; @@ -483,15 +483,15 @@ if ($idSubProg == CONFIG_BASE_DADOS) { $tpl = "configSys.tpl"; $smarty->assign("idSubProg", $idSubProg); DispRel($smarty, $tpl); -} else if ($idSubProg == CONFIG_CHAT) { +} else if ($idSubProg == CONFIG_SERVICE) { /* * Parametos de socket */ - $fields = array('prm_sk_host_chat', 'prm_chat_api', 'prm_media_simultaneo', 'prm_chat_api_supervisor', 'prm_chat_url_client'); + $fields = array('prm_sk_host_chat', 'prm_chat_api', 'prm_url_meet'); $values = array(); if (isset($_GET["idSubProg"])) { - $query = "SELECT id, prm_sk_host_chat, prm_chat_api, prm_media_simultaneo, prm_chat_api_supervisor, prm_chat_url_client FROM pbx_parametros WHERE id = {$_SESSION['prm_id']}"; + $query = "SELECT id, prm_sk_host_chat, prm_chat_api, prm_url_meet FROM pbx_parametros WHERE id = {$_SESSION['prm_id']}"; $result = pg_query($dbcon, $query); $dados = pg_fetch_array($result); foreach ($fields as $value) { @@ -500,14 +500,13 @@ if ($idSubProg == CONFIG_BASE_DADOS) { } else { if (!ExisteRegistro($dbcon, 'pbx_parametros', 'id', '1')) { $query = "INSERT INTO pbx_parametros - (prm_sk_host_chat, prm_chat_api, prm_media_simultaneo, prm_chat_api_supervisor, prm_chat_url_client) - values({prm_sk_host_chat}, {prm_chat_api}, {prm_media_simultaneo}, {prm_chat_api_supervisor}, {prm_chat_url_client})"; + (prm_sk_host_chat, prm_chat_api, prm_url_meet) + values({prm_sk_host_chat}, {prm_chat_api}, {prm_url_meet})"; } else { $query = "UPDATE pbx_parametros SET prm_sk_host_chat = {prm_sk_host_chat}, - prm_chat_api = {prm_chat_api}, - prm_media_simultaneo = {prm_media_simultaneo}, prm_chat_api_supervisor = {prm_chat_api_supervisor}, - prm_chat_url_client = {prm_chat_url_client} + prm_chat_api = {prm_chat_api}, + prm_url_meet = {prm_url_meet} WHERE id = {$_SESSION['prm_id']}"; } diff --git a/imgSite/EVILCORP.JPG b/imgSite/EVILCORP.JPG deleted file mode 100644 index 65ece055..00000000 Binary files a/imgSite/EVILCORP.JPG and /dev/null differ diff --git a/include/util/funcoesApl.php b/include/util/funcoesApl.php index bdbadd8e..790f49e2 100755 --- a/include/util/funcoesApl.php +++ b/include/util/funcoesApl.php @@ -407,6 +407,7 @@ function VerificaCadastroMenu($conn) $menuUsuario[] = array('220', 'mnLgpdAdm', '0', 'Administra LGPD', 'index.php?idProg=364', '', '1', '1', '0', '', '364'); $menuUsuario[] = array('221', 'mnpermEditaClassificado', '0', 'Permite Editar Classificação', 'index.php?idProg=368', '', '1', '1', '0', '', '368'); $menuUsuario[] = array('222', 'mnOrganizacao', '1', 'Organização', 'index.php?idProg=369', '', '10', '1', '0', '', '369'); + $menuUsuario[] = array('223', 'mnMeeting', '1', 'Meetings', 'index.php?idProg=372', '', '62', '1', '0', '', '372'); $menuUsuario[] = array('112', 'mnSair', '1', 'Sair', 'index.php?idProg=-1&DEBUG=0', '', '', '1', '1', '10', '-1'); @@ -1184,6 +1185,8 @@ function GetDispProgSel($idProg) $dispProgSel[369] = 'Cadastro Organização'; + $dispProgSel[372] = 'Meeting / Reunião'; + $dispProgSel[10001] = "Cadastro de Agentes PBX"; $dispProgSel[10002] = "Cadastro de Filas"; $dispProgSel[10004] = "Cadastro de Agenda"; @@ -1798,7 +1801,7 @@ function GetParametros($db) 'prm_classifica_municipio', 'prm_max_agente_pausa', 'prm_disponivel_fila', 'prm_boloco_notas_key', 'caminho_producao', 'prm_exige_classificacao', 'prm_obs_pausaprod', 'prm_modulo_pesquisa', 'prm_portabilidade', 'prm_tarifacao', 'prm_prepago', 'prm_use_discador', 'prm_tempo_sessao', 'prm_agente_nova_janela', 'prm_label_protoco_pesquisa', 'prm_label_protoco_texto', 'prm_label_protoco_grid', 'prm_registro_pagina', 'prm_use_vendas', 'prm_nome_vendas', 'prm_exige_proto_vendas', 'prm_alerta_classificacao', 'prm_ativa_integracao', 'prm_select_integracao', 'prm_aviso_desconnect', 'prm_link_audio', - 'prm_ocultar_telefone', 'prm_ocultar_email', 'prm_ocultar_documento', 'prm_sk_host_chat', 'prm_chat_api', 'prm_chat_url_client', 'prm_sk_api_centrais', 'prm_max_licenca', 'prm_max_ramal', 'prm_max_licenca_fixo', 'prm_media_simultaneo', + 'prm_ocultar_telefone', 'prm_ocultar_email', 'prm_ocultar_documento', 'prm_sk_host_chat', 'prm_chat_api', 'prm_url_meet', 'prm_sk_api_centrais', 'prm_max_licenca', 'prm_max_ramal', 'prm_max_licenca_fixo', 'prm_ativa_complemento_campanha', 'prm_relatorio_servico', 'prm_aviso_lgpd_monitoria', 'prm_log_dias' ); @@ -1815,8 +1818,8 @@ function GetParametros($db) prm_exige_classificacao, prm_obs_pausaprod, prm_modulo_pesquisa, prm_portabilidade, prm_tarifacao, prm_prepago, prm_use_discador, prm_tempo_sessao, prm_agente_nova_janela, prm_label_protoco_pesquisa, prm_label_protoco_texto, prm_label_protoco_grid, prm_registro_pagina, prm_use_vendas, prm_nome_vendas, prm_exige_proto_vendas, prm_alerta_classificacao, prm_ativa_integracao, prm_select_integracao, prm_aviso_desconnect, - prm_link_audio, prm_ocultar_telefone, prm_ocultar_email, prm_ocultar_documento, prm_sk_host_chat, prm_chat_api, prm_chat_url_client, prm_sk_api_centrais, prm_max_licenca, - prm_max_ramal, prm_max_licenca_fixo, prm_media_simultaneo, prm_ativa_complemento_campanha, prm_relatorio_servico, prm_aviso_lgpd_monitoria, prm_log_dias + prm_link_audio, prm_ocultar_telefone, prm_ocultar_email, prm_ocultar_documento, prm_sk_host_chat, prm_chat_api, prm_url_meet, prm_sk_api_centrais, prm_max_licenca, + prm_max_ramal, prm_max_licenca_fixo, prm_ativa_complemento_campanha, prm_relatorio_servico, prm_aviso_lgpd_monitoria, prm_log_dias from pbx_parametros where org_id = {$org_id}"; $result = pg_query($db, $query); @@ -3386,12 +3389,12 @@ function GetJsBlok($command, $incTag = true) */ //if(count($command) == 0) return ""; - $lkText = $incTag ? "\n" : ""; + $lkText .= $incTag ? " \n \n" : ""; return $lkText; } @@ -4106,7 +4109,7 @@ function PaginaDados($idProg, &$sql, &$params, &$regPagina, &$offSet, &$pagMostr // if (strpos($sql, 'org_id') === false && strpos($sql, 'id_organizacao') === false) { // $org_condition = "org_id = {$org_id}"; - + // // Substituir todas as ocorrências de 'where' ou 'WHERE' pela condição com 'AND' // $sql = str_replace(array('where', 'WHERE'), "WHERE $org_condition AND", $sql); // } diff --git a/include/util/funcoesInternas.php b/include/util/funcoesInternas.php index 8a2eb1cf..b366a879 100755 --- a/include/util/funcoesInternas.php +++ b/include/util/funcoesInternas.php @@ -341,9 +341,9 @@ $funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_ $funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(369,'cadastros/organizacao/organizacao.php',369,0,0)"; $funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(370,'cadastros/organizacao/cadOrganizacao.php',369,0,0)"; $funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(371,'cadastros/organizacao/atribuirOrganizacao.php',369,0,0)"; - - - +$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(372,'cadastros/meeting/meetings.php',372,0,0)"; +$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(373,'cadastros/meeting/cadMeet.php',372,0,0)"; +$funcosInternas[] = "insert into pbx_funcoes_internas(id_prog, arquivo, id_prog_pai, status, exit)values(374,'cadastros/meeting/inMeeting.php',372,0,0)"; diff --git a/include/util/funcoesLicenca.php b/include/util/funcoesLicenca.php index ab839704..aff20a4e 100755 --- a/include/util/funcoesLicenca.php +++ b/include/util/funcoesLicenca.php @@ -11,7 +11,8 @@ define("CONF_FILE_UUID", 'uuid.lca'); * @param type $fields */ -function GerarArquivo($fields) { +function GerarArquivo($fields) +{ $info = [ 'document', @@ -53,7 +54,8 @@ function GerarArquivo($fields) { * @param type $tmp * @return string */ -function GerarUUID($tmp = false) { +function GerarUUID($tmp = false) +{ $file = CONF_FILE_PATH . ($tmp ? 'tmp/' . md5(date('Y-m-d') . CONF_KEY_LICENCA) . "_" : '') . CONF_FILE_UUID; if (!file_exists($file) && $tmp) { @@ -83,7 +85,8 @@ function GerarUUID($tmp = false) { * @param array $data * @return string */ -function criarArquivo($filename, $data) { +function criarArquivo($filename, $data) +{ $file = CONF_FILE_PATH . md5($filename) . ".lca"; $data['clto_data_log'] = $file; __createFile($file, preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $data)); @@ -95,7 +98,8 @@ function criarArquivo($filename, $data) { * @param type $file * @return boolean */ -function validarArquivo($file) { +function validarArquivo($file) +{ $file_lca = CONF_FILE_PATH . $file['conf']['name']; $tmpFileLocal = $file['conf']['tmp_name']; $tmpFileName = $file['conf']['name']; @@ -116,7 +120,8 @@ function validarArquivo($file) { * @param type $nomeArquivo * @return type */ -function DownloadArquivo($nomeArquivo) { +function DownloadArquivo($nomeArquivo) +{ try { ob_clean(); $nome = basename($nomeArquivo); @@ -143,9 +148,10 @@ function DownloadArquivo($nomeArquivo) { * @param type $dbcon * @return boolean */ -function validarLicenca($dbcon) { +function validarLicenca($dbcon) +{ $db = __getLicencaPBX($dbcon); - + if (!$db) { return false; } @@ -173,13 +179,15 @@ function validarLicenca($dbcon) { #### FUNCOES ESCRITA/LEITURA #### ######################################## -function __createFile($file, $dados) { +function __createFile($file, $dados) +{ $crypt = new Crypt(CONF_KEY_LICENCA); $dataCrypt = $crypt->encrypt(json_encode($dados, true)); file_put_contents($file, $dataCrypt); } -function __readFile($file, $encrypeted = true) { +function __readFile($file, $encrypeted = true) +{ $crypt = new Crypt(CONF_KEY_LICENCA); $content = file_get_contents($file); @@ -194,7 +202,8 @@ function __readFile($file, $encrypeted = true) { return $content; } -function __writeFile($file, $dados = null, $append = true) { +function __writeFile($file, $dados = null, $append = true) +{ $crypt = new Crypt(CONF_KEY_LICENCA); $content = __readFile($file); if ($dados) { @@ -215,7 +224,8 @@ function __writeFile($file, $dados = null, $append = true) { #### BANCO DE DADOS #### ######################################## -function __getLicencaPBX($dbcon) { +function __getLicencaPBX($dbcon) +{ $query = "SELECT clto_cnpj, clto_data_log, clto_server_registro, clto_contrato_numero FROM pbx_controle_licenciamento;"; $result = pg_query($dbcon, $query); $res = pg_fetch_assoc($result); @@ -229,7 +239,8 @@ function __getLicencaPBX($dbcon) { * @return boolean * @throws Exception */ -function __validLicenca($dbcon, $data) { +function __validLicenca($dbcon, $data) +{ if (!$data['clto_document']) { throw new Exception("As informações do arquivo está corrompido!"); } @@ -274,7 +285,8 @@ function __validLicenca($dbcon, $data) { } } -function __updateLicenca($dbcon, $data, $columns, $table, $where, $filter) { +function __updateLicenca($dbcon, $data, $columns, $table, $where, $filter) +{ $values = array_combine($columns, $data); foreach ($values as $key => $value) { @@ -289,7 +301,8 @@ function __updateLicenca($dbcon, $data, $columns, $table, $where, $filter) { } } -function __sendLicenca($dbcon, $data, $columns, $table) { +function __sendLicenca($dbcon, $data, $columns, $table) +{ $values = array_values($data); $query = sprintf("TRUNCATE TABLE %s", $table); @@ -304,7 +317,8 @@ function __sendLicenca($dbcon, $data, $columns, $table) { } } -function GetPerfilApl() { +function GetPerfilApl() +{ $query = "SELECT * FROM pbx_grupo WHERE gp_system = 1 AND gp_id <> 43"; $resp = pg_query($query); $resp = pg_fetch_all($resp); @@ -315,7 +329,8 @@ function GetPerfilApl() { * REALIZA A INSERÇÃO DAS INFORMAÇÕES DA LICENÇA NA TABELA DE PARAMETROS DO SISTEMA */ -function recordParams($dbcon, $data) { +function recordParams($dbcon, $data) +{ $columns = array( 'prm_max_licenca', 'prm_max_licenca_fixo', @@ -347,7 +362,8 @@ function recordParams($dbcon, $data) { * RESPONSÁVEL POR GERENCIAR AS LICENÇAS PA FIXO */ -function managePaFixo($dbcon, $data) { +function managePaFixo($dbcon, $data) +{ $query = "SELECT COUNT(*) AS qtd_pa_fixo FROM pbx_licenca_pa_fixo WHERE id_user IS NOT NULL"; $result = pg_query($dbcon, $query); $result = pg_fetch_assoc($result); @@ -376,14 +392,16 @@ function managePaFixo($dbcon, $data) { * GERADOR DE CHAVES ALEATÓRIAS UTILIZADOS PARA LICENÇA PA FIXO */ -function generateRandomKey() { +function generateRandomKey() +{ return bin2hex(random_bytes(10)); } /** * VERIFICA SE EXISTE LICENÇA CADASTRADA NO BANCO DE DADOS E RETORNA AS PERMISSÕES. */ -function existLicense($conn){ +function existLicense($conn) +{ //verifica o grupo de permissoes de acordo com o tipo da licença $query = "SELECT a.fun_id FROM pbx_grupo_funcoes a @@ -394,13 +412,13 @@ function existLicense($conn){ GROUP BY a.fun_id ORDER BY a.fun_id"; $result = pg_query($conn, $query); - - if (!pg_num_rows($result) || !validarLicenca($conn)){ + + if (!pg_num_rows($result) || !validarLicenca($conn)) { $permissions = array('1', '4'); } else { while ($row = pg_fetch_assoc($result)) { $permissions[] = $row['fun_id']; } } - return $permissions; -} \ No newline at end of file + return $permissions; +} diff --git a/projeto/base/sql/versao-1.9.0.sql b/projeto/base/sql/versao-1.9.0.sql index 74a2ce94..c943db5f 100644 --- a/projeto/base/sql/versao-1.9.0.sql +++ b/projeto/base/sql/versao-1.9.0.sql @@ -128,4 +128,36 @@ DROP CONSTRAINT idxcontstatusnome; --Troca de posicao da coluna ID para retirar conflitos do IAX-- --------------------------------------------------------------- ALTER TABLE pbx_iax_general -ADD COLUMN id SERIAL PRIMARY key; \ No newline at end of file +ADD COLUMN id SERIAL PRIMARY key; + +CREATE TABLE pbx_tokens ( + id serial NOT NULL PRIMARY KEY, + "token" varchar(255) NOT NULL, + id_usuario int4 NOT NULL, + refresh_token varchar(255) NOT NULL, + expired_at timestamp NULL, + updated_at timestamp NULL, + created_at timestamp NULL DEFAULT now() +); + +CREATE TABLE pbx_meet ( + id SERIAL NOT NULL PRIMARY KEY, + meet_id VARCHAR(255) NOT NULL, + nome VARCHAR(255) NOT NULL, + token VARCHAR(255) NOT NULL, + status INT NOT NULL default(1), + data_reg TIMESTAMP WITHOUT TIME ZONE DEFAULT(NOW()) +); + +CREATE TABLE pbx_meet_people ( + id SERIAL NOT NULL PRIMARY KEY, + meet_id VARCHAR(255) NOT NULL, + nome VARCHAR(255) NOT NULL, + people_id VARCHAR(50) NOT NULL, + left_meet TIMESTAMP WITHOUT TIME ZONE, + join_meet TIMESTAMP WITHOUT TIME ZONE DEFAULT(NOW()) +); + +ALTER TABLE pbx_parametros DROP COLUMN prm_chat_api_supervisor; +ALTER TABLE pbx_parametros DROP COLUMN prm_media_simultaneo; +ALTER TABLE pbx_parametros ADD COLUMN prm_url_meet VARCHAR(250); \ No newline at end of file diff --git a/public/api.php b/public/api.php index f401d583..8963827a 100644 --- a/public/api.php +++ b/public/api.php @@ -9,6 +9,7 @@ use app\controllers\QueueController; use app\controllers\CallController; use app\controllers\AuthController; use app\middleware\AuthMiddleware; +use app\controllers\MeetController; use Slim\Factory\AppFactory; use Slim\Routing\RouteCollectorProxy; @@ -31,7 +32,12 @@ $app->add(new CorsMiddleware()); $app->addErrorMiddleware(false, true, true); // Define app routes +$app->get('/api/v2/teste', function () { + echo "teste OK"; +}); + $app->group('/api/v2', AuthController::route()); +$app->group('/api/v2/meet', MeetController::route()); $app->group('/api/v2', function (RouteCollectorProxy $group) { $group->group('/call', CallController::route()); @@ -39,7 +45,6 @@ $app->group('/api/v2', function (RouteCollectorProxy $group) { })->add(new AuthMiddleware); // Middleware de Fallback - try { $app->run(); } catch (Exception $e) { diff --git a/scriptApl/jitsi_api.js b/scriptApl/jitsi_api.js new file mode 100644 index 00000000..f8f25572 --- /dev/null +++ b/scriptApl/jitsi_api.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JitsiMeetExternalAPI=t():e.JitsiMeetExternalAPI=t()}(self,(()=>(()=>{var e={372:(e,t,n)=>{"use strict";n.d(t,{default:()=>M});var r=n(620),i=n.n(r);class s extends r{constructor(){var e,t,n;super(...arguments),e=this,n={},(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t="_storage"))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}clear(){this._storage={}}get length(){return Object.keys(this._storage).length}getItem(e){return this._storage[e]}setItem(e,t){this._storage[e]=t}removeItem(e){delete this._storage[e]}key(e){const t=Object.keys(this._storage);if(!(t.length<=e))return t[e]}serialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(0===e.length)return JSON.stringify(this._storage);const t={...this._storage};return e.forEach((e=>{delete t[e]})),JSON.stringify(t)}}const o=new class extends r{constructor(){super();try{this._storage=window.localStorage,this._localStorageDisabled=!1}catch(e){}this._storage||(console.warn("Local storage is disabled."),this._storage=new s,this._localStorageDisabled=!0)}isLocalStorageDisabled(){return this._localStorageDisabled}setLocalStorageDisabled(e){this._localStorageDisabled=e;try{this._storage=e?new s:window.localStorage}catch(e){}this._storage||(this._storage=new s)}clear(){this._storage.clear(),this.emit("changed")}get length(){return this._storage.length}getItem(e){return this._storage.getItem(e)}setItem(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this._storage.setItem(e,t),n||this.emit("changed")}removeItem(e){this._storage.removeItem(e),this.emit("changed")}key(e){return this._storage.key(e)}serialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.isLocalStorageDisabled())return this._storage.serialize(e);const t=this._storage.length,n={};for(let r=0;r0&&void 0!==arguments[0]?arguments[0]:{};this.postis=function(e){var t,n=e.scope,r=e.window,i=e.windowForEventListening||window,s=e.allowedOrigin,o={},a=[],d={},l=!1,u="__ready__",p=function(e){var t;try{t=c(e.data)}catch(e){return}if((!s||e.origin===s)&&t&&t.postis&&t.scope===n){var r=o[t.method];if(r)for(var i=0;i{},this.postis.listen(_,(e=>this._receiveCallback(e)))}dispose(){this.postis.destroy()}send(e){this.postis.send({method:_,params:e})}setReceiveCallback(e){this._receiveCallback=e}}const w="request",L="response";class k{constructor(){let{backend:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._listeners=new Map,this._requestID=0,this._responseHandlers=new Map,this._unprocessedMessages=new Set,this.addListener=this.on,e&&this.setBackend(e)}_disposeBackend(){this._backend&&(this._backend.dispose(),this._backend=null)}_onMessageReceived(e){if(e.type===L){const t=this._responseHandlers.get(e.id);t&&(t(e),this._responseHandlers.delete(e.id))}else e.type===w?this.emit("request",e.data,((t,n)=>{this._backend.send({type:L,error:n,id:e.id,result:t})})):this.emit("event",e.data)}dispose(){this._responseHandlers.clear(),this._unprocessedMessages.clear(),this.removeAllListeners(),this._disposeBackend()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{s=e(...n)||s})),s||this._unprocessedMessages.add(n),s}on(e,t){let n=this._listeners.get(e);return n||(n=new Set,this._listeners.set(e,n)),n.add(t),this._unprocessedMessages.forEach((e=>{t(...e)&&this._unprocessedMessages.delete(e)})),this}removeAllListeners(e){return e?this._listeners.delete(e):this._listeners.clear(),this}removeListener(e,t){const n=this._listeners.get(e);return n&&n.delete(t),this}sendEvent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._backend&&this._backend.send({type:"event",data:e})}sendRequest(e){if(!this._backend)return Promise.reject(new Error("No transport backend defined!"));this._requestID++;const t=this._requestID;return new Promise(((n,r)=>{this._responseHandlers.set(t,(e=>{let{error:t,result:i}=e;void 0!==i?n(i):r(void 0!==t?t:new Error("Unexpected response format!"))}));try{this._backend.send({type:w,data:e,id:t})}catch(e){this._responseHandlers.delete(t),r(e)}}))}setBackend(e){this._disposeBackend(),this._backend=e,this._backend.setReceiveCallback(this._onMessageReceived.bind(this))}}let C;try{C=function(e,t=!1,n="hash"){if(!e)return{};"string"==typeof e&&(e=new URL(e));const r="search"===n?e.search:e.hash,i={},s=r?.substr(1).split("&")||[];if("hash"===n&&1===s.length){const e=s[0];if(e.startsWith("/")&&1===e.split("&").length)return i}return s.forEach((e=>{const n=e.split("="),r=n[0];if(!r||r.split(".").some((e=>d.includes(e))))return;let s;try{if(s=n[1],!t){const e=decodeURIComponent(s).replace(/\\&/,"&");s="undefined"===e?void 0:c(e)}}catch(e){return void function(e,t=""){console.error(t,e),window.onerror?.(t,void 0,void 0,void 0,e)}(e,`Failed to parse URL parameter value: ${String(s)}`)}i[r]=s})),i}(window.location).jitsi_meet_external_api_id}catch(e){}(window.JitsiMeetJS||(window.JitsiMeetJS={}),window.JitsiMeetJS.app||(window.JitsiMeetJS.app={}),window.JitsiMeetJS.app).setExternalTransportBackend=e=>undefined.setBackend(e);var S=n(860);const E=n.n(S)().getLogger("modules/API/external/functions.js");function x(e,t){return e.sendRequest({type:"devices",name:"setDevice",device:t})}const O=["css/all.css","libs/alwaysontop.min.js"],R={addBreakoutRoom:"add-breakout-room",answerKnockingParticipant:"answer-knocking-participant",approveVideo:"approve-video",askToUnmute:"ask-to-unmute",autoAssignToBreakoutRooms:"auto-assign-to-breakout-rooms",avatarUrl:"avatar-url",cancelPrivateChat:"cancel-private-chat",closeBreakoutRoom:"close-breakout-room",displayName:"display-name",endConference:"end-conference",email:"email",grantModerator:"grant-moderator",hangup:"video-hangup",hideNotification:"hide-notification",initiatePrivateChat:"initiate-private-chat",joinBreakoutRoom:"join-breakout-room",localSubject:"local-subject",kickParticipant:"kick-participant",muteEveryone:"mute-everyone",overwriteConfig:"overwrite-config",overwriteNames:"overwrite-names",password:"password",pinParticipant:"pin-participant",rejectParticipant:"reject-participant",removeBreakoutRoom:"remove-breakout-room",resizeFilmStrip:"resize-film-strip",resizeLargeVideo:"resize-large-video",sendCameraFacingMode:"send-camera-facing-mode-message",sendChatMessage:"send-chat-message",sendEndpointTextMessage:"send-endpoint-text-message",sendParticipantToRoom:"send-participant-to-room",sendTones:"send-tones",setAssumedBandwidthBps:"set-assumed-bandwidth-bps",setFollowMe:"set-follow-me",setLargeVideoParticipant:"set-large-video-participant",setMediaEncryptionKey:"set-media-encryption-key",setNoiseSuppressionEnabled:"set-noise-suppression-enabled",setParticipantVolume:"set-participant-volume",setSubtitles:"set-subtitles",setTileView:"set-tile-view",setVideoQuality:"set-video-quality",showNotification:"show-notification",startRecording:"start-recording",startShareVideo:"start-share-video",stopRecording:"stop-recording",stopShareVideo:"stop-share-video",subject:"subject",submitFeedback:"submit-feedback",toggleAudio:"toggle-audio",toggleCamera:"toggle-camera",toggleCameraMirror:"toggle-camera-mirror",toggleChat:"toggle-chat",toggleE2EE:"toggle-e2ee",toggleFilmStrip:"toggle-film-strip",toggleLobby:"toggle-lobby",toggleModeration:"toggle-moderation",toggleNoiseSuppression:"toggle-noise-suppression",toggleParticipantsPane:"toggle-participants-pane",toggleRaiseHand:"toggle-raise-hand",toggleShareScreen:"toggle-share-screen",toggleSubtitles:"toggle-subtitles",toggleTileView:"toggle-tile-view",toggleVirtualBackgroundDialog:"toggle-virtual-background",toggleVideo:"toggle-video",toggleWhiteboard:"toggle-whiteboard"},j={"avatar-changed":"avatarChanged","audio-availability-changed":"audioAvailabilityChanged","audio-mute-status-changed":"audioMuteStatusChanged","audio-or-video-sharing-toggled":"audioOrVideoSharingToggled","breakout-rooms-updated":"breakoutRoomsUpdated","browser-support":"browserSupport","camera-error":"cameraError","chat-updated":"chatUpdated","compute-pressure-changed":"computePressureChanged","content-sharing-participants-changed":"contentSharingParticipantsChanged","data-channel-closed":"dataChannelClosed","data-channel-opened":"dataChannelOpened","device-list-changed":"deviceListChanged","display-name-change":"displayNameChange","dominant-speaker-changed":"dominantSpeakerChanged","email-change":"emailChange","error-occurred":"errorOccurred","endpoint-text-message-received":"endpointTextMessageReceived","face-landmark-detected":"faceLandmarkDetected","feedback-submitted":"feedbackSubmitted","feedback-prompt-displayed":"feedbackPromptDisplayed","filmstrip-display-changed":"filmstripDisplayChanged","incoming-message":"incomingMessage","knocking-participant":"knockingParticipant",log:"log","mic-error":"micError","moderation-participant-approved":"moderationParticipantApproved","moderation-participant-rejected":"moderationParticipantRejected","moderation-status-changed":"moderationStatusChanged","mouse-enter":"mouseEnter","mouse-leave":"mouseLeave","mouse-move":"mouseMove","non-participant-message-received":"nonParticipantMessageReceived","notification-triggered":"notificationTriggered","outgoing-message":"outgoingMessage","p2p-status-changed":"p2pStatusChanged","participant-joined":"participantJoined","participant-kicked-out":"participantKickedOut","participant-left":"participantLeft","participant-role-changed":"participantRoleChanged","participants-pane-toggled":"participantsPaneToggled","password-required":"passwordRequired","peer-connection-failure":"peerConnectionFailure","prejoin-screen-loaded":"prejoinScreenLoaded","proxy-connection-event":"proxyConnectionEvent","raise-hand-updated":"raiseHandUpdated",ready:"ready","recording-link-available":"recordingLinkAvailable","recording-status-changed":"recordingStatusChanged","participant-menu-button-clicked":"participantMenuButtonClick","video-ready-to-close":"readyToClose","video-conference-joined":"videoConferenceJoined","video-conference-left":"videoConferenceLeft","video-availability-changed":"videoAvailabilityChanged","video-mute-status-changed":"videoMuteStatusChanged","video-quality-changed":"videoQualityChanged","screen-sharing-status-changed":"screenSharingStatusChanged","subject-change":"subjectChange","suspend-detected":"suspendDetected","tile-view-changed":"tileViewChanged","toolbar-button-clicked":"toolbarButtonClicked","transcribing-status-changed":"transcribingStatusChanged","transcription-chunk-received":"transcriptionChunkReceived","whiteboard-status-changed":"whiteboardStatusChanged"},I={"_request-desktop-sources":"_requestDesktopSources"};let P=0;function N(e,t){e._numberOfParticipants+=t}function A(e){let t;return"string"==typeof e&&null!==String(e).match(/([0-9]*\.?[0-9]+)(em|pt|px|((d|l|s)?v)(h|w)|%)$/)?t=e:"number"==typeof e&&(t=`${e}px`),t}class M extends(i()){constructor(e){super();for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{},url:`https://${e}/#jitsi_meet_external_api_id=${P}`})}(e,{configOverwrite:d,iceServers:y,interfaceConfigOverwrite:l,jwt:u,lang:p,roomName:i,devices:_,userInfo:w,appData:{localStorageContent:E},release:C}),this._createIFrame(a,s,S),this._transport=new k({backend:new b({postisOptions:{allowedOrigin:new URL(this._url).origin,scope:`jitsi_meet_external_api_${P}`,window:this._frame.contentWindow}})}),Array.isArray(v)&&v.length>0&&this.invite(v),this._onload=h,this._tmpE2EEKey=L,this._isLargeVideoVisible=!1,this._isPrejoinVideoVisible=!1,this._numberOfParticipants=0,this._participants={},this._myUserID=void 0,this._onStageParticipant=void 0,this._setupListeners(),P++}_createIFrame(e,t,n){const r=`jitsiConferenceFrame${P}`;this._frame=document.createElement("iframe"),this._frame.allow=["autoplay","camera","clipboard-write","compute-pressure","display-capture","hid","microphone","screen-wake-lock","speaker-selection"].join("; "),this._frame.name=r,this._frame.id=r,this._setSize(e,t),this._frame.setAttribute("allowFullScreen","true"),this._frame.style.border=0,n&&(this._frame.sandbox=n),this._frame.src=this._url,this._frame=this._parentNode.appendChild(this._frame)}_getAlwaysOnTopResources(){const e=this._frame.contentWindow,t=e.document;let n="";const r=t.querySelector("base");if(r&&r.href)n=r.href;else{const{protocol:t,host:r}=e.location;n=`${t}//${r}`}return O.map((e=>new URL(e,n).href))}_getFormattedDisplayName(e){const{formattedDisplayName:t}=this._participants[e]||{};return t}_getOnStageParticipant(){return this._onStageParticipant}_getLargeVideo(){const e=this.getIFrame();if(this._isLargeVideoVisible&&e&&e.contentWindow&&e.contentWindow.document)return e.contentWindow.document.getElementById("largeVideo")}_getPrejoinVideo(){const e=this.getIFrame();if(this._isPrejoinVideoVisible&&e&&e.contentWindow&&e.contentWindow.document)return e.contentWindow.document.getElementById("prejoinVideo")}_getParticipantVideo(e){const t=this.getIFrame();if(t&&t.contentWindow&&t.contentWindow.document)return void 0===e||e===this._myUserID?t.contentWindow.document.getElementById("localVideo_container"):t.contentWindow.document.querySelector(`#participant_${e} video`)}_setSize(e,t){const n=A(e),r=A(t);void 0!==n&&(this._height=e,this._frame.style.height=n),void 0!==r&&(this._width=t,this._frame.style.width=r)}_setupListeners(){this._transport.on("event",(e=>{let{name:t,...n}=e;const r=n.id;switch(t){case"ready":var i;null===(i=this._onload)||void 0===i||i.call(this);break;case"video-conference-joined":if(void 0!==this._tmpE2EEKey){const e=e=>{const t=[];for(let n=0;n{const n=I[e.name],r={...e,name:n};n&&this.emit(n,r,t)}))}updateNumberOfParticipants(e){if(!e||!Object.keys(e).length)return;const t=Object.keys(e).reduce(((t,n)=>{var r;return null!==(r=e[n])&&void 0!==r&&r.participants?Object.keys(e[n].participants).length+t:t}),0);this._numberOfParticipants=t}async getRoomsInfo(){return this._transport.sendRequest({name:"rooms-info"})}isP2pActive(){return this._transport.sendRequest({name:"get-p2p-status"})}addEventListener(e,t){this.on(e,t)}addEventListeners(e){for(const t in e)this.addEventListener(t,e[t])}captureLargeVideoScreenshot(){return this._transport.sendRequest({name:"capture-largevideo-screenshot"})}dispose(){this.emit("_willDispose"),this._transport.dispose(),this.removeAllListeners(),this._frame&&this._frame.parentNode&&this._frame.parentNode.removeChild(this._frame)}executeCommand(e){if(e in R){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r(E.error(e),{})))}(this._transport)}getContentSharingParticipants(){return this._transport.sendRequest({name:"get-content-sharing-participants"})}getCurrentDevices(){return function(e){return e.sendRequest({type:"devices",name:"getCurrentDevices"}).catch((e=>(E.error(e),{})))}(this._transport)}getCustomAvatarBackgrounds(){return this._transport.sendRequest({name:"get-custom-avatar-backgrounds"})}getLivestreamUrl(){return this._transport.sendRequest({name:"get-livestream-url"})}getParticipantsInfo(){const e=Object.keys(this._participants),t=Object.values(this._participants);return t.forEach(((t,n)=>{t.participantId=e[n]})),t}getVideoQuality(){return this._videoQuality}isAudioAvailable(){return this._transport.sendRequest({name:"is-audio-available"})}isDeviceChangeAvailable(e){return function(e,t){return e.sendRequest({deviceType:t,type:"devices",name:"isDeviceChangeAvailable"})}(this._transport,e)}isDeviceListAvailable(){return function(e){return e.sendRequest({type:"devices",name:"isDeviceListAvailable"})}(this._transport)}isMultipleAudioInputSupported(){return function(e){return e.sendRequest({type:"devices",name:"isMultipleAudioInputSupported"})}(this._transport)}invite(e){return Array.isArray(e)&&0!==e.length?this._transport.sendRequest({name:"invite",invitees:e}):Promise.reject(new TypeError("Invalid Argument"))}isAudioMuted(){return this._transport.sendRequest({name:"is-audio-muted"})}isAudioDisabled(){return this._transport.sendRequest({name:"is-audio-disabled"})}isModerationOn(e){return this._transport.sendRequest({name:"is-moderation-on",mediaType:e})}isParticipantForceMuted(e,t){return this._transport.sendRequest({name:"is-participant-force-muted",participantId:e,mediaType:t})}isParticipantsPaneOpen(){return this._transport.sendRequest({name:"is-participants-pane-open"})}isSharingScreen(){return this._transport.sendRequest({name:"is-sharing-screen"})}isStartSilent(){return this._transport.sendRequest({name:"is-start-silent"})}getAvatarURL(e){const{avatarURL:t}=this._participants[e]||{};return t}getDeploymentInfo(){return this._transport.sendRequest({name:"deployment-info"})}getDisplayName(e){const{displayName:t}=this._participants[e]||{};return t}getEmail(e){const{email:t}=this._participants[e]||{};return t}getIFrame(){return this._frame}getNumberOfParticipants(){return this._numberOfParticipants}getSupportedCommands(){return Object.keys(R)}getSupportedEvents(){return Object.values(j)}isVideoAvailable(){return this._transport.sendRequest({name:"is-video-available"})}isVideoMuted(){return this._transport.sendRequest({name:"is-video-muted"})}listBreakoutRooms(){return this._transport.sendRequest({name:"list-breakout-rooms"})}_isNewElectronScreensharingSupported(){return this._transport.sendRequest({name:"_new_electron_screensharing_supported"})}pinParticipant(e,t){this.executeCommand("pinParticipant",e,t)}removeEventListener(e){this.removeAllListeners(e)}removeEventListeners(e){e.forEach((e=>this.removeEventListener(e)))}resizeLargeVideo(e,t){e<=this._width&&t<=this._height&&this.executeCommand("resizeLargeVideo",e,t)}sendProxyConnectionEvent(e){this._transport.sendEvent({data:[e],name:"proxy-connection-event"})}setAudioInputDevice(e,t){return function(e,t,n){return x(e,{id:n,kind:"audioinput",label:t})}(this._transport,e,t)}setAudioOutputDevice(e,t){return function(e,t,n){return x(e,{id:n,kind:"audiooutput",label:t})}(this._transport,e,t)}setLargeVideoParticipant(e,t){this.executeCommand("setLargeVideoParticipant",e,t)}setVideoInputDevice(e,t){return function(e,t,n){return x(e,{id:n,kind:"videoinput",label:t})}(this._transport,e,t)}startRecording(e){this.executeCommand("startRecording",e)}stopRecording(e){this.executeCommand("stopRecording",e)}toggleE2EE(e){this.executeCommand("toggleE2EE",e)}async setMediaEncryptionKey(e){const{key:t,index:n}=e;if(t){const e=await crypto.subtle.exportKey("raw",t);this.executeCommand("setMediaEncryptionKey",JSON.stringify({exportedKey:Array.from(new Uint8Array(e)),index:n}))}else this.executeCommand("setMediaEncryptionKey",JSON.stringify({exportedKey:!1,index:n}))}}},872:(e,t,n)=>{e.exports=n(372).default},571:(e,t)=>{"use strict";const n=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*\:/;t.parse=function(e){const r="object"==typeof(arguments.length<=1?void 0:arguments[1])&&(arguments.length<=1?void 0:arguments[1]),i=(arguments.length<=1?0:arguments.length-1)>1||!r?arguments.length<=1?void 0:arguments[1]:void 0,s=(arguments.length<=1?0:arguments.length-1)>1&&(arguments.length<=2?void 0:arguments[2])||r||{},o=JSON.parse(e,i);return"ignore"===s.protoAction?o:o&&"object"==typeof o&&e.match(n)?(t.scan(o,s),o):o},t.scan=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[e];for(;n.length;){const e=n;n=[];for(const r of e){if(Object.prototype.hasOwnProperty.call(r,"__proto__")){if("remove"!==t.protoAction)throw new SyntaxError("Object contains forbidden prototype property");delete r.__proto__}for(const e in r){const t=r[e];t&&"object"==typeof t&&n.push(r[e])}}}},t.safeParse=function(e,n){try{return t.parse(e,n)}catch(e){return null}}},369:(e,t,n)=>{var r=n(7);function i(e,t){this.logStorage=e,this.stringifyObjects=!(!t||!t.stringifyObjects)&&t.stringifyObjects,this.storeInterval=t&&t.storeInterval?t.storeInterval:3e4,this.maxEntryLength=t&&t.maxEntryLength?t.maxEntryLength:1e4,Object.values(r.levels).forEach(function(e){this[e]=function(){this._log.apply(this,arguments)}.bind(this,e)}.bind(this)),this.storeLogsIntervalID=null,this.queue=[],this.totalLen=0,this.outputCache=[]}i.prototype.stringify=function(e){try{return JSON.stringify(e)}catch(e){return"[object with circular refs?]"}},i.prototype.formatLogMessage=function(e){for(var t="",n=1,r=arguments.length;n=this.maxEntryLength&&this._flush(!0,!0)},i.prototype.start=function(){this._reschedulePublishInterval()},i.prototype._reschedulePublishInterval=function(){this.storeLogsIntervalID&&(window.clearTimeout(this.storeLogsIntervalID),this.storeLogsIntervalID=null),this.storeLogsIntervalID=window.setTimeout(this._flush.bind(this,!1,!0),this.storeInterval)},i.prototype.flush=function(){this._flush(!1,!0)},i.prototype._storeLogs=function(e){try{this.logStorage.storeLogs(e)}catch(e){console.error("LogCollector error when calling logStorage.storeLogs(): ",e)}},i.prototype._flush=function(e,t){var n=!1;try{n=this.logStorage.isReady()}catch(e){console.error("LogCollector error when calling logStorage.isReady(): ",e)}this.totalLen>0&&(n||e)&&(n?(this.outputCache.length&&(this.outputCache.forEach(function(e){this._storeLogs(e)}.bind(this)),this.outputCache=[]),this._storeLogs(this.queue)):this.outputCache.push(this.queue),this.queue=[],this.totalLen=0),t&&this._reschedulePublishInterval()},i.prototype.stop=function(){this._flush(!1,!1)},e.exports=i},7:e=>{var t={trace:0,debug:1,info:2,log:3,warn:4,error:5};s.consoleTransport=console;var n=[s.consoleTransport];s.addGlobalTransport=function(e){-1===n.indexOf(e)&&n.push(e)},s.removeGlobalTransport=function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1)};var r={};function i(){var e=arguments[0],i=arguments[1],s=Array.prototype.slice.call(arguments,2);if(!(t[i]1&&u.push("<"+o.methodName+">: ");var p=u.concat(s);try{l.bind(d).apply(d,p)}catch(e){console.error("An error occured when trying to log with one of the available transports",e)}}}}function s(e,n,r,s){this.id=n,this.options=s||{},this.transports=r,this.transports||(this.transports=[]),this.level=t[e];for(var o=Object.keys(t),a=0;a{var r=n(7),i=n(369),s={},o=[],a=r.levels.TRACE;e.exports={addGlobalTransport:function(e){r.addGlobalTransport(e)},removeGlobalTransport:function(e){r.removeGlobalTransport(e)},setGlobalOptions:function(e){r.setGlobalOptions(e)},getLogger:function(e,t,n){var i=new r(a,e,t,n);return e?(s[e]=s[e]||[],s[e].push(i)):o.push(i),i},getUntrackedLogger:function(e,t,n){return new r(a,e,t,n)},setLogLevelById:function(e,t){for(var n=t?s[t]||[]:o,r=0;r{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}m(e,t,s,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,s,o,d;if(a(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,d=l,console&&console.warn&&console.warn(d)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=l.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var d=c.length,l=g(c,d);for(n=0;n=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,n),s.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n(872)})())); +//# sourceMappingURL=external_api.min.js.map \ No newline at end of file diff --git a/start.php b/start.php index d609e3ab..b50df782 100644 --- a/start.php +++ b/start.php @@ -202,6 +202,8 @@ $arRetornoAbandonadas = array(); */ $debugAmi = true; +$jsStartup[] = "localStorage.setItem('meet', '{$_SESSION['prm_url_meet']}')"; +$jsStartup[] = "localStorage.setItem('nameMeet', 'REUNIAO DE {$_SESSION['SSnomeUser']}')"; /* * Ativa funções javaSript inicialização; */ diff --git a/templates/cadastros/meeting/meetings.tpl b/templates/cadastros/meeting/meetings.tpl new file mode 100644 index 00000000..9c7f56f7 --- /dev/null +++ b/templates/cadastros/meeting/meetings.tpl @@ -0,0 +1,64 @@ +{capture name="display"} + + + + + + + + + + + +
+ + + + + + + + + + +
Palavra Chave
+ + + + + {$imgLcFixo} + + {$imgNovo} +
+
+ + + + + + + + + + {$linhas} + + + +
IdNomeVisitasStatusCriadaEntrar
+ + + + + +
{$links}{$pagMostra}/{$totalReg}
+
+
+ {if $erro} + + + + +
{$erro}
+ {/if} + +{/capture} \ No newline at end of file diff --git a/templates/configChatAgente.tpl b/templates/configChatAgente.tpl index 9afd1440..edff855d 100644 --- a/templates/configChatAgente.tpl +++ b/templates/configChatAgente.tpl @@ -1,38 +1,50 @@ {capture name="subDisplay"} - - - - - +
Dominio WS - -
+ + + + + + - - - - - - - - - - - - - - + + + - - - - -
WhatsApp
+ + + + + + + + + +
Dominio WS + +
Servidor API + +
+
Servidor API - -
Api Supervisor - -
Atendimento Simultâneo - -

  - -
+ + Vídeo Conferência + + + + + + + + + + + + +
URL Jitsi + +
  + +
+ + {/capture} \ No newline at end of file diff --git a/templates/configSys.tpl b/templates/configSys.tpl index 9042a217..dbaabbd0 100644 --- a/templates/configSys.tpl +++ b/templates/configSys.tpl @@ -13,7 +13,7 @@ Agente Supervisor Socket Server - Simples Chat + Serviços Licenciamento