CallXML 2.0 Development GuideHome  |  Frameset Home

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.
<run>  element

This element will run/start a new session, and fetches a CallXML document to use for the session from the URL or URI specified by value. The rule for <run> is that you can only run to a root level <block> in a document, even if "run"-ing to the same document:


<run value="same_doc.xml#another_block_in_this_doc"/>


The submit attribute can be used to pass copies of CallXML browser variables from the parent session with the HTTP(S)/FTP operation used to fetch the new document. The method attribute is used to select whether to use HTTP(S) GET/POST or FTP binary/ASCII.


usage
<run cache="(yes|no)" method="(GET|POST|BIN|ASC)" submit="(variable name)" value="URI" var="(variable name)">


attributes
cacheData Type: (yes|no)Default: none - attribute is optional
Allows manual override over the caching mechanism. If this attribute is empty the default system caching is used. "yes" should force the system to use the cache all the time, "no" means that no cache should be used at all.
methodData Type: (GET|POST|BIN|ASC)Default: none - attribute is optional
The method attribute specifies the HTTP method to use when sending the request. Allowable values for the method attribute are:
  • "get" for HTTP GET
  • "post" for HTTP POST
  • "bin" for FTP binary transport
  • "asc" for FTP ASCII transport

  • Any other values defined for this attribute will result in a fatal error. If no method is specified, then it will always default to 'GET'.
submitData Type: (variable name)Default: none - attribute is optional
List of variables to submit to the called URL/URI can be "all" or "*" for everything, or a comma delimited list of variables to submit:

submit = "Variable1, Variable2, Variable3, Variable5, Variable9"

Note that you can also specify "nothing" if no variables are to be submitted. If non-existant variable names are specified a fatal error will result. Also, if "all" or "*" is specified, no other variable names should be listed with it.
valueData Type: URIDefault: none - attribute is required
Either a full URL (http://MyServer.com/MyDocument.xml) or a local URI pointing to a <block> label in the same CallXML file (e.g., #main_menu).

Supported URL formats include:
  • http://    Read data
  • https://  Read data (over a secure connection)
  • ftp://      Read data
An empty or invalid value will result in a fatal error. Invalid values are:
  • value="[optional url]#"
  • value="[optional url]#foo", and "foo" does not exist as a label in the document
Domain names can contain port numbers and login information, for instance:

value="ftp://me:door@ftp.me.com:2345/myapp/start.xml"
varData Type: (variable name)Default: none - attribute is optional
A valid variable name in which to store the new session ID.



possible events
onerror type="document"Document was unable to be fetched for all the reasons web servers are unavailable
onerror type="serverbusy"No sessions available on the server for <run> or <answer> etc
onerror type="execution"Indicates that a child session specified in the <run> tag points to an invalid URI.




code samples
<Run value - cache - submit - method - var>
<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">

<block>
    <assign var="ParentSessionID" value="$session.ID;"/>
    <assign var="NumToCall" value="1112223333"/>

  <run value="Call_Target.cfm"
  submit="*"
  method="get"
  var="NewSessionID"
  cache="yes"/>


    <block label="HoldMusic"
          repeat="3">

      <playaudio format="audio/wav"
          value="RingTone.wav"
          termdigits=""/>

      <onexternalevent value="Success">
        <conference targetsessions="$session.EventsenderID;"/>
        <hangup/>
      </onexternalevent>

      <onexternalevent value="Busy">
        <text>
          All lines are currently busy.
          Please hang up and try your call again later.
        </text>
        <hangup/>
      </onexternalevent>

      <onexternalevent value="TimedOut">
        <text>
          There is no answer.
          Please hang up and try your call again later.
        </text>
        <hangup/>
      </onexternalevent>


    </block>

  </block>

</callxml>

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

<callxml version="2.0">


<block label="B1">

<call value="$NumToCall;"
      maxtime="20s" callerID="6666666666"/>
 
    <onanswer>
      <sendevent value="Success"
                session="$ParentSessionID;"/>
      <wait value="Unlimited"/>                     
    </onanswer>
 
    <oncallfailure value="busy">
      <sendevent value="busy"
                session="$ParentSessionID;"/>
    </oncallfailure>

    <oncallfailure value="noanswer">
      <sendevent value="noanswer"
                session="$ParentSessionID;"/>
    </oncallfailure>

    <oncallfailure value="unreachable">
      <sendevent value="unreachable"
                session="$ParentSessionID;"/>
    </oncallfailure>
 
    <oncallfailure value="rejected">
      <sendevent value="rejected"
                session="$ParentSessionID;"/>
    </oncallfailure>

    <oncallfailure value="unknown">
      <sendevent value="unknown"
                session="$ParentSessionID;"/>
    </oncallfailure>

    <onmaxtime>
      <sendevent value="TimedOut"
                session="$ParentSessionID;"/>
    </onmaxtime>

</block>

</callxml>

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

<callxml version="2.0">

<assign var="ParentSessionID" value="$session.ID;"/>
  <block label="B_0">

<!-- THIS SAMPLE ASSUMES THAT WE WANT TO DO A DB LOOKUP IN OUR -->
<!-- CHILD SESSION, AND RETURN THE VALUE TO THE PARENT SESSION -->
    <run value="timer.jsp" submit="*" method="get"
            var="timerSessionID"/>

    <playaudio format="audio/wav"
              value="spidey.wav"/>

<!-- CATCH ~ANY~ EVENT THAT DOESNT HAVE AN EXPLICIT HANDLER -->
<!-- WITH AN 'ANONYMOUS' EVENT HANDLER -->
    <onexternalevent>
      <log>** ANONYMOUS EVENT CAUGHT ***</log>
      <log>** DYNAMIC VALUE RETURNED FROM CHILD SESSION:</log>
      <log>*** $session.eventvalue; ***</log>
    </onexternalevent>

  </block>

</callxml>


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

<callxml version="2.0">

  <wait value="5s"/>
<!-- HERE, HIT OUR DATABASE, WHICH -->
<!-- RETURNS THE VALUE OF 'someDynamicValue' -->
<!-- DYNAMICALLY POPULATE THE 'send event' VALUE WITH THIS DATA -->
  <sendevent value="someDynamicValue" session="$ParentSessionID;"/>

</callxml>




additional links
none


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

login



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