add support for LCC updateCall with conferenceParticipantState (#296)

* add support for LCC updateCall with conferenceParticipantState

* wip

* wip
This commit is contained in:
Dave Horton
2024-04-22 11:06:08 -04:00
committed by GitHub
parent f67abddbd4
commit 2436bea6ea
2 changed files with 31 additions and 1 deletions

View File

@@ -265,7 +265,8 @@ function validateUpdateCall(opts) {
'sip_request',
'record',
'tag',
'dtmf'
'dtmf',
'conferenceParticipantAction'
]
.reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0);
@@ -316,6 +317,19 @@ function validateUpdateCall(opts) {
if (opts.tag && (typeof opts.tag !== 'object' || Array.isArray(opts.tag) || opts.tag === null)) {
throw new DbErrorBadRequest('invalid tag data');
}
if (opts.conferenceParticipantAction) {
if (!['tag', 'untag', 'coach', 'uncoach', 'mute', 'unmute', 'hold', 'unhold']
.includes(opts.conferenceParticipantAction.action)) {
throw new DbErrorBadRequest(
`conferenceParticipantAction invalid action property ${opts.conferenceParticipantAction.action}`);
}
if ('tag' == opts.conferenceParticipantAction.action && !opts.tag) {
throw new DbErrorBadRequest('conferenceParticipantAction requires tag property when action is \'tag\'');
}
if ('coach' == opts.conferenceParticipantAction.action && !opts.tag) {
throw new DbErrorBadRequest('conferenceParticipantAction requires tag property when action is \'coach\'');
}
}
}
function validateTo(to) {

View File

@@ -4152,6 +4152,22 @@ paths:
type: string
siprecServerURL:
type: string
conferenceParticipantAction:
type: object
properties:
action:
type: string
enum:
- tag
- untag
- coach
- uncoach
- mute
- unmute
- hold
- unhold
tag:
type: string
responses:
200:
description: Accepted