diff --git a/lib/tasks/conference.js b/lib/tasks/conference.js index 9d260f36..4d5cb503 100644 --- a/lib/tasks/conference.js +++ b/lib/tasks/conference.js @@ -48,7 +48,7 @@ class Conference extends Task { this.confName = this.data.name; [ 'beep', 'startConferenceOnEnter', 'endConferenceOnExit', 'joinMuted', - 'maxParticipants', 'waitHook', 'statusHook', 'endHook', 'enterHook' + 'maxParticipants', 'waitHook', 'statusHook', 'endHook', 'enterHook', 'endConferenceDuration' ].forEach((attr) => this[attr] = this.data[attr]); this.record = this.data.record || {}; this.statusEvents = []; @@ -344,9 +344,13 @@ class Conference extends Task { } const opts = {}; - if (this.endConferenceOnExit) Object.assign(opts, {flags: {endconf: true}}); - if (this.startConferenceOnEnter) Object.assign(opts, {flags: {moderator: true}}); - if (this.joinMuted) Object.assign(opts, {flags: {mute: true}}); + if (this.endConferenceOnExit || this.startConferenceOnEnter || this.joinMuted) { + Object.assign(opts, {flags: { + ...(this.endConferenceOnExit && {endconf: true}), + ...(this.startConferenceOnEnter && {moderator: true}), + ...(this.joinMuted && {joinMuted: true}), + }}); + } try { const {memberId, confUuid} = await this.ep.join(this.confName, opts); @@ -389,6 +393,11 @@ class Conference extends Task { this.ep.api('conference', `${this.confName} set max_members ${this.maxParticipants}`) .catch((err) => this.logger.error(err, `Error setting max participants to ${this.maxParticipants}`)); } + + if (typeof this.endConferenceDuration === 'number' && this.endConferenceDuration >= 0) { + this.ep.api('conference', `${this.confName} set endconference_grace_time ${this.endConferenceDuration}`) + .catch((err) => this.logger.error(err, `Error setting end conference time to ${this.endConferenceDuration}`)); + } } /** diff --git a/package-lock.json b/package-lock.json index 0ede0450..71c3a60b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@jambonz/speech-utils": "^0.0.19", "@jambonz/stats-collector": "^0.1.9", "@jambonz/time-series": "^0.2.8", - "@jambonz/verb-specifications": "^0.0.27", + "@jambonz/verb-specifications": "^0.0.30", "@opentelemetry/api": "^1.4.0", "@opentelemetry/exporter-jaeger": "^1.9.0", "@opentelemetry/exporter-trace-otlp-http": "^0.35.0", @@ -3019,9 +3019,9 @@ } }, "node_modules/@jambonz/verb-specifications": { - "version": "0.0.27", - "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.27.tgz", - "integrity": "sha512-DIcxhCNrgr2RTE3YrGNP15RqKyV+P8f97SPBlKd2zTM5aN2oV5xv+pRDx5gLzmrUZ5TIEaBXQN3vTmM2Zx5Q6g==", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.30.tgz", + "integrity": "sha512-IbusgtBBo2V5Tc1FvDJvkWogHOhR2tNZN6Iyb2PjUomMI48BsWKmHW/wegppKTDpBBeN3ABY+L96pvX4N0+mCw==", "dependencies": { "debug": "^4.3.4", "pino": "^8.8.0" @@ -12985,9 +12985,9 @@ } }, "@jambonz/verb-specifications": { - "version": "0.0.27", - "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.27.tgz", - "integrity": "sha512-DIcxhCNrgr2RTE3YrGNP15RqKyV+P8f97SPBlKd2zTM5aN2oV5xv+pRDx5gLzmrUZ5TIEaBXQN3vTmM2Zx5Q6g==", + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.30.tgz", + "integrity": "sha512-IbusgtBBo2V5Tc1FvDJvkWogHOhR2tNZN6Iyb2PjUomMI48BsWKmHW/wegppKTDpBBeN3ABY+L96pvX4N0+mCw==", "requires": { "debug": "^4.3.4", "pino": "^8.8.0" diff --git a/package.json b/package.json index 5d142350..270345b8 100644 --- a/package.json +++ b/package.json @@ -25,13 +25,15 @@ "jslint:fix": "eslint app.js tracer.js lib --fix" }, "dependencies": { + "@aws-sdk/client-auto-scaling": "^3.360.0", + "@aws-sdk/client-sns": "^3.360.0", "@jambonz/db-helpers": "^0.9.1", "@jambonz/http-health-check": "^0.0.1", "@jambonz/realtimedb-helpers": "^0.8.6", "@jambonz/speech-utils": "^0.0.19", "@jambonz/stats-collector": "^0.1.9", "@jambonz/time-series": "^0.2.8", - "@jambonz/verb-specifications": "^0.0.27", + "@jambonz/verb-specifications": "^0.0.30", "@opentelemetry/api": "^1.4.0", "@opentelemetry/exporter-jaeger": "^1.9.0", "@opentelemetry/exporter-trace-otlp-http": "^0.35.0", @@ -41,8 +43,6 @@ "@opentelemetry/sdk-trace-base": "^1.9.0", "@opentelemetry/sdk-trace-node": "^1.9.0", "@opentelemetry/semantic-conventions": "^1.9.0", - "@aws-sdk/client-sns": "^3.360.0", - "@aws-sdk/client-auto-scaling": "^3.360.0", "bent": "^7.3.12", "debug": "^4.3.4", "deepcopy": "^2.1.0",