Created
June 22, 2010 02:26
-
-
Save johntdyer/447837 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<ccxml xmlns="http://www.w3.org/2002/09/ccxml" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml" version="1.0"> | |
<var name="playerConnID"/> | |
<var name="confid"/> | |
<var name="state0" expr="'not_inited'"/> | |
<var name="callcount" expr="0"/> | |
<var name="outboundConnID"/> | |
<var name="phoneNumber" expr="session.values.phoneNumber"/> | |
<var name="callerID" expr="session.values.callerID"/> | |
<var name="playerName" expr="session.values.playerName"/> | |
<var name="mySessionID" expr="session.values.mySessionID"/> | |
<var name="flashPhone" expr="session.values.flashPhone"/> | |
<!-- Flash Gordon goes here --> | |
<!-- | |
sip:9991451417!sbc-external.orl.voxeo.net@sbc-internal Orlando | |
sip:9991451417!sbc-external.atl.voxeo.net@sbc-internal Atlanta | |
sip:9991451417!sbc-external.las.voxeo.net@sbc-internal Vegas | |
sip:9991451421!sbc-external.fra.voxeo.net@sbc-internal Frankfurt | |
sip:9991451418!sbc-external.lon.voxeo.net@sbc-internal London | |
DID's | |
3123730986 US ORL | |
3123730993 US ATL | |
3123730997 US LAS | |
3123801901 FRA | |
3123801911 UK | |
e9c454188d7ce04bb1092d1ccca429a366dc1aa6940a2cd3b4cd2d61da11983c272d3564aaadc9913c447d19 --> | |
<script> | |
var Hints = new Object(); | |
Hints.headers = new Object(); | |
function setCookies(phoneNumber,playerName,mySessionID){ | |
Hints.headers['x-vdirect'] = '1'; | |
Hints.headers['x-mysessionid'] = mySessionID; | |
Hints.headers['x-playerName'] = playerName; | |
Hints.headers['x-phoneNumber'] = phoneNumber; | |
return true; | |
} | |
function setCity(i){ | |
Hints.headers['x-cityName'] = i; | |
} | |
</script> | |
<!-- x-dialog-to-start --> | |
<eventprocessor statevariable="state0"> | |
<transition event="ccxml.loaded"> | |
<log expr="'@@@@[CCXML.LOADED] '"/> | |
<createcall dest="'sip:'+flashPhone" callerid="'4074181800'" connectionid="playerConnID"/> | |
<assign name="state0" expr="'welcomeDlg_start'"/> | |
<log expr="'@@@@[ ' + setCookies(phoneNumber,playerName,mySessionID) + ' ]'"/> | |
</transition> | |
<transition event="connection.connected" state="welcomeDlg_start"> | |
<!-- Kill session in 10 mins --> | |
<send name="'DIE_ZOMBIE_DIE'" target="session.id" delay="'900s'"/> | |
<log expr="'@@@@[CONNECTION.CONNECTED]'"/> | |
<log expr="'@@@@[CREATING CONFERENCE]'"/> | |
<createconference conferenceid="confid"/> | |
<assign name="playerConnID" expr="event$.connectionid"/> | |
<assign name="state0" expr="'welcomeDlg_end'"/> | |
<log expr="'@@@@[ Start Dialog ] '"/> | |
<dialogstart src="'mainGreeting.xml'" type="'application/voicexml+xml'" connectionid="playerConnID"/> | |
</transition> | |
<transition event="dialog.exit" state="welcomeDlg_end"> | |
<join id1="confid" id2="playerConnID"/> | |
<log expr="'@@@@[WELCOME DIALOG OVER] ' "/> | |
<log expr="'@@@@[START ORLANDO] '"/> | |
<send name="'user.call_orlando'" targettype="'ccxml'" target="session.id"/> | |
<assign name="state0" expr="'call_orlando'"/> | |
<!-- <assign name="state0" expr="'call_player'"/> | |
<send name="'user.call_player'" targettype="'ccxml'" target="session.id"/> | |
--> | |
</transition> | |
<transition event="conference.created"> | |
<log expr="'******* CONFERENCE HAS BEEN CREATED, SUPER!!!'"/> | |
</transition> | |
<transition event="user.call_orlando" state="call_orlando"> | |
<log expr="'@@@@[Call Orlando]'"/> | |
<assign name="state0" expr="'in_orlando'"/> | |
<script>setCity('orlando');</script> | |
<createcall dest="'sip:9991451417@romeo'" callerid="'4074181800'" hints="Hints" connectionid="outboundConnID"/> | |
</transition> | |
<!-- Orlando Connected --> | |
<transition event="connection.connected" state="in_orlando"> | |
<join id1="confid" id2="outboundConnID" entertone="'false'" exittone="'false'"/> | |
<log expr="'@@@@[Call is in Atltana]'"/> | |
</transition> | |
<!-- Handle hangup while in Orlando --> | |
<transition event="connection.disconnected" state="in_orlando"> | |
<log expr="'@@@@ The connectionid is: [' + event$.connectionid + ']'"/> | |
<if cond="event$.connectionid == outboundConnID"> | |
<assign name="state0" expr="'call_atlanta'"/> | |
<send name="'user.call_atlanta'" targettype="'ccxml'" target="session.id"/> | |
<elseif cond="event$.connectionid == playerConnID"/> | |
<log expr="'@@@@[ FLASH GORDON HUNG UP] ' "/> | |
<send name="'user.flashGordon_hangup'" targettype="'ccxml'" target="session.id"/> | |
<else/> | |
<log expr="'@@@@[DISCONNECT ELSE] ' "/> | |
</if> | |
</transition> | |
<!-- Call Atlanta --> | |
<transition event="user.call_atlanta" state="call_atlanta"> | |
<log expr="'@@@@[Call Atlanta]'"/> | |
<assign name="state0" expr="'in_atlanta'"/> | |
<script>setCity('atlanta');</script> | |
<createcall dest="'sip:9991451417@romeo'" callerid="'4074181800'" hints="Hints" connectionid="outboundConnID"/> | |
</transition> | |
<transition event="connection.connected" state="in_atlanta"> | |
<join id1="confid" id2="outboundConnID" entertone="'false'" exittone="'false'"/> | |
<log expr="'@@@@[Call is in Atltana]'"/> | |
</transition> | |
<!-- Handle hangup in Atlanta --> | |
<transition event="connection.disconnected" state="in_atlanta"> | |
<log expr="'@@@@ The connectionid is: [' + event$.connectionid + ']'"/> | |
<if cond="event$.connectionid == outboundConnID"> | |
<assign name="state0" expr="'call_london'"/> | |
<send name="'user.call_london'" targettype="'ccxml'" target="session.id"/> | |
<elseif cond="event$.connectionid == playerConnID"/> | |
<log expr="'@@@@[ FLASH GORDON HUNG UP] ' "/> | |
<send name="'user.flashGordon_hangup'" targettype="'ccxml'" target="session.id"/> | |
<else/> | |
<log expr="'@@@@[DISCONNECT ELSE] ' "/> | |
</if> | |
</transition> | |
<!-- Call London --> | |
<transition event="user.call_london" state="call_london"> | |
<log expr="'@@@@[Call London]'"/> | |
<assign name="state0" expr="'in_london'"/> | |
<script>setCity('london');</script> | |
<createcall dest="'sip:9991451417@romeo'" callerid="'4074181800'" hints="Hints" connectionid="outboundConnID"/> | |
</transition> | |
<transition event="connection.connected" state="in_london"> | |
<join id1="confid" id2="outboundConnID" entertone="'false'" exittone="'false'"/> | |
<log expr="'@@@@[Call is in London]'"/> | |
</transition> | |
<!-- Handle hangup while in London --> | |
<transition event="connection.disconnected" state="in_london"> | |
<log expr="'@@@@ The connectionid is: [' + event$.connectionid + ']'"/> | |
<if cond="event$.connectionid == outboundConnID"> | |
<assign name="state0" expr="'call_frankfurt'"/> | |
<send name="'user.call_frankfurt'" targettype="'ccxml'" target="session.id"/> | |
<elseif cond="event$.connectionid == playerConnID"/> | |
<log expr="'@@@@[ FLASH GORDON HUNG UP] ' "/> | |
<send name="'user.flashGordon_hangup'" targettype="'ccxml'" target="session.id"/> | |
<else/> | |
<log expr="'@@@@[DISCONNECT ELSE] ' "/> | |
</if> | |
</transition> | |
<!-- Call Frankfurt --> | |
<transition event="user.call_frankfurt" state="call_frankfurt"> | |
<log expr="'@@@@[Call Frankfurt]'"/> | |
<assign name="state0" expr="'in_frankfurt'"/> | |
<script>setCity('frankfurt');</script> | |
<createcall dest="'sip:9991451417@romeo'" callerid="'4074181800'" hints="Hints" connectionid="outboundConnID"/> | |
</transition> | |
<transition event="connection.connected" state="in_frankfurt"> | |
<join id1="confid" id2="outboundConnID" entertone="'false'" exittone="'false'"/> | |
<log expr="'@@@@[Call is in Frankfurt]'"/> | |
</transition> | |
<!-- Handle hangup while in Frankfurt --> | |
<transition event="connection.disconnected" state="in_frankfurt"> | |
<log expr="'@@@@ The connectionid is: [' + event$.connectionid + ']'"/> | |
<if cond="event$.connectionid == outboundConnID"> | |
<assign name="state0" expr="'call_beijing'"/> | |
<send name="'user.call_beijing'" targettype="'ccxml'" target="session.id"/> | |
<elseif cond="event$.connectionid == playerConnID"/> | |
<log expr="'@@@@[ FLASH GORDON HUNG UP] ' "/> | |
<send name="'user.flashGordon_hangup'" targettype="'ccxml'" target="session.id"/> | |
<else/> | |
<log expr="'@@@@[DISCONNECT ELSE] ' "/> | |
</if> | |
</transition> | |
<!-- Call Beijing --> | |
<transition event="user.call_beijing" state="call_beijing"> | |
<log expr="'@@@@[Call beijing]'"/> | |
<assign name="state0" expr="'in_beijing'"/> | |
<script>setCity('beijing');</script> | |
<createcall dest="'sip:9991451417@romeo'" callerid="'4074181800'" hints="Hints" connectionid="outboundConnID"/> | |
</transition> | |
<transition event="connection.connected" state="in_beijing"> | |
<join id1="confid" id2="outboundConnID" entertone="'false'" exittone="'false'"/> | |
<log expr="'@@@@[Call is in beijing]'"/> | |
</transition> | |
<!-- Bridge the caller into game --> | |
<transition event="connection.disconnected" state="in_beijing"> | |
<log expr="'@@@@ The connectionid is: [' + event$.connectionid + ']'"/> | |
<if cond="event$.connectionid == outboundConnID"> | |
<assign name="state0" expr="'call_vegas'"/> | |
<send name="'user.call_vegas'" targettype="'ccxml'" target="session.id"/> | |
<elseif cond="event$.connectionid == playerConnID"/> | |
<log expr="'@@@@[ FLASH GORDON HUNG UP] ' "/> | |
<send name="'user.flashGordon_hangup'" targettype="'ccxml'" target="session.id"/> | |
<else/> | |
<log expr="'@@@@[DISCONNECT ELSE] ' "/> | |
</if> | |
</transition> | |
<transition event="user.call_vegas" state="call_vegas"> | |
<log expr="'@@@@[Calling Vegas]'"/> | |
<assign name="state0" expr="'in_vegas'"/> | |
<!-- Call Vegas --> | |
<script>setCity('vegas');</script> | |
<createcall dest="'sip:9991451417@romeo'" callerid="'4074181800'" hints="Hints" connectionid="outboundConnID"/> | |
</transition> | |
<transition event="connection.connected" state="in_vegas"> | |
<join id1="confid" id2="outboundConnID" entertone="'false'" exittone="'false'"/> | |
<log expr="'@@@@[Call is in Vegas]'"/> | |
</transition> | |
<!-- Handle hangup while in Vegas --> | |
<transition event="connection.disconnected" state="in_vegas"> | |
<log expr="'@@@@ The connectionid is: [' + event$.connectionid + ']'"/> | |
<if cond="event$.connectionid == outboundConnID"> | |
<assign name="state0" expr="'call_player'"/> | |
<var name="location" expr="'hardrock'"/> | |
<var name="action" expr="'update'"/> | |
<send name="'http.get'" target="'http://demos.voxeo.com/roundTheWorld/api/api.php'" namelist="mySessionID location playerName phoneNumber action" targettype="'basichttp'"/> | |
<elseif cond="event$.connectionid == playerConnID"/> | |
<log expr="'@@@@[ FLASH GORDON HUNG UP] ' "/> | |
<send name="'user.flashGordon_hangup'" targettype="'ccxml'" target="session.id"/> | |
<else/> | |
<log expr="'@@@@[DISCONNECT ELSE] ' "/> | |
</if> | |
</transition> | |
<transition event="send.successfull" state="call_player"> | |
<log expr="'@@@@[API CALL FOR FINAL LEG SUCCESFULL] ' "/> | |
<destroyconference conferenceid="confid"/> | |
<send name="'user.call_player'" targettype="'ccxml'" delay="'550ms'" target="session.id"/> | |
</transition> | |
<transition event="user.call_player" state="call_player"> | |
<log expr="'@@@@[Final Prompt]'"/> | |
<dialogstart src="'promptForCaller.xml'" type="'application/voicexml+xml'"/> | |
</transition> | |
<transition event="dialog.exit" state="call_player"> | |
<log expr="'@@@@[Prompt Played to Caller'"/> | |
<send name="'user.player_hangup'" targettype="'ccxml'" target="session.id"/> | |
</transition> | |
<transition event="connection.disconnected" state="call_player"> | |
<if cond="event$.connectionid == outboundConnID"> | |
<log expr="'@@@@[ OUTBOUND CALL HUNG UP] ' "/> | |
<log expr="'@@@@[ SEND EVENT user.player_hungup]'"/> | |
<send name="'user.player_hangup'" targettype="'ccxml'" target="session.id"/> | |
<elseif cond="event$.connectionid == playerConnID"/> | |
<log expr="'@@@@[ FLASH GORDON HUNG UP] ' "/> | |
<send name="'user.flashGordon_hangup'" targettype="'ccxml'" target="session.id"/> | |
<else/> | |
<log expr="'@@@@[DISCONNECT ELSE] ' "/> | |
</if> | |
</transition> | |
<transition event="user.flashGordon_hangup"> | |
<log expr="'@@@@[ dont hate the player, hate the game]'"/> | |
<log expr="'@@@@[ Player has hungup]'"/> | |
<exit/> | |
</transition> | |
<transition event="user.player_hangup"> | |
<log expr="'@@@@[ dont hate the player, hate the game]'"/> | |
<log expr="'@@@@[ Player has hungup]'"/> | |
<exit/> | |
</transition> | |
<transition event="error.*"> | |
<log expr="'*** ERROR DETECTED: '+ event$.name"/> | |
<exit/> | |
</transition> | |
<transition event="DIE_ZOMBIE_DIE"> | |
<log expr="'@@@@[ZOMBIE DEATH] ' "/> | |
<exit/> | |
</transition> | |
</eventprocessor> | |
</ccxml> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment