Publish DTMF Helper for Local Participant - #1001
Open
ayukumar261 wants to merge 5 commits into
Open
ayukumar261 wants to merge 5 commits into
ayukumar261 wants to merge 5 commits into
Conversation
ayukumar261
marked this pull request as ready for review
September 10, 2026 06:13
cnderrauber
reviewed
Sep 14, 2026
| // | ||
| // DTMF always uses the RELIABLE channel so digits arrive in order, overriding any | ||
| // WithDataPublishReliable(false). See WithDataPublishDestination to target participants. | ||
| func (p *LocalParticipant) PublishDTMF(code uint32, digit string, opts ...DataPublishOption) error { |
Contributor
There was a problem hiding this comment.
There are no options for publishing dtmf in other sdks, so go-sdk doesn't need options too.
Author
There was a problem hiding this comment.
Thanks for reviewing! I removed the opts argument from the helper.
However, I was looking at the Rust SDK publish_dtmf helper, and it includes destination_identities for destination support. If you think I should add a destinationIdentities... argument for the Go SDK PublishDTMF helper, please let me know!
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 have DTMF publishing helpers that always use the reliable data channel. The Go SDK has no equivalent, so developers have to build the packet themselves and remember to pass
WithDataPublishReliable(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)toLocalParticipant. It wrapsPublishDataPacketwithWithDataPublishReliable(true), so aSipDTMFpacket always goes over the reliable channel. The helper accepts no publishing options.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.Testing
TestPublishDTMFpublishes1 2 3 #and asserts that the subscriber receives four*livekit.SipDTMFpackets with the expected codes and digits in order. It also checks the publisher’s WebRTCGetStatsfor four messages on the_reliabledata channel and none on_lossy.CGO_ENABLED=0.mage test, which includes-race, passed locally before this API simplification. The latest full-suite attempt was blocked by a missing localsoxrdependency.Notes