$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');";
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);";
$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');";
[14:15, 13/10/2022] Alan Pablo: Esse primeiro cp copiar para o caminho que j<EFBFBD> usamos e o segundo <EFBFBD> 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
[16:40, 26/05/2022] Alan Pablo: Altera<EFBFBD><EFBFBD>o Grupo momento no suporvisor - mostrar o identificador da rota de entrada na grid de chamadas abandonadas
* Corre<EFBFBD><EFBFBD>o reciclagem do mailing
* Supervisor
* Quando o agente est<EFBFBD> em chamada e o supervisor realiza o logoff , n<EFBFBD>o est<EFBFBD> desligando a chamada em curso.
*Pesquisa de satisfa<EFBFBD><EFBFBD>o automatica com timeout na fila
[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<EFBFBD><EFBFBD>O','35136', 'SERGIO DO NASCIMENTO', '1028'
<EFBFBD>
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,
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, "