No Audio on Outbound SIP Call (Go SDK, Windows, Pl...
# telephony
r
No Audio on Outbound SIP Call (Go SDK, Windows, Plivo) - Frames Sent but Silence Received Hi everyone, I'm building a voice agent using the LiveKit Go SDK and facing a persistent "no audio" issue on outbound SIP calls (Plivo). I'd appreciate any insights! Setup: • OS: Windows 11 (Running natively, no WSL2). • SDK:
<http://github.com/livekit/server-sdk-go/v2|github.com/livekit/server-sdk-go/v2>
• SIP Provider: Plivo (Outbound Trunk). • Flow: Worker connects to room -> Waits for SIP participant -> Publishes Audio Track -> Sends TTS audio. The Issue: The call connects successfully, and the SIP participant (phone) answers. The worker receives audio from the phone perfectly. The worker also sends audio (logs show frames being encoded and sent), but the phone hears absolute silence. What I've Tried: 1. Opus Codec: Standard
webrtc.MimeTypeOpus
(48kHz). Result: Silence. 2. G.711 PCMA: Switched to manual G.711 A-law encoding (8kHz, 20ms frames) using
webrtc.MimeTypePCMA
. Result: Silence. 3. Network: Forced
ICETransportPolicyRelay
to rule out NAT/Firewall issues. Connection is stable (
ICE connected
). Logs (Worker Side): It looks like the track is published and data is flowing:
Copy code
"message":"[AUDIO] publishing PCMA audio track (G.711 A-law)"
"message":"published track", "name"="agent-audio", "source"="MICROPHONE"
"message":"[AUDIO] PCMA frame encoded", "pcma_bytes":160, "payload_preview":"d52aaad5..."
"message":"[AUDIO] pacing progress", "frames_sent":100
"message":"[AUDIO] pacing progress", "frames_sent":200
Code Snippet (Audio Publishing): I'm using
TrackLocalStaticSample
and writing 20ms frames manually.
Copy code
// Publishing the track
track, err := webrtc.NewTrackLocalStaticSample(
    webrtc.RTPCodecCapability{MimeType: webrtc.MimeTypePCMA},
    "agent-audio",
    "agent-stream",
)
_, err = room.LocalParticipant.PublishTrack(track, &lksdk.TrackPublicationOptions{
    Name: "agent-audio",
})

// Writing Audio (Pacing Loop)
// Sending 160-byte frames every 20ms (8kHz A-law)
sample := media.Sample{
    Data:     audioFrame,
    Duration: 20 * time.Millisecond,
}
err := track.WriteSample(sample)
SIP Config (Plivo):
Copy code
{
  "provider": "PLIVO",
  "transport": "tcp",
  "codecs": ["PCMA", "PCMU", "G722"] // (Assumed defaults)
}
Questions: 1. Are there known issues with
TrackLocalStaticSample
for SIP outbound? 2. Does the SIP Gateway require specific RTP header extensions or StreamIDs to recognize the audio? 3. Could this be an encryption mismatch (SRTP) even if the connection is established? Any help debugging this would be amazing. Thanks!
👀 1
@refined-appointment-81829 any suggestion
r
Not sure I am following exactly. Is this a self hosted LiveKit server or are you using LiveKit cloud? If using LiveKit cloud can you share a call ID that had the issue so I can take a look at the logs and PCAP.
r
its livekit cloud
call_id SCL_K3i6jtLRnwUn
@refined-appointment-81829 you can check
r
I think something is wrong with the opus encoding
Error: *opus: buffer too small*
s
Thnx
r
@refined-appointment-81829 can you share the logs of this call id SCL_X6TuFTCZrUR4
r
You should be able to find the call and PCAP on your dashboard: https://cloud.livekit.io/projects/p_/telephony
I do not see any Opus errors for that call
s
Ok