Custom VBScript Code - CeBIT 2003 Parties (kb2336)
The information in this article applies to:
- SwyxWare from version 4
Swyx and www.messeparties.de present all stand parties on the CeBit 2003 fare in Hannover. By calling the number
- 0700 CALLSWYX (0700 22557999)
one will be able to request all parties via telephone. For this we use a Call Routing Script with some additional VBScript code.
This article explains how this script works and provides it as an example for similar scripts for download.
This is how the call will be handled
- Call will reach the SwyxWare
- A notification EMail will be sent
The main menu announcement will be played
- 1 will play the party infos
- 2 will record and set a voicemail
A short description of the navigation will be played
- 1 previous party
- 3 next party
- 4 previous day
- 6 next day
- 0 back to main menu
- A Voicemail will be recorded
- It goes back to the main menu
Installation of the Script
- Unzip the ZIP file including its subdirectories.
Copy all files within the Voicemail directory into users Voicemail directory, e.g.
Copy the directory Ansagen to any location on your harddrive, e.g.
Open the Call Routing Manager of the desired user and create a new GSE rule.
Import the file CeBit 2003 Standparties.rse into the GSE using the menu File | Import...
Open the properties of the Start Rule. On the second page Parameters you will find the custom VBScript code. Here you'll have to modify the first statement:
const base_directory = "d:\temp4\"according to the folder you have copied the Ansagen directory to. To stay with this example:
const base_directory = "d:\Ansagen\"Please note the trailing \ (backslash) !
- Save the script.
How the Script works
Most interesting is of course the part with the party announcements and the navigation. The rest is a simple GSE script.
For each day of the fare there is a folder with the name of the day as name:
+- Ansagen +- 12 +- 13 ...
In these directories are the WAV files containing the party announcements for each day located. To ensure that they will be played in the correct order the file names will start with the starting time of a party:
When the script starts the function GetAllMessages() will be called which will read all filenames from all directories and stores them in an array. All further navigation will just move the pointer(s) to the current array cell. The pointers are the two variables cur_day and cur_message.
After playing the Party Intro the Evaluate Block Play Party Message will be called which will call the function PlayCurrentMessage() within the custom script code.
The function will read the filename of the current party announcement from the array and plays it using the function gsePlaySound(). This function is able to detect DTMF characters while playing a WAV file and stores them into a variable. It is possible to define a mask of valid DTMF characters.
In this case the mask is 01346, a detected DTMF character will stop the playback and will be returned within the variable key_pressed.
According to the return value the following will happen:
- Announcement was played completely without a DTMF character was detected: the function IncMessage() will be called to set the current message to the next one.
Announcement was interrupted by a DTMF character:
1: the function DecMessage() will be called to set the current message to the previous one
3: the function IncMessage() will be called to set the current message to the next one
4: the function DecDay() will be called to set the current day to the previous one
6: the function IncDay() will be called to set the current day to the next one
The function PlayCurrentMessage() returns then the detected DTMF character and the script will call the Play Nex Message ? block.
If the DTMF code is 0 the script will be directed to the main menu, otherwise the function PlayCurrentMessage() will be called again to play the new current message.
There are some more functions to mention
which will set the "pointers" cur_day and cur_message. If the current message is the first or the last of a day the pointer will be directed to the previous or next day. The same is true for the day list.
Please note that the announcements within the ZIP file are not the ones being used during the CeBit 2003 fare, but instead are just some test announcements. You will listen to the voice of the author of this article ;-)
- CeBit 2003 Parties - Call Routing Script
The third-party contact information included in this article is provided to help you find the technical support you need. This contact information is subject to change without notice. Swyx in no way guarantees the accuracy of this third-party contact information nor is responsible for it's content.