Dichat
POST/call/bridge/config

Habilita ponte SIP

Descrição

Configura a ponte SIP para chamadas do WhatsApp, habilitando comunicação de voz entre o WhatsApp e sistemas SIP/VoIP.

Configuração da Ponte SIP:

  • Conecta chamadas do WhatsApp a servidores SIP (Asterisk, FreeSWITCH, etc.)
  • Habilita comunicação de voz bidirecional
  • Suporta clientes WebRTC e SIP tradicionais

Parâmetros principais:

  • enabled: Habilita/desabilita a ponte SIP
  • sipServer: Endereço do servidor SIP (ex: sip.exemplo.com:5060)
  • sipUser: Usuário de autenticação SIP
  • sipPass: Senha de autenticação SIP
  • sipListenPort: Porta para conexões SIP de entrada (padrão: 5080)
  • sipListenUser: Usuário para autenticação SIP de entrada
  • sipListenSecret: Segredo para autenticação SIP de entrada
  • wasmServerPort: Porta do servidor WebAssembly (padrão: 9080)
  • wasmServerIP: IP do servidor WebAssembly (IP interno do servidor do WhatsApp)
  • chromeRemoteURL: URL de debug remoto do Chrome (para WebRTC)
  • nodeRemoteHelper: URL do helper Node remoto usado pela ponte

Casos de uso:

  • Integração com sistemas PBX
  • Integração com call centers
  • Sistemas IVR
  • Gateway VoIP

Parâmetros

Corpo da requisição

NomeTipoLocalizaçãoObrigatório
enabled
Enable or disable SIP bridge
booleanbodySim
sipServer
SIP server address (hostname:port or IP:port)
stringbodyNão
sipUser
SIP authentication username
stringbodyNão
sipPass
SIP authentication password
stringbodyNão
sipListenPort
Port for incoming SIP connections
integerbodyNão
sipListenUser
Username for incoming SIP authentication
stringbodyNão
sipListenSecret
Secret for incoming SIP authentication
stringbodyNão
sipExtension
SIP extension number (optional, may be empty)
stringbodyNão
wasmServerPort
WebAssembly server port for WebRTC
integerbodyNão
wasmServerIP
WebAssembly server IP address (internal IP of the WhatsApp server)
stringbodyNão
chromeRemoteURL
Chrome remote debugging WebSocket URL for WebRTC
stringbodyNão
nodeRemoteHelper
URL of the Node remote helper used by the bridge
stringbodyNão

Exemplo de requisição

curl -X POST 'https://api-server.dichat.com.br/call/bridge/config' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "enabled": true,
    "sipServer": "sip.example.com:5060",
    "sipUser": "whatsapp_trunk",
    "sipPass": "mySecurePassword123",
    "sipListenPort": 5080,
    "sipListenUser": "incoming_user",
    "sipListenSecret": "incomingSecret123",
    "sipExtension": "",
    "wasmServerPort": 9080,
    "wasmServerIP": "10.0.0.5",
    "chromeRemoteURL": "ws://10.1.0.7:9223",
    "nodeRemoteHelper": "http://10.1.0.7:3000"
  }'

Respostas

200SIP bridge configuration updated successfully
400Invalid configuration
401Unauthorized - Invalid token
500Server error