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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@419565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matthew Jordan
2014-07-25 14:41:23 +00:00
parent 787b4c9c99
commit 3795fc53dc
4 changed files with 67 additions and 12 deletions

View File

@@ -338,7 +338,7 @@
"description": "URI for the channel or bridge being recorded"
},
"state": {
"required": false,
"required": true,
"type": "string",
"allowableValues": {
"valueType": "LIST",
@@ -352,18 +352,25 @@
]
}
},
"duration": {
"required": false,
"type": "int",
"description": "Duration in seconds of the recording"
},
"talking_duration": {
"required": false,
"type": "int",
"description": "Duration of talking, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds."
},
"silence_duration": {
"required": false,
"type": "int",
"description": "Duration of silence, in seconds, detected in the recording. This is only available if the recording was initiated with a non-zero maxSilenceSeconds."
},
"cause": {
"required": false,
"type": "string",
"description": "Cause for recording failure if failed"
},
"state": {
"required": true,
"type": "string"
},
"format": {
"required": true,
"type": "string"
}
}
}