support inband dtmf (#261)

* support inband dtmf

* support inband dtmf

* wip
This commit is contained in:
Hoan Luu Huu
2023-12-02 23:31:07 +07:00
committed by GitHub
parent e2d6086f9f
commit 4ec34faa29

View File

@@ -265,7 +265,8 @@ function validateUpdateCall(opts) {
'mute_status',
'sip_request',
'record',
'tag'
'tag',
'dtmf'
]
.reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0);
@@ -307,6 +308,9 @@ function validateUpdateCall(opts) {
if (opts.record && !opts.record.action) {
throw new DbErrorBadRequest('record requires action property');
}
if (opts.dtmf && !opts.dtmf.digit) {
throw new DbErrorBadRequest('invalid dtmf');
}
if ('startCallRecording' === opts.record?.action && !opts.record.siprecServerURL) {
throw new DbErrorBadRequest('record requires siprecServerURL property when starting recording');
}