| CCXML 1.0-W3C Development Guide | Home | Frameset Home |
|
<?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="2005 Voxeo Corporation"/>
<meta name="description" content="Conferencing with Whisper Tutorial"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>
<var name="state0" expr="'init'"/>
<var name="callid_in"/>
<var name="callid_out"/>
<var name="holdMusicDlg"/>
<var name="mainVXMLDlg"/>
<eventprocessor statevariable="state0">
<!-- ***************************************** -->
<!-- Inbound call is accepted. -->
<!-- ***************************************** -->
<transition state="init" event="connection.alerting">
<log expr="'ACCEPTING INBOUND CALL'"/>
<accept/>
</transition>
<!-- ***************************************** -->
<!-- Begin playing the main VXML dialog. -->
<!-- ***************************************** -->
<transition state="init" event="connection.connected" name="evt">
<log expr="'INBOUND CALL CONNECTED / STARTING MAIN VXML DIALOG'"/>
<assign name="callid_in" expr="evt.connectionid"/>
<assign name="state0" expr="'mainVXMLDialog'"/>
<dialogstart src="'mainVXML.vxml'" dialogid="mainVXMLDlg"/>
</transition>
<!-- ***************************************** -->
<!-- If the caller chooses to make the -->
<!-- Outbound call then play hold music for -->
<!-- Inbound call and then create the Outbound -->
<!-- call. -->
<!-- ***************************************** -->
<transition state="mainVXMLDialog" event="dialog.exit" name="evt">
<log expr="'FINISHED MAIN VXML DIALOG / CALLERS ANSWER IS: ' + evt.values.answer"/>
<if cond="'1' == evt.values.answer">
<assign name="state0" expr="'calling'"/>
<dialogstart src="'holdmusic.vxml'" dialogid="holdMusicDlg" connectionid="callid_in"/>
<createcall dest="'tel:4075551212'"/>
<else/>
<exit/>
</if>
</transition>
<!-- ***************************************** -->
<!-- If outbound call fails. -->
<!-- ***************************************** -->
<transition state="calling" event="connection.failed">
<log expr="'OUTBOUND CALL 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">
<log expr="'DISCONNECTING INBOUND CALL'"/>
<disconnect/>
</transition>
<!-- ***************************************** -->
<!-- Outbound call is answered and played a -->
<!-- "whisper" VXML dialog. -->
<!-- ***************************************** -->
<transition state="calling" event="connection.connected" name="evt">
<log expr="'OUTBOUND CALL CONNECTED / STARTING WHISPER DIALOG'"/>
<assign name="callid_out" expr="evt.connectionid"/>
<assign name="state0" expr="'callAccepted'"/>
<dialogstart src="'whisper.vxml'"/>
</transition>
<!-- ***************************************** -->
<!-- When "whisper" dialog is finished stop -->
<!-- hold music for Inbound call. -->
<!-- ***************************************** -->
<transition state="callAccepted" event="dialog.exit" name="evt">
<log expr="'WHISPER DIALOG ENDED / KILLING HOLD MUSIC ----'" />
<assign name="state0" expr="'endHoldMusic'"/>
<dialogterminate dialogid="holdMusicDlg"/>
</transition>
<!-- ***************************************** -->
<!-- When hold music dialog is finished join -->
<!-- Outbound and Inbound call legs. -->
<!-- ***************************************** -->
<transition state="endHoldMusic" event="dialog.exit">
<log expr="'HOLD MUSIC ENDED'"/>
<assign name="state0" expr="'bridged'"/>
<send name="'bridgeCall'" target="session.id" delay="'4s'"/>
</transition>
<transition event="bridgeCall" state="bridged">
<join id1="callid_in" id2="callid_out" duplex="'full'"/>
<log expr="'JOIN CALLS LEGS'"/>
</transition>
<transition event="connection.disconnected" name="evt">
<if cond="callid_in == evt.connectionid">
<exit/>
</if>
</transition>
<transition event="error.*" name="evt">
<log expr="'AN ERROR HAS OCCURED (' + evt.reason + ')'"/>
<exit/>
</transition>
</eventprocessor>
</ccxml>
<join> element.<transitionevent="error.*"> followed by an immediate <exit>, so as to prevent an endless looping of our application. We are also going to add a dialog to play to the initial caller if the second party cannot be reached, or an error occurs that results in a call failure, (callfailed.vxml).| ANNOTATIONS: EXISTING POSTS |
| login |
|