CallXML 2.0 Development Guide Home  |  Frameset Home

  Transfer & Call Variables  |  TOC  |  D: Best Practices  
This documentation is for CallXML 2, which has been superceded by CallXML 3. The CallXML 2 language is not being updated any longer. CallXML 3, however, has many new features and is actively being enhanced. If you're writing a new CallXML application, you should use CallXML 3. Click here for the CallXML 3.0 documentation.

Appendix C: CallXML Variables

If we are using CallXML, we will need to be aware of the variables available, the syntax necessary to access them, and how we can use them to our best advantage. This section will clue you in to the subtleties and nuances of using variables in the CallXML markup.

Session Variables

CallXML browsers include a per "call" or "session" variable space. The CallXML logic elements are used to assign and clear values in those variables, and to submit those variables as HTTP GET or POST information to traditional web applications created with languages such as ColdFusion, Perl, Java, and ASP.

No instantiation of these variables needs to be made at all, as they are implicity declared by the gateway server whenever a call is placed to the destination CallXML application. These session variables are listed below:

Variable Description
session.callerID the caller's phone number
session.calledID the number that was called to get here
session.eventsenderID the session ID of the sender of the last external event
session.eventvalue the event value sent to the invoking (parent) document when a <run> (child) session ends
session.accountID Voxeo ID of the called party (if known)
session.subaccountID party-specific information
session.ID identifier for the current session
session.lasterror printable information about the last error that happened
session.lasttermdigit contains information that remembers the last termdigit the caller pressed
application.errorURL where to go if the application terminated due to an unhandled event. There is a default URL provided by the system; setting it empty deactivates this feature
session.referredcalledid passes information about calls which have been forwarded from other phone numbers; specifically the number of the phone that forwarded the call to your application



Variable Naming Syntax

Variable names must start with a letter (A through Z or a through z) and can contain: A through Z, a through z, 0 through 9, and the underscore. Variable names can be 1 to 40 characters in length and are not case sensitive. Variable names beginning with the characters "session." in any case combination are reserved for internal system variables and cannot be created or set by the programmer. They are excluded from submission in a <goto> or a <run>. The same is for variables of the "application." type.

Thus, the following variable declarations would be considered incorrect:


<assign var="1_var" value="'frankenberry'"/>
<assign var="_1var" value="'chocula'"/>
<assign var="session.1_var" value="'booberry'"/>


Whereas the following listing would be considered 'legal':


<assign var="var1" value="'frankenberry'"/>
<assign var="Var_1" value="'chocula'"/>
<assign var="var1_session" value="'booberry'"/>



Variable Referencing

Any and all CallXML variables can be referenced within CallXML element attributes by using the $varname; syntax. To represent a single $ character it has to be encoded as $$. To illustrate further for the cubistic among us, an example of variable referencing is shown below:


...
  <block>
    <assign var="MyVar" value="'Mister Rogers'"/>

    <text> Welcome to $MyVar; neighborood</text>
  </block>
...


Time String Format

The time format standard used in CallXML is described here. Time format strings are used for maxtime and maxsilence attributes, and in the <wait> tag.

The time string format is:

<numeric value>[<optional qualifier>] | nolimit

The string begins with a required numeric value.

The valid qualifiers are:

Example: "45m 33s 117ms"

Note that if no qualifier is specified, an "s" qualifier is assumed. No combinations of qualifiers are allowed. If there is a need to specify an unlimited amount of time, simply use the key word "nolimit".




  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login
  Transfer & Call Variables  |  TOC  |  D: Best Practices  

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