| How to create a sample external grammar that will work with your voice browser |
| Categories: Audium Studio (3.4.x) |
| Article ID: | 142 |
| Last updated: | November 02, 2006 |
| User Opinions |
|
No users have voted.
|
|
Thank you for rating this answer.
|
SUMMARY
This article explains how to use a Form element to help you generate a sample external grammar that conforms to the requirements of your voice browser. This sample external grammar can then be editted and included in an Audium application. This article is primarily intended for use with voice browsers that use XML grammars.
SYMPTOMS
Developer would like to create an external grammar, but is not familiar with any special requirements that the voice browser may have, and would like to see a sample.
RESOLUTION
Note: If your voice browser does not use XML grammars (e.g. it uses GSL grammars for example), we do not recommend using this method, as there may be additional considerations beyond what are explained below. However, you can still use this method to get an idea of what the grammars for your voice browser look like, even if you cannot use them as a basis for your own external grammars.
Since Audium's gateway adapters automatically produce VoiceXML and grammars that conform to your voice browser, you can leverage this functionality to see a sample grammar that will work with your voice browser. Follow these steps to create a sample external grammar file that you can then edit and use:
1) Create a new Audium application, and configure it to use the gateway adapter for the browser you would like to see the grammar format of
2) Add a Form element to the workspace
3) Connect Call Start's only exit state to the Form element
4) Connect all three of the Form element's exit states to a Hang Up element
5) Add and configure several Voice Keyword or DTMF Keypress settings for the Form element
6) Save and deploy the application
7) Start your application server
8) View the application in a web browser by accessing its URL, it will be in this format:
http://APP_SERVER_IP:PORT/Audium/Server?application=YOUR_APP_NAME
where APP_SERVER_IP is the IP address (or host name) of the application server that Call Services is running on, PORT is the port that your application server is listening on, and YOUR_APP_NAME is the name of the small application you just deployed.
9) Find the inline grammar in the VoiceXML that was generated by the Form element, and copy-and-paste it into a text editor.
You now have a basis for creating an external grammar that will work with your voice browser. There are two important notes however:
You must add the following line at the top of the grammar, since this line is required to appear in all stand-alone XML files:
<?xml version="1.0" encoding="UTF-8"?>
Additionally, if the "xmlns" attribute (highlighted in red below) is missing from the <grammar> element, it must be added. It is sometimes omitted from inline grammars but is required for external grammars:
<grammar xmlns="http://www.w3.org/2001/06/grammar" xml:lang="en" version="1.0" mode="voice" root="theRoot">
Edit this file as needed, to add additional utterances and semantic interpretations. Save this file, and store it on a web server. You can now access it via a URI from within a Form element in your Audium applications. This method is particularly useful to see how slots (i.e. semantic interpretations) are defined in the grammar for a particular voice browser, since these are often written differently from voice browser to voice browser.
|
| Visitor Comments |
|
No visitor comments posted. Post a comment
|
| Attachments |
|
No attachments were found.
|