| CCXML 1.0-W3C Development Guide | Home | Frameset Home |
|
<join> tag, called the "voxeo-termdigits" attribute.
<?xml version="1.0" encoding="UTF-8" ?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">
<meta name="author" content="Jeff Menkel"/>
<meta name="copyright" content="2007 Voxeo Corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>
<var name="state0" expr="'init'"/>
<var name="conf"/>
<var name="callid_in"/>
<var name="callid_out"/>
<var name="termdigits"/>
<var name="holdMusicDlg"/>
<var name="termDigitDlg"/>
<eventprocessor statevariable="state0">
<!-- ***************************************** -->
<!-- Inbound call is accepted and create -->
<!-- conference named "conf". -->
<!-- ***************************************** -->
<transition state="init" event="connection.alerting">
<accept/>
<createconference conferenceid="conf"/>
</transition>
<transition state="init" event="conference.created">
<log expr="'---- conference created and its ID is [' + conf + ']'" />
</transition>
<!-- ***************************************** -->
<!-- Play hold music for Inbound call and then -->
<!-- create the Outbound call. -->
<!-- ***************************************** -->
<transition state="init" event="connection.connected">
<assign name="callid_in" expr="event$.connectionid"/>
<assign name="state0" expr="'calling'"/>
<dialogstart src="'holdmusic.vxml'" dialogid="holdMusicDlg"/>
<createcall dest="'tel:4071112233'"/>
</transition>
<transition state="calling" event="connection.failed">
<assign name="state0" expr="'callfailed'"/>
<dialogterminate dialogid="holdMusicDlg"/>
</transition>
<transition state="callfailed" event="dialog.exit">
<assign name="state0" expr="'playingCallFailed'"/>
<dialogstart src="'callfailed.vxml'"/>
</transition>
<transition state="playingCallFailed" event="dialog.exit">
<disconnect/>
</transition>
<!-- ***************************************** -->
<!-- Outbound call is answered and played a -->
<!-- small VXML dialog. -->
<!-- ***************************************** -->
<transition state="calling" event="connection.connected">
<assign name="callid_out" expr="event$.connectionid"/>
<assign name="state0" expr="'callAccepted'"/>
<dialogstart src="'newcall2.vxml'"/>
</transition>
<!-- ***************************************** -->
<!-- Join Outbound call to "conf". NOTICE: -->
<!-- We have included the ability for this -->
<!-- call leg to use the term digit to unjoin -->
<!-- the conference. -->
<!-- ***************************************** -->
<transition state="callAccepted" event="dialog.exit">
<assign name="state0" expr="'joinCallOut'"/>
<assign name="termdigits" expr="'1234'"/>
<join id1="callid_out" id2="conf" voxeo-termdigits="'#'"/>
</transition>
<!-- ***************************************** -->
<!-- Stop hold music for Inbound call. -->
<!-- ***************************************** -->
<transition state="joinCallOut" event="conference.joined">
<log expr="'---- call leg ' + event$.id2 + ' has joined the conference'" />
<log expr="'---- Ending Hold Music ----'" />
<assign name="state0" expr="'joinCallIn'"/>
<dialogterminate dialogid="holdMusicDlg"/>
</transition>
<!-- ***************************************** -->
<!-- Join Inbound call to "conf". NOTICE: We -->
<!-- do *not* allow this call leg to use term -->
<!-- digits. -->
<!-- ***************************************** -->
<transition state="joinCallIn" event="dialog.exit">
<assign name="state0" expr="'bridged'"/>
<join id1="callid_in" id2="conf"/>
</transition>
<transition state="bridged" event="conference.joined">
<log expr="'---- call leg ' + event$.id2 + ' has joined the conference'" />
</transition>
<!-- ***************************************** -->
<!-- conf is unjoined. We check to make sure -->
<!-- that the Outbound call leg did it. Then -->
<!-- start a VXML dialog for the Outbound -->
<!-- call leg and unjoin the Inbound call leg -->
<!-- from the conf. -->
<!-- ***************************************** -->
<transition state="bridged" event="conference.unjoined">
<log expr="'---- call leg ' + event$.id2 + ' has unjoined the conference'"/>
<log expr="'---- TERMDIGIT PRESSED WAS: ' + event$.termdigit + ' ----'"/>
<if cond="event$.id2 == callid_out">
<log expr="'---- callOut has hit the term digit ----'"/>
<assign name="state0" expr="'bridgeBroken'"/>
<dialogstart src="'termdigit.vxml'" dialogid="termDigitDlg"/>
<unjoin id1="callid_in" id2="conf"/>
<else/>
<destroyconference conferenceid="conf" />
<assign name="state0" expr="'conferencedestroyed'" />
</if>
</transition>
<!-- ***************************************** -->
<!-- When the Inbound call is unjoind we will -->
<!-- beging playing hold music to that leg. -->
<!-- ***************************************** -->
<transition state="bridgeBroken" event="conference.unjoined">
<log expr="'---- call leg ' + event$.id2 + ' has been unjoined from the conference'" />
<log expr="'---- callIn will now be placed on hold ----'"/>
<dialogstart src="'holdmusic.vxml'" dialogid="holdMusicDlg"/>
</transition>
<!-- ***************************************** -->
<!-- If the Outbound leg presses "1" in his -->
<!-- VXML dialog then we will kill the hold -->
<!-- music for the Inbound leg and prepair to -->
<!-- join both legs back into the conf. -->
<!-- ***************************************** -->
<transition state="bridgeBroken" event="dialog.exit">
<if cond="'1' == event$.values.answer">
<assign name="state0" expr="'prepare2rejoin'"/>
<dialogterminate dialogid="holdMusicDlg"/>
<else/>
<exit/>
</if>
</transition>
<!-- ***************************************** -->
<!-- Join both legs back into the conf and -->
<!-- Voila... Gravy... -->
<!-- ***************************************** -->
<transition state="prepare2rejoin" event="dialog.exit">
<assign name="state0" expr="'bridged'"/>
<join id1="callid_in" id2="conf"/>
<join id1="callid_out" id2="conf" voxeo-termdigits="'#'" />
</transition>
<transition event="ccxml.conference.destroyed">
<exit/>
</transition>
<transition event="connection.disconnected">
<if cond="callid_in == event$.connectionid">
<exit/>
</if>
</transition>
<transition event="conference.destroyed">
<exit/>
</transition>
<transition event="error.*">
<log expr="'an error has occured (' + event$.reason + ')'"/>
<exit/>
</transition>
</eventprocessor>
</ccxml>
<join> element, as previously mentioned. We specify that if caller 1 (only!) presses the 'dtmf-pound' key then he will be allowed to leave the conference, and get sent to a another 'hold' page, ( termdigit.vxml )where he can choose to either end the call, or rejoin the conference. Meanwhile, caller 2 is left in the conference until the call initiator takes action.| ANNOTATIONS: EXISTING POSTS |
| login |
|