Testing requires a valid API key. Generate a web integration token from your agent’s Web Integrations settings in the Dasha BlackBox dashboard before starting.
Prerequisites
Before you start, ensure you have:- A Dasha BlackBox agent with voice enabled
- A web integration token (from Dashboard → Agent → Web Integrations)
- The
AllowWebCallfeature enabled on your web integration - HTTPS environment (WebRTC requires secure context)
- User permission for microphone access
Voice call architecture
Voice call architecture
Voice calls use WebRTC for real-time audio and WebSocket for signaling:
Step 1: Establish WebSocket connection
Connect and initialize withcallType: "webCall":
Example: WebSocket connection for voice call
Example: WebSocket connection for voice call
Step 2: Handle SDP offer
After initialization, the server sends ansdpInvite message with the WebRTC offer:
Example: SDP invite message format
Example: SDP invite message format
SdpInviteMessage schema
Step 3: Create peer connection and send answer
Create anRTCPeerConnection, set the remote offer, get microphone access, and send the answer:
Example: Handle SDP offer and create peer connection
Example: Handle SDP offer and create peer connection
SdpAnswerMessage schema
Step 4: Handle connection state changes
Monitor WebRTC connection state and handle audio:Example: WebRTC connection state handlers
Example: WebRTC connection state handlers
Step 5: End the call
Clean up resources when ending the call:Example: End call and cleanup resources
Example: End call and cleanup resources
Next steps
Message Reference
Complete schema documentation for all WebSocket messages
Error Handling
Handle connection errors and edge cases
Chat Implementation
Build text chat interfaces
Tool Execution
Handle agent tool calls via WebSocket