Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,10 @@ class Endpoint extends EventEmitter {
if (flags.moderator) data.moderator = true;
if (flags.endconf) data.endConf = true;
if (flags.mute) data.startMuted = true;
// flags['dist-dtmf'] (distribute DTMF to the room) is Phase 2.
// flags['dist-dtmf']: this member's DTMF is regenerated as RFC 2833 on
// every other member's leg (mod_conference dist-dtmf semantics — the flag
// is on the sender, recipients need nothing).
if (flags['dist-dtmf']) data.distDtmf = true;
const res = await this._request('room.join', data);
this._roomName = conf;
this._roomMemberId = res.memberId;
Expand Down
18 changes: 18 additions & 0 deletions test/conference.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@ test('join sends room.join with mapped flags and returns fsmrf shape', async ()
assert.deepStrictEqual(res, { memberId: '7', confUuid: 'u-1' });
});

test("join maps flags['dist-dtmf'] to distDtmf", async () => {
const { ep, calls } = makeEp((cmd) =>
cmd === 'room.join' ? { roomUuid: 'u-2', memberId: 3 } : {});
await ep.join('myconf', { flags: { 'dist-dtmf': true } });

const join = calls.find((c) => c.cmd === 'room.join');
assert.deepStrictEqual(join.data, { room: 'myconf', distDtmf: true });
});

test('join omits distDtmf when dist-dtmf is not set', async () => {
const { ep, calls } = makeEp((cmd) =>
cmd === 'room.join' ? { roomUuid: 'u-3', memberId: 4 } : {});
await ep.join('myconf', { flags: { moderator: true } });

const join = calls.find((c) => c.cmd === 'room.join');
assert.ok(!('distDtmf' in join.data), 'distDtmf must be absent when the flag is off');
});

test('api conference get count returns the count as a body string', async () => {
const { ep } = makeEp((cmd) => (cmd === 'room.query' ? { found: true, count: 3 } : {}));
const res = await ep.api('conference', ['myconf', 'get', 'count']);
Expand Down
Loading