| CallXML 3.0 Development Guide | Home | Frameset Home |
|
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do>
</do>
</callxml>
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do>
<assign var="ParentSessionID" value="$session.ID;"/>
<assign var="NumToCall" value="4071112222"/>
</do>
</callxml>
<run value="newCall.xml">, a variable sequence to pass: submit="*", and the http method of sending that variable sequence: method="get"; however, we also have an attribute called var which stores the session.id of the NEW session: var="NewSessionID". Note that var is not the name of the new session, it is the name of the variable that holds the id of the new session. Tricky, right? Let's take a look and see:
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<do>
<assign var="ParentSessionID" value="$session.ID;"/>
<assign var="NumToCall" value="18005551234"/>
<run value="newCall.xml" submit="*" method="get" var="NewSessionID" />
</do>
</callxml>
<?xml version="1.0" encoding="UTF-8" ?>
<callxml version="3.0">
<block>
<assign var="ParentSessionID" value="$session.ID;"/>
<assign var="NumToCall" value="18005551234"/>
<run value="newCall.xml" submit="*" method="get" var="NewSessionID" />
<do label="HoldMusic"
repeat="25">
<playaudio format="audio/wav" value="Pulse.wav"/>
</do>
</block>
</callxml>
<on> event handlers. Since we have not looked at the XML file we called with our 'run' command, these events may still look unfamiliar; however, the most important "tidbit" to remember is that the value of an external event is user-defined. You can send any string or value between sessions...
<?xml version="1.0" encoding="UTF-8"?>
<callxml version="3.0">
<block>
<assign var="ParentSessionID" value="$session.ID;"/>
<assign var="NumToCall" value="18005551234"/>
<run value="newCall.xml"
submit="*"
method="get"
var="NewSessionID" />
<do label="HoldMusic"
repeat="25">
<playaudio format="audio/wav"
value="Pulse.wav"/>
<on event="externalevent:Success">
<log>*** EVENT = SUCCESS ***</log>
<conference value="$session.EventsenderID;"/>
<hangup/>
</on>
<on event="externalevent:busy">
<log>*** EVENT = BUSY ***</log>
<prompt value="Sorry, but the number is busy"/>
<exit/>
</on>
<on event="externalevent:noanswer">
<log>*** EVENT = NOANSWER ***</log>
<prompt value="It looks like no one is home"/>
<exit/>
</on>
<on event="externalevent:unreachable">
<log>*** EVENT = UNREACHABLE ***</log>
<prompt value="Your called party is unreachable"/>
<exit/>
</on>
<on event="externalevent:rejected">
<log>*** EVENT = REJECTED ***</log>
<prompt value="Looks like your call recipient rejected the call"/>
<exit/>
</on>
<on event="externalevent:unknown">
<log>*** EVENT = UNKNOWN ***</log>
<prompt value="Received an unknown call failure. Panic at will"/>
<exit/>
</on>
<on event="externalevent:TimedOut">
<log>*** EVENT = TIMED OUT ***</log>
<prompt value="Max time for the call was reached, now disconnecting."/>
<exit/>
</on>
</do>
</block>
</callxml>
<conference value="$session.EventsenderID;"/>, in the above script. This happens when our other script, (which we will see momentarily), has sent us an event named "success". We conference the two sessions together so that there is direct voice interaction, (for example, in an office hold system, where you are waiting for "the Next Available Representative"). The session.EventSenderID variable is automatically created for you -- if there is an external event you will be able to access the origin through that variable.
<?xml version="1.0" encoding="UTF-8"?>
<callxml version="3.0">
<do label="B1">
<call value="$NumToCall;"
maxtime="30s" callerID="6666666666"/>
<on event="answer">
<log> *** CALL ANSWERED IN CHILD SESSION*** </log>
<sendevent value="success"
session="$ParentSessionID;"/>
<conference value="$ParentSessionID;"/>
</on>
<on event="maxtime">
<log>*** MAXTIME CALL EVENT CAUGHT IN CHILD SESSION *** </log>
<sendevent value="timedout"
session="$ParentSessionID;"/>
</on>
<on event="callfailure:unreachable">
<log>*** UNREACHABLE EVENT CAUGHT IN CHILD SESSION ***</log>
<sendevent value="unreachable"
session="$ParentSessionID;"/>
</on>
<on event="callfailure:busy">
<log>*** BUSY EVENT CAUGHT IN CHILD SESSION ***</log>
<sendevent value="busy"
session="$ParentSessionID;"/>
</on>
<!-- note that an 'anonymous' callfailure handler will catch all call failure events -->
<!-- that do not have their own specific handler. if the developer employs this soultion, -->
<!-- note that this handler must reside below all other handlers -->
<on event="callfailure">
<log>*** RECEIVED AN ANONYMOUS CALLFAILURE EVENT ***</log>
</on>
</do>
</callxml>
<call value="$NumToCall;" maxtime="30s"/>
<call> element, <sendevent> is very straightforward: send a value to another session. Now we can see why we created a variable named 'ParentSessionID' in our first script/session.<run> element like an http method to start a new session<onexternalevent value="Success">, which will catch events spawned from the new session started by: newCall.xml| ANNOTATIONS: EXISTING POSTS |
| login |
|