CallXML 2.0 Development Guide Home  |  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.

<sendevent>  element


The <sendevent> element is a tag that allows one session to send a user-defined message to another entirely separate session, such as when a <run> element has been used in the document.


Note: CallXML can only send events to other CallXML sessions on the same computer handling both sessions and should not be used a hosted environment.




usage

<sendevent session ="STRING" value="CDATA">


attributes

session Data Type: STRING Default: none - attribute is required
This attribute contains the ID of the session to which the event will be sent.
Be advised, that specifying an empty session attribute will result in an error, also if the session is ceased already or never existed at all.
value Data Type: CDATA Default: Required
The value attribute defines the string containing the body of the event message to be sent.



possible events

onerrortype="event" When certain errors occur an <onError> event is generated. This gives the CallXML developer a way to handle error conditions that may occur while CallXML actions are executing.
onerror type="document" Document was unable to be fetched for all the reasons web servers are unavailable



code samples

<Catchevent.xml>
<?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" />

    <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>


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

<callxml version="2.0">


<block label="B1">

<call value="$NumToCall;"
      maxtime="20s" callerID="6666666666"/>
 
    <onanswer>
      <log> *** SENDING EVENT TO PARENT SESSION *** </log>
      <sendevent value="Success"
                session="$ParentSessionID;"/>

      <wait value="Unlimited"/>                     
    </onanswer>
 
    <oncallfailure value="busy">
      <log> *** SENDING EVENT TO PARENT SESSION *** </log>
      <sendevent value="busy"
                session="$ParentSessionID;"/>

    </oncallfailure>

    <oncallfailure value="noanswer">
      <log> *** SENDING EVENT TO PARENT SESSION *** </log>
      <sendevent value="noanswer"
                session="$ParentSessionID;"/>

    </oncallfailure>

    <oncallfailure value="unreachable">
      <log> *** SENDING EVENT TO PARENT SESSION *** </log>
      <sendevent value="unreachable"
                session="$ParentSessionID;"/>

    </oncallfailure>
 
    <oncallfailure value="rejected">
      <log> *** SENDING EVENT TO PARENT SESSION *** </log>
      <sendevent value="rejected"
                session="$ParentSessionID;"/>

    </oncallfailure>

    <oncallfailure value="unknown">
      <log> *** SENDING EVENT TO PARENT SESSION *** </log>
      <sendevent value="unknown"
                session="$ParentSessionID;"/>

    </oncallfailure>

    <onmaxtime>
      <log> *** SENDING EVENT TO PARENT SESSION *** </log>
      <sendevent value="TimedOut"
                session="$ParentSessionID;"/>

    </onmaxtime>

</block>

</callxml>



additional links

none


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

login



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