Skip to content

Commit

Permalink
support inband dtmf
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu committed Nov 15, 2023
1 parent dcfe6cc commit e5f7c6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/routes/api/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ function validateUpdateCall(opts) {
'conf_mute_status',
'mute_status',
'sip_request',
'record'
'record',
'inband_dtmf',
]
.reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0);

Expand Down Expand Up @@ -266,6 +267,9 @@ function validateUpdateCall(opts) {
if (opts.record && !opts.record.action) {
throw new DbErrorBadRequest('record requires action property');
}
if (opts.inband_dtmf && !['digit'].includes(opts.inband_dtmf)) {
throw new DbErrorBadRequest('invalid inband_dtmf');
}
if ('startCallRecording' === opts.record?.action && !opts.record.siprecServerURL) {
throw new DbErrorBadRequest('record requires siprecServerURL property when starting recording');
}
Expand Down

0 comments on commit e5f7c6d

Please sign in to comment.