Speaking clock (kb2249)
The information in this article applies to:
- Graphical Script Editor v4.00
- SwyxWare v4.00
From SwyxWare v4.00 it is possible to add own custom script code to the Graphical Script Editor (GSE). This article describes how to setup a speaking clock.
More informations about the new features of the Graphical Script Editor can be found in the arctile:
For example: the Swyx speaking clock can be reached via +49 (231) 4777-200.
Further informations on custom script code in the GSE can be found in the article series
- Custom VBScript Code - Call logging into textfile (kb2217)
- Custom VBScript Code - Call logging into database (kb2218)
- Custom VBScript Code - Caller verification in database (kb2219)
Installation of the rule for the speaking clock
Download the example rule for the speaking clock from this article an copy the file RuleTimeAnnoucement.rse into a temporary folder. The announcments (*.WAV files) need to be copied into the voicemail folder of the wanted user (e.g. ..\SwyxWare\User\SPEAKINGCLOCK\PhoneClient\Voicemail). To load the file RuleTimeAnnoucement.rse into the Call Routing Manager (CRM) i.e. the Graphical Script Editor (GSE) please follow these steps:
- Start Call Routing Manager.
- Click on New...
- Select Graphical Script Editor and click on Ok.
- Open the menu File | Import... in GSE.
- Select the file RuleTimeAnnoucement.rse from the temporary folder. The rule will now be imported.
- Save the rule via the menu File | Save.
- Close the GSE.
- Activate the rule by moving it to the right list of CRM.
How the script works
Own script code can be placed into the Start rule block. All constants, variables and function you define here are available in all other block within the entire script, e.g. the Evaluate block.
The custom code of this script looks like
Function NextTimeStamp() Dim s1, m1, h1 s1 = (CurSecond() \ 10) * 10 + 10 m1 = CurMinute() h1 = CurHour() if s1 = 60 then s1 = 0 m1 = m1 + 1 end if if m1 = 60 then m1 = 0 h1 = h1 + 1 end if if h1 = 24 then h1 = 0 end if NextTimeStamp = h1 & ":" & m1 & ":" & s1 End Function
This function gets the current time an increments it to the next full 10 seconds. This time will be announced. Afterwards the script waits until this time is reached and plays a beep. The script will be looped in this way.
All callrouting scripts, and therefore also your code, runs under the SwyxWare Service Account. Please make sure that this account has the needed priviliges to access the file/database.
The script in this example does contain no Error Handling. If an error occurs at runtime, e.g. when trying to access a database, this error will not be handled, the script will stop and the call get lost. If you have enabled Server Tracing for SvrScript on level Info3 you will find the original Microsoft Script Engine error message within the server trace file.
To get your own error handling you have to disable the standard error handling by the Script Engine:
On Error Resume NextPlace this line of code at the beginning of your function. Now you have to check for error at every potential place and do your own error handling:
' Open connection to Database
If Err <> 0 then
'do something, e.g.:
FunctionName = False
- Speaking Clock GSE 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.