POST
/call/bridge/configHabilita 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 SIPsipServer: Endereço do servidor SIP (ex: sip.exemplo.com:5060)sipUser: Usuário de autenticação SIPsipPass: Senha de autenticação SIPsipListenPort: Porta para conexões SIP de entrada (padrão: 5080)sipListenUser: Usuário para autenticação SIP de entradasipListenSecret: Segredo para autenticação SIP de entradawasmServerPort: 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
| Nome | Tipo | Localização | Obrigatório |
|---|---|---|---|
enabledEnable or disable SIP bridge | boolean | body | Sim |
sipServerSIP server address (hostname:port or IP:port) | string | body | Não |
sipUserSIP authentication username | string | body | Não |
sipPassSIP authentication password | string | body | Não |
sipListenPortPort for incoming SIP connections | integer | body | Não |
sipListenUserUsername for incoming SIP authentication | string | body | Não |
sipListenSecretSecret for incoming SIP authentication | string | body | Não |
sipExtensionSIP extension number (optional, may be empty) | string | body | Não |
wasmServerPortWebAssembly server port for WebRTC | integer | body | Não |
wasmServerIPWebAssembly server IP address (internal IP of the WhatsApp server) | string | body | Não |
chromeRemoteURLChrome remote debugging WebSocket URL for WebRTC | string | body | Não |
nodeRemoteHelperURL of the Node remote helper used by the bridge | string | body | Nã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