Feature/siprec client (#45)

* updateCall now supports record action to start, stop, pause, or resume siprec

* update Dockerfile
This commit is contained in:
Dave Horton
2022-06-23 16:25:11 -04:00
committed by GitHub
parent eeb23109dc
commit 56b646b6db
4 changed files with 25 additions and 4 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
FROM node:17
FROM node:lts-slim
WORKDIR /opt/app/
COPY package.json ./
RUN npm install
@@ -7,4 +7,4 @@ COPY . /opt/app
ARG NODE_ENV
ENV NODE_ENV $NODE_ENV
CMD [ "npm", "start" ]
CMD [ "npm", "start" ]
+1 -1
View File
@@ -1,4 +1,4 @@
FROM node:17
FROM node:lts-slim
WORKDIR /opt/app/
COPY package.json ./
RUN npm install
+8 -1
View File
@@ -117,7 +117,8 @@ function validateUpdateCall(opts) {
'conf_hold_status',
'conf_mute_status',
'mute_status',
'sip_request'
'sip_request',
'record'
]
.reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0);
@@ -156,6 +157,12 @@ function validateUpdateCall(opts) {
(!opts.sip_request.method && !opts.sip_request.content_type || !opts.sip_request.content_type)) {
throw new DbErrorBadRequest('sip_request requires content_type and content properties');
}
if (opts.record && !opts.record.action) {
throw new DbErrorBadRequest('record requires action property');
}
if ('startCallRecording' === opts.record?.action && !opts.record.siprecServerURL) {
throw new DbErrorBadRequest('record requires siprecServerURL property when starting recording');
}
}
function validateTo(to) {
+14
View File
@@ -3135,6 +3135,20 @@ paths:
type: string
headers:
type: object
record:
type: object
properties:
action:
type: string
enum:
- startCallRecording
- stopCallRecording
- pauseCallRecording
- resumeCallRecording
recordingID:
type: string
siprecServerURL:
type: string
responses:
200:
description: Accepted