function ApagaBilheteDuplTransfer($dbcon) { /* * Esta funcao apaga bilhetes que estao duplicatos na transferencia. */ $path = '/var/log/asterisk/apaga_bilhetes_transfer.log'; $query = "delete from ast_bilhetes a where rtrim(disposition) in('NO ANSWER', 'BUSY', 'FAILED') and exists(select '' from ast_bilhetes where uniqueid = a.uniqueid and rtrim(disposition) = 'ANSWERED');"; if (!pg_query($dbcon, $query)) { $log = sprintf("Data: %s Cmd: Erro: %s\n", date('Y-m-d H:i:s'), $query, GetLasterror()); WriteLog($log, $path); } $query = "drop table if exists bilhetes_dupl create table bilhetes_dupl as select uniqueid, min(sequence) as sequence from ast_bilhetes where calldate::date = now()::date group by uniqueid having count(*) > 1; delete from ast_bilhetes a using bilhetes_dupl b where b.uniqueid = a.uniqueid and a.sequence not in(select sequence from bilhetes_dupl);"; if (!pg_query($dbcon, $query)) { $log = sprintf("Data: %s Cmd: Erro: %s\n", date('Y-m-d H:i:s'), $query, GetLasterror()); WriteLog($log, $path); } } delete from ast_bilhetes a where rtrim(disposition) in('NO ANSWER', 'BUSY', 'FAILED') and exists(select '' from ast_bilhetes where uniqueid = a.uniqueid and rtrim(disposition) = 'ANSWERED'); drop table if exists bilhetes_dupl; create table bilhetes_dupl as select uniqueid, min(sequence) as sequence from ast_bilhetes where calldate::date = now()::date group by uniqueid having count(*) > 1; delete from ast_bilhetes a using bilhetes_dupl b where b.uniqueid = a.uniqueid and a.sequence not in(select sequence from bilhetes_dupl);"; http://192.168.115.233:3000/amarildo.pereira/pabx-app.git /* * Restringe o ramal para todos os grupos. */ if($result){ $query = "insert into pbx_grupo_audio_ramal select '$nome2', gp_id from pbx_grupo a where gp_status = 1 and not exists(select '' from pbx_grupo_audio_ramal where gp_id = a.gp_id and nome = '$nome2');"; $result = pg_query($dbcon, $query); } baseurl=http://vault.centos.org/$releasever/centosplus/$basearch/ [applicationmap] app-hangup-agentes => *0,caller,Macro,app-hangup-agentes ;Utilizadas internamente (ramal/ramal) onde qualquer um dos lados pode iniciar a conferencia app-inicia-conferencia => *7,caller,Macro,app-inicia-conferencia app-adiciona-conferencia => *8,caller,Macro,app-adiciona-conferencia app-naoadiciona-conferencia => *9,caller,Macro,app-naoadiciona-conferencia app-hangup-agentes => *0,caller,Macro,app-hangup-agentes ;Utilizadas para ligacoes externas onde somente o chamador pode iniciar a conferencia app-inicia-conferencia-ramal => *7,self/caller,Macro,app-inicia-conferencia app-adiciona-conferencia-ramal => *8,self/caller,Macro,app-adiciona-conferencia app-naoadiciona-conferencia-ramal => *9,self/caller,Macro,app-naoadiciona-conferencia app-monitora-aceita => 1,self/caller,AGI(intercala_lgpd.php,AGENTE,1) app-monitora-bloqueia => 2,self/caller,AGI(intercala_lgpd.php,AGENTE,2) [solintel-lgpd] app-monitora-aceita => 1 app-monitora-bloqueia => 2 [10:20, 22/10/2022] Alan Pablo: lá no sip_ramais.conf [10:20, 22/10/2022] Alan Pablo: setvar=DYNAMIC_FEATURES=solintel-lgpd [10:21, 22/10/2022] Alan Pablo: Depois podemos pensar em um parâmetro, só escreveria isso nos ramais quando estiver ativado [3001] type=friend secret=SIP3001 callerid=3001 qualify=yes port=5060 nat=force_rport,comedia host=dynamic dtmfmode=rfc2833 context=padrao canreinvite=no disallow=all allow=alaw,ulaw call-limit=1 videosupport=no t38pt_udptl=yes setvar=DYNAMIC_FEATURES=solintel-lgpd ^M [3002] /var/lib/asterisk/agi-bin/intercala_lgpd.php|AGENTE| [14:14, 13/10/2022] Alan Pablo: wget -c https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz tar xzf ioncube_loaders_lin_x86-64.tar.gz /bin/cp -Rapf ioncube/ioncube_loader_lin_5.6.so /etc/ioncube_loader.so chmod 755 /etc/ioncube_loader.so chown pbx:pbx /etc/ioncube_loader.so /bin/cp -Rapf ioncube/ioncube_loader_lin_5.6_ts.so /usr/lib64/php-zts/modules/ chmod 755 /usr/lib64/php-zts/modules/ioncube_loader_lin_5.6_ts.so chown pbx:pbx /usr/lib64/php-zts/modules/ioncube_loader_lin_5.6_ts.so echo "zend_extension = /usr/lib64/php-zts/modules/ioncube_loader_lin_5.6_ts.so" > /etc/php-zts.d/00-ioncube.ini [14:15, 13/10/2022] Alan Pablo: Esse primeiro cp copiar para o caminho que já usamos e o segundo é o passo que foi adicionado select case when(upper(b.modo_atendimento) = 'MANUAL')then case when( upper(e.tipo_ramal) = 'KHOMP')then upper(e.tipo_ramal) || '/r' || e.nome else e.dispositivo end else 'Local/' || b.ramal || '@app-callcenter/n' end as canal_agente, b.matricula, abdsr_numero, b.ramal, abdsr_uniqueid, abdsr_fila, abdsr_data_hora_inicio, a.abdsr_callback from pbx_abandonadas_semretorno a, pbx_supervisor_agentes b, pbx_supervisor_dacs c, pbx_queues_grupos d, pbx_ramais e where b.dac = a.abdsr_fila and c.dac = b.dac and d.nome = c.dac and e.nome = b.ramal and a.abdsr_data_hora_retorno is null and length(a.abdsr_numero) >= 8 and ((a.abdsr_callback < $tentativasRetorno) and (extract(epoch from (now() - coalesce(abdsr_callback_data, now())))::int > $tempoRetorno) or (a.abdsr_callback = 0)) and b.status = 'LIVRE' and b.status_discador = 0 and b.disponivel_atendimento = 1 and strtoint(c.espera) = 0 and d.retornar_abandonadas = 1 and a.abdsr_data >= (now()::date - $diasAbandon) order by a.abdsr_data_hora_inicio desc limit $agentesLivres ALTER TABLE pbx_parametros ADD COLUMN prm_sk_api_centrais VARCHAR(100); ALTER TABLE pbx_parametros ADD COLUMN prm_chat_url_client VARCHAR(255) DEFAULT('http://sipcloud02.simplesip.com.br:8001'); httpd-LX6 drwxr-xr-x 2 root root 4096 Jun 17 11:05 httpd-LX7 Select translate($1, 'áàâãäåaaaÁÂÃÄÅAAAÀéèêëeeeeeEEEÉEEÈìíîïìiiiÌÍÎÏÌIIIóôõöoooòÒÓÔÕÖOOOùúûüuuuuÙÚÛÜUUUUçÇñÑýÝ', 'aaaaaaaaaAAAAAAAAAeeeeeeeeeEEEEEEEiiiiiiiiIIIIIIIIooooooooOOOOOOOOuuuuuuuuUUUUUUUUcCnNyY' ); [16:40, 26/05/2022] Alan Pablo: Alteração Grupo momento no suporvisor - mostrar o identificador da rota de entrada na grid de chamadas abandonadas * Correção reciclagem do mailing * Supervisor * Quando o agente está em chamada e o supervisor realiza o logoff , não está desligando a chamada em curso. *Pesquisa de satisfação automatica com timeout na fila exten => _2000,n,Queue(ATENDIMENTO,trc,,${ANUNCIO},30,agente_fila.php,,,,) exten => _2000,n,ExecIf($["${QUEUESTATUS}" = "TIMEOUT"]?AGI(transbordo.php,ATENDIMENTO,2000,filas,2000,${UNIQUEID})) exten => _2000,n,ExecIf($["${QUEUESTATUS}" = "TIMEOUT"]?Goto(ext-fila,2000,1)) exten => _2000,n,Macro(hangup,PESQUISA) exten => _2000,n,Goto(psq-4-ini,s,1) exten => _2000,n,Hangup() *Pesquisa de satisfação [psq-2-ini] exten => s,1,NoCDR() exten => s,n,Macro(verifica-eventos-dacs) ;;;INCLUIR exten => s,n,Answer() exten => s,n,Playback(customizados/pesquisa_audio_sauda_9) exten => s,n,AGI(pbx_pesquisa_ura.php,ini,${IDORIGEM},2) exten => s,n,Goto(psq-2-8,s,1) exten => s,n,Hangup() [macro-verifica-eventos-dacs] ;;;INCLUIR no extensions_padrao.conf exten => s,1,ExecIf($["${ISNULL(${MATRICULA-DESTINO})}" = "1"]?MacroExit()) exten => s,n,Set(FIM_DIAL=$[${EPOCH}]) exten => s,n,Set(EVENTO=$[COMPLETEAGENTRAMAL]) exten => s,n,Set(INICIO_ATENDIMENTO=${DB(INICIO_ATENDIMENTO/${UNIQUEID})}) exten => s,n,Set(TEMPO_CHAMANDO=$[${INICIO_ATENDIMENTO} - ${INICIO_DIAL}]) exten => s,n,Set(DURACAO=$[${FIM_DIAL} - ${INICIO_ATENDIMENTO}]) exten => s,n,Noop(FILA-DESTINO = ${FILA-DESTINO}) exten => s,n,Noop(UNIQUEID = ${UNIQUEID}) exten => s,n,Noop(MATRICULA-DESTINO = ${MATRICULA-DESTINO}) exten => s,n,Noop(EVENTO = ${EVENTO}) exten => s,n,Noop(TEMPO_CHAMANDO = ${TEMPO_CHAMANDO}) exten => s,n,Noop(DURACAO = ${DURACAO}) exten => s,n,QueueLog(${FILA-DESTINO},${UNIQUEID},Agent/${MATRICULA-DESTINO},${EVENTO},${TEMPO_CHAMANDO},${DURACAO}) exten => s,n,Set(DB(CANAL/${MATRICULA-DESTINO}/${IDORIGEM})=DESLIGADO) exten => s,n,System(${ATUALIZAR} LIVRE ${MATRICULA-DESTINO}) exten => s,n,AGI(agente_pausa.php,${MATRICULA-DESTINO}) exten => s,n,MacroExit() [17:12, 26/05/2022] Alan Pablo: /hdaux/utilitarios/scripts/dial.sh 8285 6536168253 10 6000 UPDATE pbx_cliente SET client_user_contato = '{$matricula}' WHERE client_id IN (SELECT client_id FROM pbx_cliente WHERE clo_id = $cloid AND list_id IS NULL AND cmp_id IS NULL AND client_user_contato IS NULL and client_status <> '999' LIMIT $reg);"; EXEC dbo.sip_insert_prospect '','119','SN SHIGOTO SERVICES LTDA','','','F','43235786000139','SE','SP','SANTANA DE PARNAIBA','EM PROSPECÇÃO','35136', 'SERGIO DO NASCIMENTO', '1028' ´ select a.dac, a.ramal as ramal_monitor, a.matricula, a.nome, a.monitorar as statusmonitorar, a.intercalar as statusintercalar, ( (EXTRACT(EPOCH FROM (now() - a.duracao)) / 60)) as status_time, a.disponivel_atendimento, chamada_classificado, (LOCALTIMESTAMP(0) - a.tempo_login) as tempo_logado, a.modo_atendimento, a.origem_destino as fone, trim(status) as status_agente, case when((a.status = 'PAUSA') and (coalesce(a.motivo_pausa, '') <> ''))then a.status || '-' || upper(a.motivo_pausa) else a.status end as status, (LOCALTIMESTAMP(0) - a.duracao) as duracao, protocolo as num_protocolo, uniqueid2, extract(epoch from (now() - logado))::int as tempo_atualiza, trim(motivo_pausa) as pausa_motivo_rt, trim(uniqueid) as uniqueid, disponivel_atendimento, chamada_classificado, coalesce(canal_transfer, '') as canal_transfer, media, tipo_ligacao, cont_identificador, status_discador, ( SELECT count(*) FROM ast_bilhetes x, ast_eventos_dacs y where y.uid2 = x.uniqueid and x.data_bilhete in(a.tempo_login::date, now()::date) and y.fila = a.dac and y.agente = ('Agent/' || a.matricula) and y.evento in('COMPLETAAGENT','COMPLETACALLER','TRANSFERORIG') and x.lastapp <> 'Transferred Call' ) as originadas_pa, ( SELECT count(*) FROM ast_bilhetes x, ast_eventos_dacs y, ast_bilhetes_complemento z where y.uid2 = x.uniqueid and x.uniqueid = z.uniqueid2 and z.direcao = 'fila-ramal' and x.data_bilhete in(a.tempo_login::date, now()::date) and y.fila = a.dac and y.agente = ('Agent/' || a.matricula) and y.evento in('COMPLETEAGENT','COMPLETECALLER', 'TRANSFER','COMPLETEAGENTRAMAL','COMPLETECALLERRAMAL') and x.lastapp <> 'Transferred Call' ) AS atendidas_pa, ( SELECT sum( CASE WHEN ((y.evento = 'TRANSFER') or (y.evento = 'TRANSFERORIG')) THEN strtoint(y.param4) ELSE strtoint(y.param2) END ) FROM ast_bilhetes x, ast_eventos_dacs y where y.uid2 = x.uniqueid and x.data_bilhete in(a.tempo_login::date, now()::date) and y.fila = a.dac and y.agente = ('Agent/' || a.matricula) and y.evento in('COMPLETEAGENT','COMPLETECALLER', 'TRANSFER','COMPLETEAGENTRAMAL','COMPLETECALLERRAMAL', 'COMPLETAAGENT','COMPLETACALLER','TRANSFERORIG') and x.lastapp <> 'Transferred Call') AS tempo_atendimento FROM pbx_supervisor_agentes a where 1=1 order by a.dac, a.nome error_reporting(E_ALL); ini_set('display_errors', 0); http://repositorio.simplesip.com.br/ SELECT * FROM pbx_campanha_contato_status WHERE ctst_id NOT IN( SELECT ctst_id FROM (SELECT CASE WHEN(COUNT(ctst_id) > 1) THEN ctst_id END AS ctst_id FROM pbx_grupo_campanha_contato_status GROUP BY ctst_id ORDER BY 1) AS DATA WHERE ctst_id IS NOT NULL) AND ctst_id NOT IN (SELECT ctst_id FROM pbx_campanha_referencia_status) INSERT INTO pbx_cliente (client_tipo_documento, client_documento, " . "client_razao_social, client_nome_fantasia, client_endereco, " . "client_municipio, client_uf, client_telefone, client_celular, " . "client_email, client_nome_contato, clo_id, client_status) "COPY portabilidade_temp FROM '$file' WITH DELIMITER AS ',' QUOTE '\"' CSV HEADER"; "INSERT INTO pbx_listanegra (nome,numero,entrada,saida,opcao,acao) VALUES ('NAO PERTURBE','0','0','0','','')"; http://192.168.115.83:3000/LucasCM/simples-whatsapp.git Boa Noite! Conforme conversamos, precisamos revisar os seguintes itens: 1) Arquivo do Apache 2) Algar 2.1) Consolida Vendas 2.2) Não perturbe 2.3) Bloqueio Televendas 2.4) Pesquisa Algar 3) Revisar crontab 4) Apagar info.php 5) Apagar diretórios improdutivos (vou fornecer uma lista) 6) Criar perfil de instalação para personalização ex.: Algar 7) Desabilitar autovacuum 8) Transbordo no crontab tem que apontar para agi-bin 9) Remover portabilidade Att; CREATE OR REPLACE VIEW pbx_lista_arquivo_som AS SELECT a.tipo, a.arq_som FROM ( ( SELECT 'ura'::text AS tipo, pbx_ura.som_ura AS arq_som FROM pbx_ura UNION SELECT 'anuncio'::text AS tipo, pbx_anuncios.musica AS arq_som FROM pbx_anuncios ) UNION SELECT 'conferencia'::text AS tipo, pbx_conferencia.anuncio AS arq_som FROM pbx_conferencia) a WHERE btrim(a.arq_som::text) <> ''::text; ALTER TABLE pbx_lista_arquivo_som OWNER TO contacte; ws://app.simplesip.com.br/wss http://app.simplesip.com.br select id, prm_sk_host_chat, prm_chat_api, prm_media_simultaneo, prm_chat_api_supervisor into pbx_parametros_bk from pbx_parametros where id = 1; alter table pbx_parametros drop column prm_chat_api_supervisor; alter table pbx_parametros add prm_chat_api_supervisor varchar(255); alter table pbx_parametros drop column prm_sk_host_chat; alter table pbx_parametros add prm_sk_host_chat varchar(255); alter table pbx_parametros drop column prm_chat_api; alter table pbx_parametros add prm_chat_api varchar(255); update pbx_parametros set prm_chat_api_supervisor = (select prm_chat_api_supervisor from pbx_parametros_bk where id = 1); update pbx_parametros set prm_chat_api = (select prm_chat_api from pbx_parametros_bk where id = 1); update pbx_parametros set prm_sk_host_chat = (select prm_sk_host_chat from pbx_parametros_bk where id = 1); drop table pbx_parametros_bk; select id, prm_sk_host_chat, prm_chat_api, prm_media_simultaneo, prm_chat_api_supervisor from pbx_parametros where id = 1;