live call listening
# support
o
can i do live call listening
v
Hi there! 👋 Yes, you can definitely do live call listening with Vapi! According to the [Vapi documentation](https://docs.vapi.ai/calls/call-features), Vapi offers a "Call Listen" feature that enables real-time audio data streaming using WebSocket connections. This feature allows you to listen to calls in real-time as they happen. To use live call listening, you'll need to: 1. Obtain a
listenUrl
by triggering the
/call
endpoint 2. Connect to this WebSocket URL to stream the audio data in real-time 3. Process the audio directly or save it for later analysis Here's a simple Node.js example of how you might implement this from the [Call Features documentation](https://docs.vapi.ai/calls/call-features):
Copy code
javascript
const WebSocket = require('ws');
const fs = require('fs');

let pcmBuffer = Buffer.alloc(0);

const ws = new WebSocket("wss://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/transport");

ws.on('open', () => console.log('WebSocket connection established'));

ws.on('message', (data, isBinary) => {
  if (isBinary) {
    pcmBuffer = Buffer.concat([pcmBuffer, data]);
    console.log(`Received PCM data, buffer size: ${pcmBuffer.length}`);
  } else {
    console.log('Received message:', JSON.parse(data.toString()));
  }
});
Is there anything specific about live call listening that you'd like to know more about? Sources: - [Vapi documentation](https://docs.vapi.ai/calls/call-features) - [Call Features documentation](https://docs.vapi.ai/calls/call-features)
s
hey @odyjx check out this documentation on how to do live call listening:
5 Views