rapid-hamburger-23505
12/09/2025, 10:45 PM<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:
"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.
// 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):
{
"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!rapid-hamburger-23505
12/09/2025, 10:47 PMrefined-appointment-81829
12/10/2025, 12:31 PMrapid-hamburger-23505
12/10/2025, 7:29 PMrapid-hamburger-23505
12/10/2025, 7:30 PMrapid-hamburger-23505
12/10/2025, 7:32 PMrefined-appointment-81829
12/10/2025, 10:17 PMError: *opus: buffer too small*shy-kitchen-69852
12/11/2025, 8:15 AMrapid-hamburger-23505
12/11/2025, 12:44 PMrefined-appointment-81829
12/11/2025, 5:26 PMrefined-appointment-81829
12/11/2025, 5:32 PMshy-kitchen-69852
12/11/2025, 5:47 PM