VoiceXML 2.1 Development Guide Home  |  Frameset Home


<vxml>  element


The vxml element is the initial declaration that defines a document as a VoiceXML application.


usage

<vxml application="CDATA" version="(2.0|2.1)" xml:base="CDATA" xml:lang="NMTOKEN" xmlns="http://www.w3.org/2001/vxml" xmlns:voxeo="http://community.voxeo.com/xmlns/vxml">


attributes

application Data Type: CDATA Default: Optional
The value of  the application attribute is a URI used to specify the applications root document. When specified, all event handlers, variables, links, grammars, and scripts contained within the root document are considered active when each document  loads. All variables declared within the root document are then considered to have application scope, and are available at any point in the application.
version Data Type: (2.0|2.1) Default: Optional
The version attribute represents the VoiceXML version number. Note that specifying the version as '2.1' is required when using the new 2.1 elements, such as the data element.
xml:base Data Type: CDATA Default: Optional
The URI value of the xml:base attribute denotes the base URL of the document. All relative URI’s contained in the document are derived from the base attributes value. If unspecified, then the platform assumes that the current URI is the value of the base attribute.
xml:lang Data Type: NMTOKEN Default: Optional (en-US)
The xml:lang attribute specifies the language and locale information of the VoiceXML document. If omitted, it will inherit this value from the document hierarchy, or ultimately from the platform default, which equates to 'en-US'. The language and locale information is not case-sensitive.

For VoiceXML language options and mappings, see ASR Languages and TTS Languages.
xmlns Data Type: http://www.w3.org/2001/vxml Default: http://www.w3.org/2001/vxml
The xmlns attribute defines the VoiceXML namespace; all tags and attributes belong to this namespace. If specifying the xmlns:nuance attribute in your code, this element will be filled in by default.
xmlns:voxeo Data Type: http://community.voxeo.com/xmlns/vxml Default: none - attribute is optional
The 'xmlns:voxeo' attribute is a required setting that refers to the xml namespace used when a developer includes a voxeo extension element to the VXML specification, (such as <voxeo:recordcall>). This attribute value should always be specified as 'http://community.voxeo.com/xmlns/vxml'



shadow variables

none


parents

none


children

<catch>   <error>   <form>   <help>   <link>   <menu>   <meta>   <noinput>   <nomatch>   <property>   <script>   <var>


code samples

<AppRoot.vxml>
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1">


<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>


<catch event="GlobalEvent">
        <prompt> we caught a global event. </prompt>
    </catch>

<form id="F1">
  <block>
    <prompt>
      here is some text that will not be executed.
    </prompt>
    </block>
</form>
</vxml>


<Vxml application-xml:base> sample
<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.1"
application="AppRoot.vxml" xml:base="http://ThisServer/ThisDirectory/">



<meta name="author" content="Matthew Henry"/>
<meta name="copyright" content="2005 voxeo corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>


<form id="F1">
  <block>
    <prompt> preparing to throw a global event, which will be
          caught by the application root document.
    </prompt>
    <throw event="GlobalEvent"/>
  </block>
</form>
</vxml>



additional links

W3C 2.0 Specification


  ANNOTATIONS: EXISTING POSTS
jasrags
4/30/2004 1:06 PM (EDT)
in :
code samples

2.-0 <AppRoot.vxml>

<?xml version="1.0" encoding="UTF-8"?>

<vxml version = "2.0" <----- Missing tailing ">"
MattHenry
4/30/2004 1:48 PM (EDT)
Thanks for catching yet another typo for me; i have this fixed in the most recent build.

~Matt
awirtz
1/26/2005 8:38 PM (EST)
If you need to track down XML syntax errors in a VXML document, you might try adding the following DOCTYPE element and using an XML validator:

<!DOCTYPE vxml SYSTEM "http://www.w3.org/TR/voicexml21/vxml.dtd">

This tag should be placed after the <?xml?> tag and before the <vxml> tag in your document.  There is a publicly available XML validator here:

http://www.stg.brown.edu/service/xmlvalid/

(Note that the first 4 warnings it outputs are complaints about the DTD file at W3 and are not directed at your document.  Ignore them.)
codingace
1/23/2008 2:47 PM (EST)
This is great for manually throwing an event, but what if a hangup or disconnect takes place? Is there a nice way to handle the catch event at the application level?
VoxeoDustin
1/23/2008 4:44 PM (EST)
Hey,

There sure is. You'll simply need to create a root document that contains your <catch>.

For example:

root.vxml
--------
<?xml version="1.0"?>
<vxml version="2.1">

  <catch event="connection.disconnect.hangup">
      <!-- do our clean up -->
    <exit/>
    <!-- we absolutely MUST explicitly exit in any connection.disconnect handler
    to kill the session -->
  </catch>

</vxml>


leaf.vxml
--------
<?xml version="1.0"?>
<vxml version="2.1" application="root.vxml">

<!-- our code here -->

</vxml>

Note: The <catch> event must be scoped at the <vxml> level and that your leaf documents must have a voice reco field for the event to be caught.

Thanks,
Dustin
jaffar
6/11/2008 8:03 AM (EDT)
i want to create a vxml file in that i want to validate the user three times..like first i want to confirm his name,pin,password..
can u please giv me the vxml code for that....
voxeojeremyr
6/11/2008 11:07 AM (EDT)
Hi,

We have lots of examples in our tutorials about things like this that you can find here:
http://docs.voxeo.com/voicexml/2.0/learningvoicexml.htm

But also, here is some sample code that should pint you in the right direction:

<form>
    <field name = "name">
          <prompt> What is the name? </prompt>
          <grammar type="application/grammar+xml" src= "name.grxml"/>
    </field>
    <field name = "pin" type="digits">
          <prompt> What is your pin? </prompt>
    </field>
    <filled>
          <if cond = "pin != '1234'">
                <prompt> That is the wrong pin </prompt>
                <reprompt/>
                <clear namelist = "pin"/>
            </if>
      </filled>
</form>

Thanks,
Jeremy Richmond
Voxeo Support
jlust
11/6/2008 6:13 PM (EST)
In my application I want to capture the current location of the user as the proceed through the script. The intention is to know where they are when they hangup. I know that I can get this information by parsing CPA files, but it is much simpler to track it in the script. However, is there an easier way? Is there any VXML application or platform property like application.lastform or .currentform which can be access on Session.telephone.Hangup?

Thanks.

-Joe
jdyer
11/6/2008 7:02 PM (EST)
Hi,

    Unfortunately there are no session variable to do explicitly what you are looking for here, however this behavior is rather simple to create via the <assign> element.  Simply assigning a 'state' to a variable in each section or form seems like it would achieve just what you are looking for.  This is similar to the state variable in CCXML.  If you are looking to archive this then you can make use of the <data> element and post it for server side processing at your disconnect handler. 

    I hope that helps and please let us know if there are any additional questions as we are certainly standing by to offer any assistance out developers may require!

Regards,

John D.
Customer Engineer
Voxeo Support
pppeter
8/13/2009 12:56 PM (EDT)
Please forgive me if this question is answered somewhere in the documentation. I looked, but couldn't find it.

Basically, I have some VXML files that I register under the "Files, Logs, Reports" root/www directory, and other VXML files that are loaded dynamically from my own web server. In <goto>s and <subdialog>s, I can reference VXML files which are served by my own server by including the URL to my own server. If I then want to reference a VXML that is registerd under "File, Logs, Reports", I'm finding it necessary to prepend the "http://webhosting.voxeo.net/" URL that is generated for my application to any URL I specify in a <goto>.

Is there an alias for "my own voxeo www directory" that I can use instead of using the specific "http://webhosting.voxeo.net/" URL for my application?

Thanks,

Peter
VoxeoDante
8/13/2009 1:07 PM (EDT)
Hello Peter,

If you are referencing a file in your webhosting account from a file also in that account you should be able to use relative paths in the <goto> or <subdialog>, but if you have already transitioned to a file located on your webserver you will have to use the fully qualified URL.

There is no particular alias for your files in particular.  If you do not want to use the whole URL you can always put everything on your webserver and then use only relative paths in all documents.

I hope this clears things up.

Regards,
Dante Vitulano
Customer Support Engineer II
Voxeo Corporation
amit.chennur
9/26/2009 1:30 AM (EDT)
Hi,

How can I identify if call is answered by human or answering machine.

Thanks.
voxeoJeffK
9/26/2009 1:56 AM (EDT)
Hello,

Answering Machine Detection or use of the Call Progress Analyzer is really best handled at the CCXML layer below VoiceXML so that the appropriate actions can be taken at the call-control level. We have a tutorial on how this is accomplished in our CCXML documentation here:

  http://docs.voxeo.com/ccxml/1.0-final/ansdetection_ccxml10.htm

Regards,
Jeff Kustermann
Voxeo Support
mchalla
6/28/2010 2:16 PM (EDT)
I followed this and got it working..with document/page scope.(although I am not sure why I am not getting application scope)


In my application I was planning to save some user information in root variables dynamically at run time. For a single user it is fine but there is a good chance of having multiple users. Will this be a problem. Or do we have some id generated for each vxml application call.


For example

root.vxml
var test

child.vxml    ----> user1 calls and sets the value in test variable
assign test = test1


when user2 makes call
will the variable test have value already set as "test1"
or
it will be set again.. will it effect the user1?

Thanks.
VoxeoBrian
6/28/2010 2:27 PM (EDT)
Hello,

Each VoiceXML invocation has its own sessionID associated with, the same holds true from the CCXML session it has front ending it.

http://www.vxml.org/mot_sessionvars.htm

You should be able to rely on these for distinction between running sessions, and maintain proper state between different customers on the same application.  Having said that, as part of the HTTP based request you will use for each outbound call, you can use your own back end generated GUID to tie requests to your backend process that can be retrieved in the application context.

[b]
session.parentsessionid
This session variable will contain the sessionID value from the invoking CCXML wrapper of a VoiceXML dialog.
session.parentsessionid = 070a0be7e7eb6f24eae72509aafa00e3

session.sessionid
This session variable will display the session ID for the particular call in question:
SESSION.SESSIONID=dd552fcdc5fccef412f96d38818a1c25
[/b]

Hope this helps.

Regards,

Brian F.

login



© 2012 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site