From 43f23e4f4bcec4a0338bb422dbadaa9eccbfc07f Mon Sep 17 00:00:00 2001 From: Hamdan Anwar Sayeed <96612374+s-hamdananwar@users.noreply.github.com> Date: Mon, 7 Oct 2024 13:29:47 -0500 Subject: [PATCH 1/2] Add SIP publish DTMF feature --- src/room/participant/LocalParticipant.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/room/participant/LocalParticipant.ts b/src/room/participant/LocalParticipant.ts index 3486f596a0..ce0a371883 100644 --- a/src/room/participant/LocalParticipant.ts +++ b/src/room/participant/LocalParticipant.ts @@ -10,6 +10,7 @@ import { RequestResponse, RequestResponse_Reason, SimulcastCodec, + SipDTMF, SubscribedQualityUpdate, TrackInfo, TrackUnpublishedResponse, @@ -1349,6 +1350,27 @@ export default class LocalParticipant extends Participant { await this.engine.sendDataPacket(packet, kind); } + /** + * Publish SIP DTMF message to the room. + * + * @param code DTMF code + * @param digit DTMF digit + */ + async publishDtmf(code: number, digit: string): Promise { + const packet = new DataPacket({ + kind: DataPacket_Kind.RELIABLE, + value: { + case: 'sipDtmf', + value: new SipDTMF({ + code: code, + digit: digit, + }), + }, + }); + + await this.engine.sendDataPacket(packet, DataPacket_Kind.RELIABLE); + } + async sendChatMessage(text: string): Promise { const msg = { id: crypto.randomUUID(), From 9719e0e35883a3ccb4e788fb4b0861d51b201e71 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Tue, 8 Oct 2024 09:05:05 +0200 Subject: [PATCH 2/2] Create wild-lions-fly.md --- .changeset/wild-lions-fly.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wild-lions-fly.md diff --git a/.changeset/wild-lions-fly.md b/.changeset/wild-lions-fly.md new file mode 100644 index 0000000000..e8521198be --- /dev/null +++ b/.changeset/wild-lions-fly.md @@ -0,0 +1,5 @@ +--- +"livekit-client": patch +--- + +Add SIP publish DTMF feature