mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-01-25 02:08:24 +00:00
Fix: Allow media_path updates from REST API (#533)
Added media_path to the list of allowed properties for call updates via REST API. Includes validation to ensure media_path values are one of: no-media, partial-media, or full-media. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -308,7 +308,8 @@ function validateUpdateCall(opts) {
|
|||||||
'dtmf',
|
'dtmf',
|
||||||
'conferenceParticipantAction',
|
'conferenceParticipantAction',
|
||||||
'dub',
|
'dub',
|
||||||
'boostAudioSignal'
|
'boostAudioSignal',
|
||||||
|
'media_path'
|
||||||
]
|
]
|
||||||
.reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0);
|
.reduce((acc, prop) => (opts[prop] ? ++acc : acc), 0);
|
||||||
|
|
||||||
@@ -372,6 +373,9 @@ function validateUpdateCall(opts) {
|
|||||||
throw new DbErrorBadRequest('conferenceParticipantAction requires tag property when action is \'coach\'');
|
throw new DbErrorBadRequest('conferenceParticipantAction requires tag property when action is \'coach\'');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (opts.media_path && !['no-media', 'partial-media', 'full-media'].includes(opts.media_path)) {
|
||||||
|
throw new DbErrorBadRequest('invalid media_path');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateTo(to) {
|
function validateTo(to) {
|
||||||
|
|||||||
Reference in New Issue
Block a user