Jump to content


Our community blogs

  1. VBScript → Lua


    Please note: there is also a version for Lua based Call Routing available: #17: Be more flexible on dates! (Part 2 - Lua)



    Within the GSE of you have a Time block which can be used to check (beside others) for time spans:




    You might noticed already that in here it is not possible to take the dates (or times) from within variables. So only hard coded time spans can be checked with this block.


    In case you need it more flexible and use variables this block can't be used. But the GSE wouldn't be the GSE if there wouldn't be another easy solution for this problem.


    We just have to do the comparison by ourselves with a little bit of VBScript. Within VBScript there is a DateDiff function available, which returns the difference of two dates in any needed unit, like days, weeks, months, years.


    Dim nDifference
    nDifference = DateDiff( "d", CDate("01.09.2019"), CDate("30.09.2019") )


    This example calculates the difference between the 01.09.2019 and 30.09.2019 in days and stores it into a variable.


    If the second date is larger/later than the first date, the result is a positive number. If the second date is smaller/earlier than the first date, the result is a negative number. The function CDate converts a given date into a VBScript "date" data type.


    So to check if the current date is within a given time span, we need to call DateDiff two times. The first time to check if the current date is larger/later than the start date. The second time to check if the current date is smaller/earlier than the end date.


    To do this, we simply use two Evaluate blocks in a row. To check if the current date is within a given time span, where the start date and end date is given in variables, we can simply use two such blocks:

















    Please note: in this example the start and end date are included in the time span. If you want them to be excluded from the time span just check for "> 0" instead of ">= 0".


    The current date is taken from the GSE build in function CurDate(). It would also be possible to use the VBSript function Now. The difference between both functions is, that CurDate() returns the date according the configured location time zone of the script user, while Now simply returns the date of the server machine.


    To put everything together into a handy little script I have configured the two variables for start and end date as parameters of the GSE script, so they can be easily set from the call routing manager. If I am on vacation my voicemail will be started, otherwise I want my regular call routing to be executed.





    Rule properties:







    And this is how it looks in the call routing manager:







    So with a little bit of VBscript and two Evaluate blocks we are able to check for time spans ourselves and don't need the static/hard coded Time block.


    You can download this tiny script from here:







    PS: don't miss to take a look into the ECR Useful Link Collection



  2. Tom Wellige
    Latest Entry

    By Tom Wellige,

    This post sums this great article series up. Mirjam spent quite some time to identify all those tips and to publish them here on Swyx Forum.


    As the article series dates some years back there had been a couple of articles I have not re-posted again, simply because they were not valid with a current SwyxWare version anymore.


    But the vast majority of the tips is still valid with current SwyxWare versions and that's why I decided to re-post them to make them available again after the old Swyx Forum went offline.


    Thank you very much Mirjam for all your efforts!


  3. A common feature request I have had over the years is a Call Park feature, and the usual stock reply to Can Swyx Do..... is NO! but...... of course this is software and anything is possible. I have seen a number of ways of implementing a call park feature some really clever ones that use the conference bridge facility in Swyx to some not so clever ones using analog adaptors to have live logged on extensions which are used to pick up from... sudu call park.
    Before I saw the conference room version written by Tom I had a go myself and came up with this solution a couple of years ago and put it online. Recently a couple of requests came in for the source code so I thought I would upload it here.
    This is another illustration of how different solutions to problems can be developed with Swyx, there is no right or wrong way, they either work or don't.



    So next time someone asks if "Swyx can do .........  ?",  reply  "No it can't, but you can"  🙂





    Call Park.zip

  • Blog Statistics

    • Total Blogs
    • Total Entries
  • Blog Comments

    • Nein, das Skript läuft auf JEDER SwyxWare Version. Das ist das schöne am Call Routing     Ich habe aber nochmal etwas genauer nachgesehen, und einen logischen Fehler gefunden. Der ist nun behoben und das Skript läuft einwandfrei auf meinem 13.25er Testsystem. Der Download oben im Blog Post ist aktualisiert.   Das war allerdings nur ein logischer Fehler, d.h. das Ende des Urlaubs wurde nicht richtig erkannt. Das hat aber zu keinen Skript/Ruf Abbruch geführt. Das klingt mir ehe
    • Hallo Herr Wellige 😀   ich bin gerade dabei ein Call Routing zu bauen, wo die Nutzer "einfach" Ihre Urlaubszeit eintragen können. Das hier angebrachte Skript funktioniert leider nicht mehr, das Gespräch wird beendet. Gibt es hier ggf. ein Update für die momentan aktuellste Version 13.25?   Danke schon einmal M. Schulze   getestet mit VBS nicht LUN
    • Hello Tom,   thanks for your reply.   As we´re not running the server on premise, I´ll have to make some calls to find out how to get my hands on the logfiles. The only logs we have are the mmc logs from the maschine the swyxware administration is running on.   And my usual called tech guy seems to be in holidays already  I´ll come back as soon as I get any info - when ever that will be.  
    • You should check the server trace file for what your modified call routing script is doing.   Details on how to find and read the server trace file from a call routing perspective can be found here: How to filter SwyxWare traces for call routing output of single call  
    • Hello Tom, thanks for that script and the work.   Even if we would raise the 4 engineers to a slightly higher number, I´ve tried to use the routing. It looks like that I´m missing a step to get it running - the incoming call is shown in active calls but goes instant to the voicebox message and is ended then. If I remove the voicebox block, there´s no incoming call shown in the active calls and (provider side i think) it tells that the called number is not reachable.  It
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.