// ---------------------------------------------------------------
// copyright 2000 by voxeo corporation  (see LGPL.txt)
// ---------------------------------------------------------------
//
// BROADCASTER
//
// v1.1 coded in ColdFusion and CallXML
// v1.1 coded by Kathryn Sharron
//
// Broadcaster is a simple, telephone/web based application 
// that allows registered users to "broadcast" a message 
// via phone to a pre-selected group of recipients. 
//
//
// ---------------------------------------------------------------
//
// Contents:
//
//	1. Introduction
//	2. Installation and setup instructions
//	3. List of files
//	4. Server
//	5. Database
//	6. Application flow
//
//
// ---------------------------------------------------------------
//
// Quick Start Instructions:
//
// 1. Unzip the Broadcaster.zip package onto your server.
//
// 2. Connect the database file as an ODBC data source.
//
//   a. Using a web browser, start the ColdFusion Administrator
//	with http://(Server)/Cfide/Administrator/index.htm. Enter 
//	the password on the form and click the "Password" button.
//
//   b. On the left, under "data sources," click the "ODBC" link.
//
//   c. If "Broadcaster" is in the "Data Source Name" list, stop, 
//	it is already connected.
//
//   d. Otherwise, press the "Add..." button under "ODBC Driver."
//
//   e. Fill in the "Create ODBC Data Source" form.
//
//	   Data Source Name = Broadcaster
//
//	   Database File: Click the "Browse Server.." button to 
//	   find the broadcaster.mdb file, or your version of the 
//	   database.
//
//	   Leave everything else in the form as it is when 
//	   it comes up.
//
//  	Press the "Create" button to create the data source.
//
//   f. "Broadcaster" should now appear in the "Data Source 
//	Name" list. You can click the "Verify" link on the right 
//	side of the "Broadcaster" line. 
//
// 3. Enter the FTP information.
//    
//   a. If you don't already have an FTP server set up, do so now. 
//
//   b. In the FTP table of the database, insert 
//
//	   ftp://username:password@your.path.here/tofolder
// 
//      into the 'FTPpath' column and 
// 
//	   http://your.path.here/tofolder
// 
//      into the 'Msgpath' column. There are two more columns,
//      Username and Password. You have the option to add that 
//      info in as well. Username and Password are included in 
//	the database for reference only.
//
// 4. Point a community.voxeo.com phone number to the voice 
//    application.
//
//   a. Point your browser to the voxeo community page:
//	http://community.voxeo.com/. Click on the "account login" 
//	button. 
//
//   b. Click the "log in here" link. (Or create an account if 
//	you do not already have one by clicking the "you can 
//	get one here" link.)
//
//   c. On the "account administration" page, click the "phone 
//	number administration and url mapping" link.
//
//   d. Fill in the url mapping form:
//
//	   select a city near you
//
//	   platform: leave it on the "CallXML" default
//
//	   url: point to the calllogin.cfm file
//
//	Click the "Add Mapping" button.
//
//   e. A new number should appear with the URL. Test the URL link 
//	by clicking it. You should see a XML file that starts with 
//	the following line:
//
//	<?xml version="1.0" encoding="UTF-8" ?> 
//
//
// ---------------------------------------------------------------
//
// The entire suite contains 37 files:
//
//   Readme.txt	  
//   LGPL.txt	  	The open source license agreement.
//
//   broadcaster.mdb	A sample database in MS Access.   
//
//
// PHONE APPLICATION: (9 files)
//
//   calllogin.cfm	A series of scripts that log in the user 
//   callpin.cfm	(or allow them to create a new account) 
//   callmenu.cfm	and direct them to a menu of options. 
//			From there, the scripts add recipients 
//   callrps.cfm	to the user's list, record their message, 
//   callact.cfm	and broadcast it to their recipients, 
//			while keeping track of who received the 
//   callrecord.cfm	message and who didn't.
//   callprocess.cfm
//   callsend.xml
//   callupdate.cfm
//
//
// WEB APPLICATION: (9 files)
//
//   weblogin.cfm	The website allows users to create 
//   userinfo.cfm	accounts, designate recipients, and edit 
//   choosepin.cfm	the information they have entered. The 
//   recipinfo.cfm	website extends the phone application,
//   recipaction.cfm	adding more options for information in  
//			the user's account and in the list of 
//	recipients, and  permitting a user to look up their PIN 
//	if they've forgotten it.
//
//   broadcaster.css	A stylesheet for the web pages. 
//
//   background_curve.gif	
//   logo.gif		Images for the web pages.
//   top_slogan.gif
//	
//
// AUDIO: (16 files)
//
// All files are PCM format, 8-bit, mono, unsigned. 
//
//   greeting.wav	"Welcome to Broadcaster! Please enter your 
//	personal identification number and then press the pound 
//	key. If you are new to Broadcaster, please press the star 
//	key."	
//
//   pin.wav		"Please enter a four-digit personal 
//	identification number and then press the pound key."
//
//   sorry.wav		"I'm sorry, that personal identification 
//	number has already been assigned. Please try again."
//
//   newpin.wav		"Your new Broadcaster personal 
//	identification number is: "
//
//   hello.wav		"Hello"
//
//   mainmenu.wav	"Press one to enter a new recipient, or 
//	press two to record and send a new message."
//
//   count.wav		"The number of recipients you currently 
//	send messages to is: "
//
//   number.wav		"Please enter a new phone number, followed 
//	by the pound key."
//
//   newmenu.wav	"The number you entered has been added. 
//	Press one if you would like to enter another number, press 
//	two to record and send a message, or press three to exit 
//	Broadcaster."
//
//   notphone.wav	"That is not a valid phone number."
//
//   oldphone.wav	"That number has already been entered."
//
//   error.wav		"I'm sorry, Broadcaster has encountered 
//	an error. Please try again."
//
//   record.wav		"After the beep, please record your 
//	message and then press the pound key."
//
//   message.wav	"You have a message from: "
//
//   invalid.wav	"That is not a valid personal 
//	identification number."
//
//   thankyou.wav	"Thank you."
//
// Also, expect to additionally have as many audio files as you 
// have users -- their recorded messages are saved via FTP as 
//
//	"msg[UserID].wav"
//
// 
// ---------------------------------------------------------------
//
// Server requirements:	ColdFusion 4.5
// 
// Modifications to the application can be done with any text 
// editor, however, development is simplified by using ColdFusion 
// Studio 4.5 from allaire. Instructions on installing and 
// configuring ColdFusion products can be obtained from allaire at
// http://www.allaire.com/developer/index.cfm
//
// ---------------------------------------------------------------
//
// The database is an ODBC resource called Broadcaster,
//
//	Data Source Name:	Broadcaster
//	Database File:		broadcaster.mdb (or .whatever)
//
// which contains three tables:
//
//   Users, with columns called: 
//	UserID, FirstName, LastName, Email, Phone, PIN
//
//   Recipients, with columns called: 
//	UniqueID, UserID, Name, Phone, Answer
//
//   FTP, with columns called: 
//  	Username, Password, FTPpath, Msgpath
//
//
// ---------------------------------------------------------------
// 
// Phone Application Call Flow:
//
// 1.  calllogin.cfm
// 1a. callpin.cfm  (New users are directed here.)
// 2.  callmenu.cfm
//
// -To add a recipient-		-To record and send a message-
//
// 3.  callrps.cfm		3.  callrecord.cfm  (Uses FTP.)
// 4.  callact.cfm		4.  callprocess.cfm
//				5.  callsend.cfm
//				5a. callupdate.cfm  (If the call 
//				went through successfully. This 
//				page only updates the database; 
//				it doesn't interact with the 
//				caller.)
// Web Application Flow:
//
// 1.  weblogin.cfm
// 1a. choosepin.cfm  (New users are directed here.)
// 2.  userinfo.cfm
// 3.  recipinfo.cfm
// 4.  recipaction.cfm
//
//
// ---------------------------------------------------------------