How to strip audio stream from SIP ?
# ask-ai
s
How to strip audio stream from SIP ?
t
Thanks for reaching out, Mohan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! Just a heads-up: LiveKit doesn't have a built-in way to strip or disable the audio stream from SIP participants right at the SIP ingress point. But no worries—you can still make it work by: • Choosing not to subscribe to the SIP participant's audio track. For example, if you're using the Python SDK, you can do something like this:
Copy code
@room.on("track_published")
def on_track_published(track, participant):
    if participant.kind == lksdk.ParticipantKind.PARTICIPANT_KIND_SIP and track.kind == TrackKind.AUDIO:
        track.set_subscribed(False)  # This way, you won’t receive the audio
• Turning off audio in agent sessions. Here's a quick example:
Copy code
session = AgentSession(
    room_input_options=RoomInputOptions(audio_enabled=False),
    room_output_options=RoomOutputOptions(audio_enabled=False),
)
These steps help make sure the audio stream isn’t processed or forwarded. If you want a hand setting this up in a particular SDK or environment, just let me know—I’m here to help! Sources: SIP Integration | livekit/livekit_composite | DeepWiki | test/integration/sip_test.go | livekit-rtc/livekit/rtc/audio_stream.py | Text and transcriptions | LiveKit Docs | Text and transcriptions | LiveKit Docs