Skip to content

Publish DTMF Helper for Local Participant - #1001

Open
ayukumar261 wants to merge 4 commits into
livekit:mainfrom
ayukumar261:publish-dtmf
Open

Publish DTMF Helper for Local Participant#1001
ayukumar261 wants to merge 4 commits into
livekit:mainfrom
ayukumar261:publish-dtmf

Conversation

@ayukumar261

@ayukumar261 ayukumar261 commented Sep 10, 2026

Copy link
Copy Markdown

Problem

The JavaScript, Rust, Python, and Node SDKs each have a publishDtmf helper that builds a SipDTMF packet 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 pass WithDataPublishReliable(true).

That matters because PublishDataPacket has 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

  • Added PublishDTMF(code, digit, opts...) to LocalParticipant. It wraps PublishDataPacket and appends WithDataPublishReliable(true) after the caller's options, so a SipDTMF packet always goes over the reliable channel, even if the caller passes WithDataPublishReliable(false).
  • Updated a stale comment above the default in 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 still RELIABLE, so the two have disagreed since then.

Testing

TestPublishDTMF publishes 1 2 3 # with WithDataPublishReliable(false) and asserts the subscriber receives four *livekit.SipDTMF packets in order, and that the publisher's WebRTC GetStats show four messages on the _reliable data channel and none on _lossy. Removing the override from the helper fails the test.

Notes

  • Other options such as WithDataPublishDestination pass through unchanged.
  • PublishDTMF mirrors the JavaScript and Rust SDKs (Python and Node wrap Rust).
  • mage test, which is what CI runs and already includes -race, passes locally.

@CLAassistant

CLAassistant commented Sep 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ayukumar261
ayukumar261 marked this pull request as ready for review September 10, 2026 06:13
@ayukumar261
ayukumar261 requested a review from a team as a code owner September 10, 2026 06:13
devin-ai-integration[bot]

This comment was marked as resolved.

@ayukumar261 ayukumar261 changed the title Publish DTMF Helper for LiveKit Go SDK Publish DTMF Helper for Local Participant Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants