diff options
author | Matthew Jordan <mjordan@digium.com> | 2014-07-25 14:47:09 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2014-07-25 14:47:09 +0000 |
commit | 355dc3d2ad98db624184a797206ccb88f4b8a526 (patch) | |
tree | b7247b841d9bb4587560208202b2182706a1fb5c /res/ari | |
parent | ba9867fab07b4e6f74916c898122bb6705598413 (diff) |
Multiple revisions 419565-419566
........
r419565 | mjordan | 2014-07-25 09:41:23 -0500 (Fri, 25 Jul 2014) | 21 lines
ARI: report duration values in LiveRecording objects
This patch adds three new fields to the LiveRecording model:
- total_duration: the total length of the live recording
- talking_duration: optional. The duration of talking energy that was
detected while the recording was made.
- silence_duration: optional. The duration of silence that was detected while
the recording was made.
These values are reported in the RecordingFinished ARI event.
When a DSP is enabled on the channel during the recording - which occurs when
the recording is created with max_silence_seconds (indicating that the user
actually cares about how much silence is in the file), we will report the
talking_duration and silence_duration in addition to the total_duration.
Review: https://reviewboard.asterisk.org/r/3770/
ASTERISK-24037 #close
Reported by: Samuel Galarneau
........
r419566 | mjordan | 2014-07-25 09:46:15 -0500 (Fri, 25 Jul 2014) | 1 line
Update CHANGES for r419565
........
Merged revisions 419565-419566 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@419567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/ari')
-rw-r--r-- | res/ari/ari_model_validators.c | 27 | ||||
-rw-r--r-- | res/ari/ari_model_validators.h | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/res/ari/ari_model_validators.c b/res/ari/ari_model_validators.c index d15ec494d..0302db327 100644 --- a/res/ari/ari_model_validators.c +++ b/res/ari/ari_model_validators.c @@ -1038,6 +1038,15 @@ int ast_ari_validate_live_recording(struct ast_json *json) res = 0; } } else + if (strcmp("duration", ast_json_object_iter_key(iter)) == 0) { + int prop_is_valid; + prop_is_valid = ast_ari_validate_int( + ast_json_object_iter_value(iter)); + if (!prop_is_valid) { + ast_log(LOG_ERROR, "ARI LiveRecording field duration failed validation\n"); + res = 0; + } + } else if (strcmp("format", ast_json_object_iter_key(iter)) == 0) { int prop_is_valid; has_format = 1; @@ -1058,6 +1067,15 @@ int ast_ari_validate_live_recording(struct ast_json *json) res = 0; } } else + if (strcmp("silence_duration", ast_json_object_iter_key(iter)) == 0) { + int prop_is_valid; + prop_is_valid = ast_ari_validate_int( + ast_json_object_iter_value(iter)); + if (!prop_is_valid) { + ast_log(LOG_ERROR, "ARI LiveRecording field silence_duration failed validation\n"); + res = 0; + } + } else if (strcmp("state", ast_json_object_iter_key(iter)) == 0) { int prop_is_valid; has_state = 1; @@ -1068,6 +1086,15 @@ int ast_ari_validate_live_recording(struct ast_json *json) res = 0; } } else + if (strcmp("talking_duration", ast_json_object_iter_key(iter)) == 0) { + int prop_is_valid; + prop_is_valid = ast_ari_validate_int( + ast_json_object_iter_value(iter)); + if (!prop_is_valid) { + ast_log(LOG_ERROR, "ARI LiveRecording field talking_duration failed validation\n"); + res = 0; + } + } else if (strcmp("target_uri", ast_json_object_iter_key(iter)) == 0) { int prop_is_valid; has_target_uri = 1; diff --git a/res/ari/ari_model_validators.h b/res/ari/ari_model_validators.h index c85115634..0186168b2 100644 --- a/res/ari/ari_model_validators.h +++ b/res/ari/ari_model_validators.h @@ -1179,9 +1179,12 @@ ari_validator ast_ari_validate_application_fn(void); * - technology: string (required) * LiveRecording * - cause: string + * - duration: int * - format: string (required) * - name: string (required) + * - silence_duration: int * - state: string (required) + * - talking_duration: int * - target_uri: string (required) * StoredRecording * - format: string (required) |