Record

Metreos.MediaControl.Record

Asynchronous Callbacks

Summary

Records audio from a connection or conference.

Usage

The Record action allows one to convert the voice stream of either a single connection or an entire conference into a WAV or VOX file. A connection can be recorded whether it is in or out of a conference.

Recorded files are placed into the root of the media engine audio path, which by default is C:\Program Files\Cisco Systems\Unified Application Environment\MediaServer\Audio.

The termination condition parameters on the action are a means to create a matrix of reasons that the action should stop successfully. In the Record_Complete event, one can use TerminationCondition to determine why the command stopped recording.

Remarks

The Record action will analyze the Filename action parameter (if specified) to determine if it is a full path. If it is a full path and assuming the path does indeed exist on the OS filesystem, the Record action will place the recording there. Note that when a full path is specified, the media engine will not automatically expire the file, regardless of the value of the Expires parameter. If the filename is simply a file name (no path), or if it is not specified and the name is generated by the media engine automatically, then the media engine will concat the base audio path and the filename; the Record action will place the recording in this location.

The following properties cover most allowable audio file formats that can be recorded by the media engine: sample rate of 6, 8, 11, sample size of 4, 8, and 16 bit, and encoding types of ulaw, alaw, pcm, and adpcm. Only mono vox and wav files are allowed.

A Record to a connection or a conference results in a voice resource being utilized until the action results in Record_Complete event.

If a connection is specified as the recepient of the Record, the voice resource attaches to the connection. If a conference is specified as the recepient of the Record, a new connection (which uses a conference resource) is created and added to the conference for the duration of the Record, and the voice resource is attached to that new connection. It is important to understand this behavior, as the ConnectionId result data will always be the connection to which the Record voice resource is attached. In other words, in the case of a Record to a connection, the value of the ConnectionId result data is the same as that specified as an action parameter. In the case of a Record to a conference, the value of the ConnectionId result data is the value of the new connection added to conference which is only a valid value for the duration of the Record. In either case, this result data ConnectionId is what one would later specify in StopMediaOperation.

Action Parameters
Parameter Name.NET TypeDefaultDescription
AudioFileFormatSystem.StringThe format of the audio file: wav or vox. If not specified, the media engine configuration file defines the file format to use, which by default is vox.
AudioFileEncodingSystem.StringThe encoding of the audio file: ulaw, alaw, pcm, or adpcm. Pcm and adpcm should be avoided as each has a higher impact on the media engine. If not specified, the media engine configuration file defines the file encoding to use, which by default is ulaw.
CommandTimeoutSystem.UInt32Indicates a command timeout value (in milliseconds). If this condition is met, the Record command will result in the Record_Complete event with a TerminationCondition of timeout.
AudioFileSampleSizeSystem.UInt32The sample size used in the audio file (in bits). Valid values are 4, 8, or 16. 4 and 16 should be avoided as both have a higher impact on the media engine. If not specified, the media engine configuration file defines the sample size to use, which by default is 8.
ExpiresSystem.UInt321The number of days until the file is automatically deleted from the server. A value of 0 will indicate that the file should never be deleted by the media engine.
StateSystem.StringOptional user state information which is guaranteed present as the State event parameter in Record_Complete or Record_Failed.
TimeoutSystem.Int32The Timeout property specifies to the Application Runtime Environment how long to wait for a response from the provider for the current action. The ReturnValue returned in this case is Timeout. The value must be a literal value in milliseconds.
FilenameSystem.StringThe name of the audo file to create. If not specified, the media engine will generate a random file name, which is obtainable through either the result data FileName or in the Record_Complete event via the Filename event parameter.
ConnectionIdSystem.StringThe connection to perform the Record on. If specified, ConferenceId must not be specified.
ConferenceIdSystem.StringThe conference to perform the Record on. If specified, ConnectionId must not be specified.
TermCondMaxTimeSystem.UInt32The amount of time (in milliseconds) that can elapse before terminating the Record operation. If this condition is met, the Record command will result in the Record_Complete event with a TerminationCondition of maxtime.
TermCondDigitSystem.StringA specific digit that will cause the Record operation to terminate. If this condition is met, the Record command will result in the Record_Complete event with a TerminationCondition of digit. If you wish to know what digit or digits were pushed, use GatherDigits after Record_Complete, which will process the digits collected into the digit buffer as the Record command was executing. Note that this termination condition is only valid if one is recording a ConnectionId.
TermCondSilenceSystem.UInt32The amount of silence (in milliseconds) to observe before terminating the Record operation. If this condition is met, the Record command will result in the Record_Complete event with a TerminationCondition of silence.
TermCondNonSilenceSystem.UInt32The amount of non-silence (in milliseconds) to observe before terminating the Record operation. If this condition is met, the Record command will result in the Record_Complete event with a TerminationCondition of nonsilence.
AudioFileSampleRateSystem.UInt32The sample rate of the audio file (in kHz). Valid values are 6, 8, or 11. 11 should be avoided as it has a higher impact on the media engine. If not specified, the media engine configuration file defines the sample rate to use, which by default is 8.
Result Data
Parameter Name.NET TypeDescription
FilenameSystem.StringThe filename used to save the recording. The filename is relative to the root of the media engine audio path.
UrlSystem.StringThe URL to the recorded audio file.
ResultCodeSystem.StringA numeric code indicating the result status of the operation. A '0' indicates success; a positive number indicates an error. Please reference the Media Control Error Codes table for descriptions on specific error codes.
ConnectionIdSystem.StringIn the case of a Record to a connection, the value of the ConnectionId result data is the same as that specified as an action parameter. In the case of a Record to a conference, the value of the ConnectionId result data is the value of the new connection added to conference. In either case, this ConnectionId is what one would later specify in StopMediaOperation if one were to abort the command programmatically.
OperationIdSystem.StringA unique identifier to this Record operation. This identifier can later be used by the StopMediaOperation action to stop just this particular operation on a connection, even if multiple media operations are concurrently executing on that connection. In the case that the Record was specified to a conference, there is no reason to store OperationId, since the ConnectionId returned as a result data will only ever have this Record action operating on it.

Branch Conditions 

Success

No description.

Failure

No description.

Timeout

No description.