Browse Source

ajustes genericos

websocket
lucas cardoso 3 years ago
parent
commit
ce34963d68
  1. 2
      app/Middleware/ApiAgente.php
  2. 4
      app/Providers/Positus.php
  3. 6
      config/moments.php

2
app/Middleware/ApiAgente.php

@ -384,7 +384,7 @@ class ApiAgente implements IApi
$anmeArquivo = CONF_PATH_FILES . $mensagem['id_provedor']; $anmeArquivo = CONF_PATH_FILES . $mensagem['id_provedor'];
$texto = base64_decode($mensagem['content']); $texto = base64_decode($mensagem['content']);
file_put_contents($anmeArquivo, $texto); file_put_contents($anmeArquivo, $texto);
$provider->ConvertWavToMp3($anmeArquivo); $provider->convertWavToMp3($anmeArquivo);
$retuno = $provider->enviarMedia( $retuno = $provider->enviarMedia(
$mensagem['dst'], $mensagem['dst'],
CONF_MIDDLEWARE_LINKUPLOAD . CONF_MIDDLEWARE_LINKUPLOAD .

4
app/Providers/Positus.php

@ -239,7 +239,7 @@ class Positus extends Requests implements IApiMedia
} }
return false; return false;
} }
function ConvertWavToMp3($fileOrig) function convertWavToMp3($fileOrig)
{ {
try { try {
// ffmpeg -i 61f1a021ca8908.72216404_1643308267776 61f1a021ca8908.72216404_1643308267776 // ffmpeg -i 61f1a021ca8908.72216404_1643308267776 61f1a021ca8908.72216404_1643308267776
@ -247,7 +247,7 @@ class Positus extends Requests implements IApiMedia
exec($cmd); exec($cmd);
copy($fileOrig . ".mp3", $fileOrig); copy($fileOrig . ".mp3", $fileOrig);
} catch (\Exception $th) { } catch (\Exception $th) {
//throw $th; logger('ConvertWavToMp3')->error($th->getMessage());
} }
} }

6
config/moments.php

@ -12,9 +12,7 @@
define("CONF_MOMENT_SAUDACAO", 'SAUDACAO'); define("CONF_MOMENT_SAUDACAO", 'SAUDACAO');
define("CONF_MOMENT_INICIAR_ATENDIMENTO", 'INICIAR_ATENDIMENTO'); define("CONF_MOMENT_INICIAR_ATENDIMENTO", 'INICIAR_ATENDIMENTO');
define("CONF_MOMENT_FINALIZAR_ATENDIMENTO", 'FINALIZAR_ATENDIMENTO'); define("CONF_MOMENT_FINALIZAR_ATENDIMENTO", 'FINALIZAR_ATENDIMENTO');
define("CONF_MOMENT_CANCELAR_FILA", 'CANCELAR_FILA'); define("CONF_MOMENT_CANCELAR_FILA", 'CANCELAR_FILA'); //entrou na fila mas n tem agente logado
//entrou na fila mas n tem agente logado define("CONF_MOMENT_ENTRAR_FILA_SEM", 'ENTRAR_FILA_SEM'); //entrou na fila mas n tem agente livre
define("CONF_MOMENT_ENTRAR_FILA_SEM", 'ENTRAR_FILA_SEM');
//entrou na fila mas n tem agente livre
define("CONF_MOMENT_ENTRAR_FILA_COM", 'ENTRAR_FILA_COM'); define("CONF_MOMENT_ENTRAR_FILA_COM", 'ENTRAR_FILA_COM');
define("CONF_MOMENT_ERRO_ATEND", 'LOST_CONNECTION');// quando estiver em atendimento e perder a conexão com websocket define("CONF_MOMENT_ERRO_ATEND", 'LOST_CONNECTION');// quando estiver em atendimento e perder a conexão com websocket
Loading…
Cancel
Save