ManageGrammar

Metreos.MediaControl.ManageGrammar

Asynchronous Callbacks

Summary

Allows a developer to manually manage grammars on the Nuance OSR server.

Usage

ManageGrammar allows a developer a way to more tightly control the loading and unloading of grammars.

If one knows that a VoiceRecognition action is going to reference a very large grammar, or many grammars at once, there may be a negative performance impact on the Nuance OSR server, resulting in a delay before the voice regcognition operation can truly begin. With ManageGrammar, one can load specific grammars before they are needed to optimize performance. Conversely, grammars can also be unloaded if it is known that they are no longer needed.

Remarks

Only the VoiceRecognition action is required when building voice recognition-capable applications. ManageGrammar is only for additional control over grammars. If unsure whether or not you should use this action, then we recommend you ignore it, since its use is for optimization, but not core functionality.

Action Parameters
Parameter Name.NET TypeDefaultDescription
Grammar *System.StringA string or string[]. These files define the grammar rules to use when performing the management operation indicated by the Action parameter.. For each specified grammar file, there are three potential formats:
Static

If you specify just the grammar file name in the Cisco Unified Application Designer, such as grammar1.grxml, and if that grammar file name exists as a Voice Recognition resource in the project, then the ManageGrammar action will internally convert that grammar1.grxml file to a URI that references the location on the Application Server at which the grammar file can be accessed with HTTP. That URI is ultimately sent to Nuance OSR, which will in turn fetch that grammar file.

Dynamic

Dynamic grammar files are grammar files created by the script, while the script is running. Typically one would create the file using the SaveDynamicGrammar, which will return the HTTP URI for that file. The variable containing this HTTP URI would then be supplied as the grammar file name.

Builtin

Some grammars are provisioned with Nuance OSR, and it is also possible to provision grammars on Nuance OSR outside of the context of a Cisco Unified Application Environment application. To specify either type of 'builtin' grammar, just specify the grammar file name, such as grammar1.grxml. However, there should be no grammar file associated with your project of the same name.

Action *System.String
Load

In general, Load would be used in the case that a large grammar should be guaranteed to be loaded before the actual VoiceRecognition operation begins, so that the user experiences minimal delay.

Activate

This option should not be used.

Deactivate

This option should not be used.

Unload

In general, Unload would be used when one knows that a large grammar file no longer has use, and wishes to free up the associated resources on the Nuance OSR server.

Default

This option should not be used.

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.
CommandTimeoutSystem.UInt32Indicates a command timeout value (in milliseconds).
ConnectionId *System.StringThe connection to perform the ManageGrammar on.
Result Data
Parameter Name.NET TypeDescription
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.

Branch Conditions 

Success

No description.

Failure

No description.

Timeout

No description.