HOWTO

Speaking clock (kb2249)

The information in this article applies to:

  • Graphical Script Editor v4.00
  • SwyxWare v4.00

[ Summary | Information | Links ]


Summary

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

 

 


Information

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.

    Graphilcal Script Editor
    Graphilcal Script Editor
    Click to enlarge...

  • Save the rule via the menu File | Save.
  • Close the GSE.
  • Activate the rule by moving it to the right list of CRM.

    Call Routing Manager
    Call Routing Manager
    Click to enlarge...

 

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.

Properties - Start rule
Properties - Start rule
Click to enlarge...

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.

Notes

 

  • 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 Next Place 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
    db.Open sDsn
    If Err <> 0 then
      'do something, e.g.:
      FunctionName = False
      Exit Function
    End If


Links

As far as software supplied or used by us, includes open source elements the additional terms under https://www.swyx.com/open-source apply in addition. An overview which products from the Swyx portfolio include open source elements and which open source license is relevant can be found under https://www.swyx.com/open-source.

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.


Comment

Comment on this article



If we have any follow-up questions, where can we contact you?

E-Mail Address (optional)


Note

This feedback form can't be used for support requests. Those requests must be directed to your Swyx reseller or distributor.