PlayTone

Metreos.MediaControl.PlayTone

Asynchronous Callbacks

Summary

PlayTone generates a tone to a connection or conference.

Usage

PlayTone allows one to mix two frequencies, each with distinct amplitudes, for a specified duration.

Remarks

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

If a connection is specified as the recepient of the PlayTone, the voice resource attaches to the connection. If a conference is specified as the recepient of the PlayTone, a new connection (which uses a conference resource) is created and added to the conference for the duration of the PlayTone, 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 PlayTone voice resource is attached. In other words, in the case of a PlayTone 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 PlayTone 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 PlayTone. In either case, this result data ConnectionId is what one would later specify in StopMediaOperation.

Action Parameters
Parameter Name.NET TypeDefaultDescription
TermCondSilenceSystem.UInt32The amount of silence (in milliseconds) to observe before terminating the PlayTone operation. If this condition is met, the PlayTone command will result in the PlayTone_Complete event with a TerminationCondition of silence.
DurationSystem.UInt32The length of time to play tone (in milliseconds).
ConnectionIdSystem.StringThe connection to perform the PlayTone on. If specified, ConferenceId must not be specified.
Amplitude2System.Int32The amplitude of the Frequency2 (in dB). The valid Range is from -40 to 0.
StateSystem.StringOptional user state information which is guaranteed present as the State event parameter in PlayTone_Complete or PlayTone_Failed.
ConferenceIdSystem.StringThe conference to perform the PlayTone on. If specified, ConnectionId must not be specified.
TermCondMaxTimeSystem.UInt32The amount of time (in milliseconds) that can elapse before terminating the PlayTone operation. If this condition is met, the PlayTone command will result in the PlayTone_Complete event with a TerminationCondition of maxtime.
TermCondDigitSystem.StringA specific digit that will cause the PlayTone operation to terminate. If this condition is met, the PlayTone command will result in the PlayTone_Complete event with a TerminationCondition of digit.
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.
TermCondNonSilenceSystem.UInt32The amount of non-silence (in milliseconds) to observe before terminating the PlayTone operation. If this condition is met, the PlayTone command will result in the PlayTone_Complete event with a TerminationCondition of nonsilence.
Frequency1System.UInt32The frequency to be played (in Hz). The valid range is from 200 to 3000.
Frequency2System.UInt32The frequency to combine with the first frequency (in Hz). The valid range is from 200 to 3000.
Amplitude1System.Int32The amplitude of the Frequency1 (in dB). The valid Range is from -40 to 0.
Result Data
Parameter Name.NET TypeDescription
OperationIdSystem.StringA unique identifier to this PlayTone 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 PlayTone 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 PlayTone action operating on it.
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 PlayTone 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 PlayTone 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.

Branch Conditions 

Success

No description.

Failure

No description.

Timeout

No description.