| CCXML Voxeo 1.0 Development Guide | Home | Frameset Home |
|
<?xml version="1.0" encoding="UTF-8" ?>
<ccxml version="1.0">
<var name="state0" expr="'init'"/>
<eventhandler statevariable="state0">
<!-- ***************************************** -->
<!-- Inbound call is accepted. -->
<!-- ***************************************** -->
<transition state="'init'" event="connection.CONNECTION_ALERTING">
<log expr="'ACCEPTING INBOUND CALL'"/>
<accept/>
</transition>
<!-- ***************************************** -->
<!-- Begin playing the main VXML dialog. -->
<!-- ***************************************** -->
<transition state="'init'" event="connection.CONNECTION_CONNECTED" name="evt">
<log expr="'INBOUND CALL CONNECTED / STARTING MAIN VXML DIALOG'"/>
<var name="callid_in" expr="evt.callid"/>
<assign name="state0" expr="'mainVXMLDialog'"/>
<dialogstart src="'mainVXML.vxml'" name="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.answer"/>
<if cond="'1' == evt.answer">
<assign name="state0" expr="'calling'"/>
<dialogstart src="'holdmusic.vxml'" name="holdMusicDlg"/>
<createcall dest="'1112223333'"/>
<else/>
<exit/>
</if>
</transition>
<!-- ***************************************** -->
<!-- If outbound call fails. -->
<!-- ***************************************** -->
<transition state="'calling'" event="connection.CONNECTION_FAILED">
<log expr="'OUTBOUND CALL FAILED'"/>
<assign name="state0" expr="'callfailed'"/>
<dialogterminate sessionid="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.CONNECTION_CONNECTED" name="evt">
<log expr="'OUTBOUND CALL CONNECTED / STARTING WHISPER DIALOG'"/>
<var name="callid_out" expr="evt.callid"/>
<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 sessionid="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 / JOINING CALL LEGS'"/>
<assign name="state0" expr="'bridged'"/>
<join id1="callid_in" id2="callid_out"/>
</transition>
<transition event="call.CALL_INVALID" name="evt">
<if cond="callid_in == evt.callid">
<exit/>
</if>
</transition>
<transition event="error.*" name="evt">
<log expr="'AN ERROR HAS OCCURED (' + evt.error + ')'"/>
<exit/>
</transition>
</eventhandler>
</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 |
|