EvolutionAPI / evolution-api

Evolution API is an open-source WhatsApp integration API
https://evolution-api.com
GNU General Public License v3.0
921 stars 482 forks source link

[PT][BUG] Erro ao enviar áudio #556

Closed nicocelli closed 3 weeks ago

nicocelli commented 2 months ago

Título: Erro ao enviar audio pelo chatwoot

Descrição:

Ao tentar enviar um áudio gravado pelo chatwoot ocorre um erro nos logs do Evolution e o áudio não é recebido no whatsapp, veja o erro abaixo:

[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootController]  [string]  requested receiveWebhook from WppTeste instance 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [CacheService]  [string]  cacheservice created using cache engine: RedisCache 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  receive webhook to chatwoot instance: WppTeste 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  get client to instance: WppTeste 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [CacheService]  [string]  cacheservice has key: WppTeste:getProvider 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [CacheService]  [string]  cacheservice getting key: WppTeste:getProvider 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  provider found 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  create client to instance: WppTeste 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  client created 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  check if is bot 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  check if is group 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  check if is a message deletion 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  check if is group 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  Format message to send 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  check if message is media 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  message is media 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  send media to whatsapp 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  message do not have text 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Getting instance name 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  send attachment to instance: WppTeste 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  get media type 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  type: audio 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Getting instance name 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [ChatwootService]  [string]  send audio to instance: WppTeste 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Sending audio whatsapp 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Processing audio 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Hash to audio name: 5547992621482-1713810324880 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Audio is base64 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Output audio path: /evolution/store/temp/5547992621482-1713810324880.mp4 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Temp audio path: /evolution/store/temp/temp-5547992621482-1713810324880.mp3 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Temp audio created 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Converting audio to mp4 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Temp audio deleted 
[Evolution API]  [WppTeste]  v1.7.3  1   -  Mon Apr 22 2024 15:25:24     VERBOSE   [WAStartupService]  [string]  Audio converted to mp4 
[Evolution API]    v1.7.3  1   -  Mon Apr 22 2024 15:25:24     ERROR   [ChatwootService]  [object]   
Error: Command failed: /evolution/node_modules/@ffmpeg-installer/linux-x64/ffmpeg -i /evolution/store/temp/temp-5547992621482-1713810324880.mp3 -vn -ab 128k -ar 44100 -f ipod /evolution/store/temp/5547992621482-1713810324880.mp4 -y
ffmpeg version N-47683-g0e8eb07980-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
  libavutil      56. 24.101 / 56. 24.101
  libavcodec     58. 42.100 / 58. 42.100
  libavformat    58. 24.100 / 58. 24.100
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 46.101 /  7. 46.101
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[mp3 @ 0x5970c00] Format mp3 detected only with low score of 1, misdetection possible!
[mp3 @ 0x5970c00] Failed to read frame size: Could not seek to 1163.
/evolution/store/temp/temp-5547992621482-1713810324880.mp3: Invalid argument

    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:514:28)
    at ChildProcess.emit (node:domain:488:12)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: '/evolution/node_modules/@ffmpeg-installer/linux-x64/ffmpeg -i /evolution/store/temp/temp-5547992621482-1713810324880.mp3 -vn -ab 128k -ar 44100 -f ipod /evolution/store/temp/5547992621482-1713810324880.mp4 -y'
} 

image

Passos para Reproduzir:

  1. Acessar o chatwoot conectado ao Evolution
  2. Enviar áudio pelo chatwoot

Comportamento Esperado:

O áudio deveria ser entregue corretamente no whatsapp.

Comportamento Atual:

O áudio não é entregue no whatsapp e o evolution apresenta erro no log.

Ambiente:

Rafaell-dev commented 1 month ago

Estou com o mesmo problema ao enviar imagem não carrega o conteúdo da imagem no cliente e os áudios não são enviados

Ambiente: Servidor Ubuntu Versão da API: v1.7.3 (mongo / redis) Chatwoot: v3.8.0 Ambiente Docker

gyancarlodasilva commented 1 month ago

Mesmo problema, as imagens, audios e arquivos não são entregues ao chatwoot e vice versa, ao whastapp também não. image

dpaes commented 4 hours ago

já resolveram? estou usando Docker servidor Ubuntu 20.04 versão latest da evolution-api(com mongo:7) chatwoot:latest-ce(com postgres:16 e redis:7) Não envia áudio através do chatwoot (aparece que não foi possível enviar áudio), não permite ouvir áudios enviados pelo WhatsApp (aparece tudo zerado) e também não apresenta stickers, somente imagens png ou jpeg

nicocelli commented 3 hours ago

Olá @dpaes !

Acabei migrando para outra API do whatsapp e decidi fazer a integração com o chatwoot internamente. Não sei como está essa questão no Evolution. Acredito que o @DavidsonGomes possa te orientar.

Abraço