CCXML 1.0-W3C Development Guide Home  |  Frameset Home


<var>  element


The <var> element is used to explicitly declare CCXML variables. All expressions must be valid ECMAScript expressions, assignable to variables with valid ECMAScript names.



usage

<var expr="(ECMAScript Expression)" name="(variable name)">


attributes

expr Data Type: (ECMAScript Expression) Default: none - attribute is required
The expr attribute specifies the value to assign to the variable in question. This may be any valid ECMAScript value.
name Data Type: (variable name) Default: none - attribute is optional
The name attribute indicates the name of the variable. Any valid ECMAScript variable names are permitted as a value for this attribute.



parents

none


children

none


code samples

<1.0 var -name-expr> sample
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

  <var name="BenFranklin"
      expr="'They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.'"/>


<eventprocessor>
  <transition event="connection.alerting">
  <accept/>
  <log expr="'***** CALL ACCEPTED *****'"/>
  </transition>

  <transition event="connection.connected">
  <log expr="'*** BEN FRANKLIN SAYS: ' + BenFranklin"/>
  <dialogstart src="'null://?text=' + BenFranklin" type="'application/x-texttospeech'"/> 
  </transition>

  <transition event="dialog.exit">
    <log expr="'***** CALL EXITING *****'"/>
    <exit/>
  </transition>

  <transition event="error.*">
  <log expr="'ERROR OCCURRED: '+ event$.name"/>
  <exit/>
  </transition>
</eventprocessor>

</ccxml>



additional links

W3C Specification


  ANNOTATIONS: EXISTING POSTS
lourens
8/12/2010 8:44 AM (EDT)
What is the implication of adding a '.' to a variable name, for instance 'OutgoingCall.CallerID'?
jdyer
8/12/2010 9:02 PM (EDT)
Hello,
 
  You should always ahead to ECMAScript convention for CCXML variable names, these rules, as I am sure you are aware, are that no variable can start with a numeral, can not contain spaces, can not be a reserved word, and also may not contain any punctuation.  I do hope this helps and if there are any other questions please let us know as our team is most certainly standing by to be of service!

Regards,

John Dyer
Customer Engineer
Voxeo Support

login



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