Publish DTMF Helper for Local Participant - #1001
Open
ayukumar261 wants to merge 4 commits into
Open
Conversation
ayukumar261
marked this pull request as ready for review
September 10, 2026 06:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The JavaScript, Rust, Python, and Node SDKs each have a
publishDtmfhelper that builds aSipDTMFpacket and always sends it over the reliable data channel. The Go SDK has no equivalent, so developers have to build the packet themselves and remember to passWithDataPublishReliable(true).That matters because
PublishDataPackethas defaulted to the lossy channel since #421 (v2.1.0), and the lossy channel has been unordered since #659 (v2.8.0). Digits sent with the default can be dropped or arrive out of order.Changes
PublishDTMF(code, digit, opts...)toLocalParticipant. It wrapsPublishDataPacketand appendsWithDataPublishReliable(true)after the caller's options, so aSipDTMFpacket always goes over the reliable channel, even if the caller passesWithDataPublishReliable(false).PublishDataPacket. It said the Go default matches the protobuf default. That was true when Accept and send DTMF via data channel #415 wrote it, since both defaulted to reliable. Revert default behavior change with data publishing #421 flipped the Go default to lossy but left the comment, and the protobuf zero value is stillRELIABLE, so the two have disagreed since then.Testing
TestPublishDTMFpublishes1 2 3 #withWithDataPublishReliable(false)and asserts the subscriber receives four*livekit.SipDTMFpackets in order, and that the publisher's WebRTCGetStatsshow four messages on the_reliabledata channel and none on_lossy. Removing the override from the helper fails the test.Notes
WithDataPublishDestinationpass through unchanged.PublishDTMFmirrors the JavaScript and Rust SDKs (Python and Node wrap Rust).mage test, which is what CI runs and already includes-race, passes locally.