colossal-traffic-45994
12/01/2025, 5:57 PMMynewproject
• Room: phone-room-test
• Sample Call ID: SCL_raWYZKrvPkJB
• Note:
◦ “Our Python agent using LiveKit Agents + Gemini works in sandbox (browser client hears AI).”
◦ “With Telephony → SIP trunk → MicroSIP (PCMU/8000), the agent logs show continuous Gemini audio output into a published track, but the SIP caller hears silence.”
◦ “MicroSIP audio devices are correct; codecs limited to G.711; Windows audio output OK.”
any help pls i need to contact with supporttall-airline-16756
12/01/2025, 5:57 PMtall-airline-16756
12/01/2025, 5:57 PMphone-room-test but MicroSIP/Zoiper callers hear silence (Project: Mynewproject, Call ID: SCL_raWYZKrvPkJB). I can help troubleshoot — a few targeted checks will quickly narrow the cause.
Please confirm the following so I can advise next steps:
1. Is the agent publishing audio at 8000 Hz mono (resampled for G.711)?
2. Are you applying any noise cancellation/filters in RoomIO or AudioInputOptions? If yes, which filter (e.g., BVC, BVCTelephony)?
3. Which SIP trunk/provider are you using (Telnyx, Twilio, other)?
4. Can you verify the SIP leg plays a dial tone when play_dialtone: true is enabled for the SIP participant? Did you hear the dial tone on MicroSIP/Zoiper?
5. From the agent logs for call SCL_raWYZKrvPkJB, do you see a successful publish_track and no publish errors during TTS output?
If you confirm 1 or 2 are not set correctly, try these fixes first:
• Set agent audio output to 8kHz mono (G.711): use sample_rate=8000, num_channels=1 for AudioOutputOptions.
• Use BVCTelephony() (or apply it only for SIP participants) to avoid aggressive filtering of synthesized audio.
If you prefer, share the relevant snippets of how you start the session / set RoomOptions (audio_output/audio_input) and the SIP trunk provider — I’ll point to exact config changes and a minimal Python sample you can drop into your agent.
Sources: HD voice for SIP | LiveKit docs | Using Noise Cancellation for SIP and WebRTC Participants | Agent session | LiveKit docs | Voice AI quickstart | LiveKit docs | Make outbound calls | LiveKit docscolossal-traffic-45994
12/01/2025, 6:03 PMtall-airline-16756
12/01/2025, 6:04 PMcolossal-traffic-45994
12/01/2025, 6:12 PMtall-airline-16756
12/01/2025, 6:14 PMaudioop.lin2ulaw() (or equivalent) so the outgoing frames match PCMU expectations.
2) Ensure frame sizes and sample counts are correct
• Publish frames with consistent sizes (e.g., 20ms or 50ms). For 8kHz, 20ms = 160 samples, 50ms = 400 samples. Mismatched frame lengths can cause SIP clients to ignore audio.
3) Verify the AudioSource creation matches the final format
• Create the audio source as 8000 Hz, 1 channel and feed it frames already encoded/packed to match that layout.
4) Confirm publish success and outbound RTP packets in the dashboard/inspector
• In the LiveKit Admin Dashboard, confirm the agent’s audio track appears and that RTP packets are being sent toward the SIP participant. If no outbound RTP for the agent track exists, the problem is publish/routing.
5) Test with a known-good 8kHz PCMU file played as the agent output
• Replace Gemini temporarily: play a local 8kHz mono PCMU (or 8kHz PCM then convert) audio file via the agent. If the SIP caller hears that file, the problem is the Gemini→resample→encode pipeline; if still silent, it’s publish/routing.
6) Disable DTX/RED and ensure no aggressive post-processing is applied
• Make sure TrackPublishOptions or RoomIO are not enabling DTX/RED or WebRTC-only filters that could suppress synthetic audio.
7) Try a short tone test via frames (sine wave) encoded to PCMU
• If a tone is audible, you’ve confirmed routing and encoding are correct and can focus on how Gemini audio is packaged.
If you want, paste the minimal snippet that takes Gemini chunks → resampling → frame creation → publish (no secrets, just the transformation code and calls used) and I’ll point out exactly where to convert/pack frames or adjust sizes.
Sources: Agent session | LiveKit docs | HD voice for SIP | LiveKit docs | livekit/livekit_composite | DeepWiki | Camera & microphone | LiveKit docs | Agent speech and audio | LiveKit docscolossal-traffic-45994
12/01/2025, 6:16 PMPCMU/8000, return SIP 200 OK, and can play the dial tone when play_dialtone is enabled.
â—¦ During those calls, my agent logs show continuous Gemini audio chunks being processed and published, with no publish errors.
â—¦ Despite this, the SIP caller still hears silence from the agent.
Given that:
• WebRTC clients can hear the agent with this setup.
• SIP calls can receive and play the dial tone.
• The agent is already publishing 8 kHz mono PCM in correct 20 ms frames.
It seems the remaining issue is in the SIP bridge’s handling/routing of this agent track for my project/region, rather than something I can resolve further inside the agent code.
If you can, please:
• Inspect the RTP stream for the agent’s audio track on the SIP leg for a call like SCL_raWYZKrvPkJB (project Mynewproject, room phone-room-test), and
• Confirm whether the bridge is actually sending those frames to the SIP endpoint, or if there is any error/dropping on the server side.
If you still believe a specific change is needed in the Python agent, it would be very helpful to have a small, concrete example (for the LiveKit Python SDK) that shows the exact expected format for frames passed into rtc.AudioSource when targeting SIP/PCMU, so I can align to that implementation.tall-airline-16756
12/01/2025, 6:16 PM