| 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 |
lavanyasubbu
|
|
| on the newcall xml, i changed from
<call value="$NumToCall;" maxtime="30s" callerID="6666666666"/> TO <call value="$NumToCall;" maxtime="30s" callerID="$NumToCall"/> Its not working. Looks like the second call isn't made. If i manully change it to a number it works. Can a variable not be used twice? PS: As I was learning this, I wanted a friend's phone to ring with the same number/caller id as his phone (to freak-him-out) |
|
voxeoJeffK
|
|
| Hello,
It looks like you are missing a ";" after the variable: callerID="$NumToCall" Note though that many carriers will not route a call where the callerID is the same as the destination. Regards, Jeff Kustermann Voxeo Support |
|
lavanyasubbu
|
|
| Jeff,
Sorry. I had the ";" and may have unknowingly removed it. Your explanation makes sence and that could be the reason |
|
VoxeoDante
|
|
| Hello,
You should also keep in mind that if you send a call to a phone with the callerID set to the the same as the number you are calling, you will send the call directly to voicemail and the user will never actually have the chance to answer. Regards, Dante Vitulano |
|
qasimzee
|
|
| priveleges should be privileges on the first line | |
voxeoJeffK
|
|
| Hello,
Excellent, thank you. I've edited the documentation root, and this change will be in effect upon the next documentation build. Regards, Jeff Kustermann Voxeo Support |
| login |
|