Introduction to CCXML, Part V
The getConference subroutine in the Perl script contains CCXML content which answers the call and plays the get_conference_code.vxml VoiceXML dialog. This dialog prompts the caller for their conference number, which is then returned to the CCXML program and assigned to the conference_code variable. The value of this variable is appended to the URL of the next attribute of the goto element for the dialog.exit event handler:
In effect, this executes the Perl script a second time, passing in the conference_code variable.
One of the first things this subroutine does is in fact create the conference token file in the $conferenceDirectory directory.
Next, the name of the conference is set within the <createconference> element by combining the string conference_ with the unique conference number:
<createconference name="conference_$conferenceCode" />
Once the conference has been successfully created, the caller will hear a prompt indicating that they are the first caller in the conference:
<dialogstart callid="in_callerid" src="'/voicexmlplanet/34/first_caller.vxml'"/>
The joinConference subroutine is executed after the caller has provided their conference number and the main body of the script detects that the token file for the conference number exists, meaning that the conference call has already been initiated:
<join sessionid1="in_callerid" sessionid2="conference_$conferenceCode" />
The session1 and session2 attributes of the <join> element specify the two call legs to join, the first one being the id of the caller joining the conference call, and the second one being the unique conference call id.
Once the <join> is successful, a prompt indicating that the caller has joined the conference call is played:
Things that should be added to this script in the future are better error handling routines that would end the conference call gracefully. Another drawback of the script is that you can never re-use the conference numbers (unless you delete the token files). Nonetheless, you can use this script as a template to develop more complex conferencing solutions. If you study the script, you will also get a better idea of the conferencing concept where the first caller creates the conference and subsequent callers join the conference. Joining callers to the conference involves patching the caller's unique caller id into the unique conference id.
About Jonathan Eisenzopf
Jonathan is a member of the Ferrum Group, LLC which specializes in Voice Web consulting and training. Feel free to send an email to email@example.com regarding questions or comments about this or any article.
Page 2 of 2