I've integrated SIP Trunk using Egress service, wh...
# ask-ai
e
I've integrated SIP Trunk using Egress service, when i'm calling, agent is not speaking and there are continous stt usage in the logs, i also put myself on mute but stt usages logs were still logging
t
Thanks for reaching out, Aman. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m looking into the two issues you reported: the agent’s audio not transmitting and continuous STT usage while muted. To diagnose quickly, please provide: 1. Which Egress mode/config you used for the SIP trunk (recording, streaming, passthrough, or outbound SIP) and the exact egress settings you passed. 2. How you muted the agent (client-side mute,
SIPParticipantInfo.muted
, server call, or
session.output.set_audio_enabled(False)
). 3. A short snippet of the relevant logs showing STT entries and any participant state changes (timestamps around when you mute/unmute). 4. Whether the agent’s client shows a muted microphone icon and whether the SIP endpoint hears any audio at all. 5. Whether the agent’s publish/subscribe permissions or
RoomOutputOptions
were modified for this room. Quick checks you can run now: • Confirm the participant’s
muted
field flips to true on the server when you mute and that the track’s published state changes. • Verify the agent still has audio publishing enabled and
output.set_audio_enabled
isn’t disabling play-out. • Check that STT/VAD configuration isn’t set to force transcription regardless of mute. Send the config snippets and logs requested and I’ll point to the exact fields to inspect and next steps to stop STT during mute and restore agent audio. Sources: SIP APIs | LiveKit docs | Text and transcriptions | LiveKit docs | Camera & microphone | LiveKit docs | Managing participants | LiveKit docs
e
how to setup noise cancellation
t
You’re asking how to set up noise cancellation — do you need it for a SIP trunk (telephony), a LiveKit voice agent (server-side), or a client SDK (web/iOS/Android)? Also confirm whether it’s for inbound (caller → room/agent) or outbound (agent/user → PSTN/callee) audio and which SDK/platform you’re using. Tell me that and I’ll give the exact steps and sample code for your setup. Sources: Enhanced noise cancellation | LiveKit docs | SIP overview | LiveKit docs | Agent session | LiveKit docs
e
i need for everything
t
You're asking for an end-to-end noise cancellation setup across SIP trunks, LiveKit voice agents, and client SDKs (inbound and outbound). Below are concise, platform-specific steps, sample code snippets, and best practices to apply noise cancellation across your whole stack. SIP trunks (telephony) • Inbound calls (caller → room/agent): enable Krisp on trunk creation by setting
krisp_enabled: true
.
Copy code
{
  "trunk": {
    "name": "My trunk",
    "numbers": [
      "+15105550100"
    ],
    "krisp_enabled": true
  }
}
• Outbound calls (room/agent → callee): enable Krisp when creating the SIP participant.
Copy code
request = CreateSIPParticipantRequest(
    sip_trunk_id="<trunk_id>",
    sip_call_to="<phone_number>",
    room_name="my-sip-room",
    krisp_enabled=True,
    wait_until_answered=True
  )
• Best practices: enable Krisp on the side that originates noisy audio (caller or callee). Do not double-enable the same NC model on both sides for the same audio path. LiveKit Voice AI Agents (server-side) • Supported models:
NC
,
BVC
,
BVCTelephony
. Pick
BVC
or
BVCTelephony
for noisy or telephony-optimized transcription. • Example (Python Agents SDK):
Copy code
from livekit.plugins import noise_cancellation
  from livekit.agents.voice import room_io

  await session.start(
    room=ctx.room,
    agent=my_agent,
    room_options=room_io.RoomOptions(
      audio_input=room_io.AudioInputOptions(
        noise_cancellation=noise_cancellation.BVC(),
      ),
    ),
  )
• Best practices: enable exactly one agent-side processor. Use
BVCTelephony
for PSTN-quality audio. Avoid enabling client-side Krisp at the same time as BVC on the agent for the same participant. Client SDKs (frontend/outbound audio) • Web (JavaScript) ◦ Use KrispNoiseFilter, check support first.
Copy code
import { KrispNoiseFilter } from '@livekit/krisp-noise-filter';

  const krispProcessor = await KrispNoiseFilter();
  await track.setProcessor(krispProcessor);
  await krispProcessor.setEnabled(true);
• Check
isKrispNoiseFilterSupported()
because Safari <17.4 and some browsers may not support Krisp. • iOS (Swift), Android, React Native, Flutter ◦ Use the platform SDK’s Krisp integration to set a Krisp processor on the outbound track (implementation mirrors the Web approach). • Best practices: enable client-side NC when device/mic is noisy. Do not enable client-side Krisp plus agent-side BVC for the same audio path—choose one. General best practices & troubleshooting • Single processing per audio path: For any single audio stream, enable only one NC/denoising processor (either client Krisp, agent BVC, or SIP Krisp) to avoid artifacts and reduced quality. • Telephony vs non-telephony: Use
BVCTelephony
for PSTN-optimized scenarios,
BVC
for general background voice cancellation, and
NC
for simpler noise suppression. • Verify mute propagation: Ensure
SIPParticipantInfo.muted
and track publish states propagate correctly—STT and VAD should stop when muted. • Order of operations: enable processors before publishing the track to the room to avoid brief unprocessed segments. • Compatibility: confirm SDK/browser versions support Krisp or the chosen model. • Logs & testing: test each path separately (client→room, room→agent, agent→SIP) to confirm noise cancellation is active and not double-applied. Next step Do you want exact sample code for iOS or Android, or should I provide a checklist you can run through while testing each audio path?