| CCXML 1.0-W3C Development Guide | Home | Frameset Home |
|
<join> element.
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0">
<var name="admin" expr="'no'"/>
<var name="callid" expr="session.connection.originator.uri"/>
<form>
<block>
<log expr="'*** CALLID = ' + callid"/>
</block>
<field name="verify" type="digits?length=3">
<prompt>
<break/>
Enter your conference ID now.
</prompt>
<filled>
<log expr="'*** session.callerid =' + session.connection.originator.uri"/>
<!--*** SOME SIP CONNECTION ID THAT MATCHES THE ADMINISTRAOTORS CALLER ID *** -->
<if cond="callid == '4072223333@127.0.0.1'">
<assign name="admin" expr="'yes'"/>
<log expr="'*** CALLERID INDICATES THAT THE ADMIN HAS DIALED IN ***'"/>
<else/>
<assign name="admin" expr="'no'"/>
<log expr="'*** CALLERID INDICATES THAT A NON ADMIN HAS DIALED IN ***'"/>
</if>
<exit namelist="verify admin"/>
</filled>
</field>
</form>
</vxml>
<exit namelist> element/attribute. So, when the CCXML 1.0 layer figures out that there is an Admin coming in, it will create a half duplex connection, and sit in a holding pattern until we have more people to join the conference. When we have a 'ham and egger', (non-admin), join the conference, then the CCXML layer will programatically create a full duplex connection, allowing all the non-admins to chat.
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">
<meta name="author" content="Jeff Menkel"/>
<meta name="copyright" content="2007 Voxeo Corporation"/>
<meta name="description" content="Duplex Conferencing Tutorial"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>
<var name="state0" expr="'init'"/>
<var name="smallConf"/>
<var name="line_0"/>
<var name="duplex"/>
<!--
Initially, the admin variable is 'no'. You can reset it to 'yes' based on
any criteria you like (database info, callerID, etc.. In this example, we use
callerID
-->
<var name="admin" expr="'no'"/>
<!--
Tracking number of particpants so we do not leave zombie conferences
this variable should reference a session variable or database query
on the developer side.
-->
<var name="participants" expr="0"/>
<!--
Track joinstatus of each caller so we do not decrement participants on unjoin
and hang up
-->
<var name="joinstatus"/>
<eventprocessor statevariable="state0">
<!-- incoming call -->
<transition state="init" event="connection.alerting">
<assign name="line_0" expr="event$.connectionid" />
<accept/>
</transition>
<!-- incoming call connected -->
<transition state="init" event="connection.connected">
<log expr="'---- Master call answered...'"/>
<!-- newly connected call must log in -->
<log expr="'---- starting the login vxml ...'"/>
<assign name="state0" expr="'login'" />
<dialogstart src="'ccxml_vxml.xml'" dialogid="loginscr" type="'application/voicexml+xml'"/>
</transition>
<!--
Caller enters an arbitrary code (which is the conferenceID.
If another caller enters the same code, they'll join that same conference.
We advise protecting conferences with more authentication;
this is just an example.
-->
<transition state="login" event="dialog.exit">
<log expr="'---- Ended vxml login...'"/>
<log expr="'---- About to create conference...'"/>
<assign name="state0" expr="'conference'" />
<!--
In the vxml dialog, based on the ANI, we assign a variable 'admin'.
Below, if the admin = 'yes' we assign a CCXML variable admin = 'yes'
-->
<log expr="'*** event$.values.admin =' + event$.values.admin"/>
<if cond="event$.values.admin == 'yes'">
<assign name="admin" expr="'yes'" />
<log expr="'*** ADMIN = TRUE ***'"/>
<else/>
<assign name="admin" expr="'no'" />
<log expr="'*** ADMIN = FALSE ***'"/>
</if>
<createconference conferenceid="smallConf"/>
</transition>
<transition event="conference.created">
<log expr="'---- conference created and its ID is [' + smallConf + ']'" />
<!--
Here if our CCXML variable admin == 'yes' then that caller joins the
conference in listen-only mode
-->
<if cond="admin == 'yes'">
<assign name="duplex" expr="'half'"/>
<!-- Assigning duplex variable to Half -->
<log expr="'**** DUPLEX IS: ' + duplex"/>
<join id1="line_0" id2="smallConf" duplex="duplex"/>
<else/>
<assign name="duplex" expr="'full'"/>
<!-- Assigning duplex variable to Full -->
<log expr="'**** DUPLEX IS: ' + duplex"/>
<join id1="line_0" id2="smallConf" duplex="duplex"/>
</if>
</transition>
<transition event="conference.joined">
<!--
Here we'll increment the number of conference participants
again... participants references a session variable or something
visible to all clients
-->
<assign name="participants" expr="participants+1" />
<assign name="joinstatus" expr="'joined'" />
<log expr="'---- call leg ' + event$.connectionid + ' has joined the conference'" />
</transition>
<transition event="conference.unjoined">
<!--
Here we'll decrement the number of conference participants
again... participants references a session variable or something
visible to all clients
-->
<assign name="participants" expr="participants-1" />
<assign name="joinstatus" expr="'unjoined'" />
<log expr="'---- call leg ' + event$.connectionid + ' has unjoined the conference'" />
</transition>
<transition event="connection.disconnected">
<if cond="joinstatus == 'joined'">
<assign name="participants" expr="participants-1" />
</if>
<!--
When you are tracking # of participants with a session variable, you will
want to re-include this so you do not leave zombie conferences.
-->
<if cond="participants == 0">
<destroyconference conferenceid="smallConf" />
<assign name="state0" expr="'conferencedestroyed'" />
<else/>
<exit/>
</if>
</transition>
<transition event="conference.destroyed">
<exit/>
</transition>
<transition event="error.*">
<log expr="'an error has occurred (' + event$.reason + ')'"/>
<exit/>
</transition>
</eventprocessor>
</ccxml>
| ANNOTATIONS: EXISTING POSTS |
| login |
|