Logo
Search
API Docs

Live Call Monitoring

Live Call Features

Live Call Monitoring: Listen, Whisper, and Barge-In

Overview

Sulus provides live call monitoring capabilities through its Call Listen and Call Control features, which together enable listen, whisper, and barge-in scenarios during active calls.


Getting the Monitor URLs

First, initiate a call via the /call endpoint. The response includes a monitor object with both the listenUrl and controlUrl needed for monitoring:

{
  "monitor": {
    "listenUrl": "wss://phone-call-websocket.sulus.ai/<call-id>/transport",
    "controlUrl": "https://phone-call-websocket.sulus.ai/<call-id>/control"
  }
}

Listen

Connect to the listenUrl via WebSocket to receive a real-time audio stream of the call without any interaction:

const WebSocket = require('ws');

let pcmBuffer = Buffer.alloc(0);

const ws = new WebSocket("wss://phone-call-websocket.sulus.ai/<call-id>/transport");

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

ws.on('message', (data, isBinary) => {
  if (isBinary) {
    pcmBuffer = Buffer.concat([pcmBuffer, data]);
  } else {
    console.log('Received message:', JSON.parse(data.toString()));
  }
});

The listenUrl is a unidirectional, listen-only channel — it supplements the existing call without interfering with it.


Whisper (Inject a Message Silently)

To whisper context or instructions to the assistant mid-call without the caller hearing it directly, use the add-message control type with a system role. This injects a message into the conversation history and can optionally trigger a response:

curl -X POST '<controlUrl>' \
  -H 'content-type: application/json' \
  --data-raw '{
    "type": "add-message",
    "message": {
      "role": "system",
      "content": "The customer is a VIP -- offer them a 20% discount."
    },
    "triggerResponseEnabled": true
  }'

Barge-In (Force the Assistant to Speak)

To barge in and have the assistant say something immediately during the call, use the say control type:

curl -X POST '<controlUrl>' \
  -H 'content-type: application/json' \
  --data-raw '{
    "type": "say",
    "content": "Please hold while I transfer you to a specialist.",
    "endCallAfterSpoken": false
  }'

You can also use the say-first-message control to trigger the assistant's opening message:

curl -X POST '<controlUrl>' \
  -H 'content-type: application/json' \
  --data-raw '{
    "type": "control",
    "control": "say-first-message"
  }'

Summary of Monitoring Modes

ModeMechanismDescription
ListenlistenUrl (WebSocket)Real-time audio stream, no interaction
WhispercontrolUrl + add-message (system role)Inject silent context/instructions to the assistant
Barge-incontrolUrl + sayForce the assistant to speak immediately

In summary, these three capabilities together give supervisors full control over live calls — from passive monitoring to active intervention — using Sulus's listenUrl and controlUrl.