Jump to content

Tom Wellige

Root Moderator
  • Posts

    4,310
  • Joined

  • Last visited

  • Days Won

    117

 Content Type 

Profiles

SwyxPEDIA Wiki

Zendesk Integration

Persistent Variables

Longest Waiting

VBScript build in functions

GSE build in functions (VBScript)

Server Script API (VBScript)

GSE build in functions (Lua)

Server Script API (Lua)

Function Collection (VBScript)

Function Collection (Lua)

IPS Integration

Jira Service Integration

Forums

Blogs

Downloads

Everything posted by Tom Wellige

  1. VBScript → Lua This function returns the current script users' Busy status. If IsBusy() Then ' do something Else ' do something else End If or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the Busy status and place it the block exits: This function returns a boolean value. This function can be called at any time within the call routing script. The current busy state will be requested making use of the Server Script API function PBXUser.IsBusy.
  2. VBScript → Lua SwxWare 2011 This function returns the current script users' Away status. If IsAway() Then ' do something Else ' do something else End If or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the Away status and place it the block exits: This function returns a boolean value. If being used in a group context (from SwyxWare v13.27) this function returns false. Read more about user and group context differences here. This function can be called at any time within the call routing script. The current away state will be requested making use of the Server Script API function PBXUser.Away.
  3. VBScript → Lua The function returns the current year (yyyy) according to the script user's location. Dim sYear sYear = CurYear() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the current year (read as single digits, not a number) to the caller: This function returns a four digit string value. This function can be called at any time within the call routing script. The current date will be requested making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered.
  4. VBScript → Lua This function returns the current time according to the script user's location. Dim vTime vTime = CurTime() or if being used directly within a GSE property dialog, e.g. in a Say Time block to directly announce the current time to the caller: This function returns a date / time value. The returned value does not contain any date information, unlike CurDateTime(). Note: This function is not the same as the VBScript build in function Now. While Now returns the current date and time of the SwyxWare Service Account Windows User (according it's regional settings) when being used within a call routing script, CurTime() uses the Server Script API function PBXUser.Now to get the script user's date and time according to his location (timezone) configuration within SwyxWare. This is not necessarily the same. The SwyxWare Service Account is the Windows User the SwyxWare Services are running under. As call routing scripts are executed by the SwyxServer Service they use the SwyxWare Service Account configuration. If you prefer using the VBScript build in Now function in favour of CurTime() in multi-location environments spreaded over several time zones, you can use SetLocale to adjust the regional settings for the current script. This is just for the current instance of the script and is not permanent on the server. Example: Assuming you have a location in Germany and one in New Zealand. The server is located in Germany. Users from New Zealand are logged in via a direct VPN connection. The server uses a German operating system as also complete German regional settings. Before using Now you need to set the correct locale in order to receive the correct date / time for New Zealand: SetLocale = 5129 ' New Zealand Dim vDate vDate = Now
  5. VBScript → Lua The function returns the current second (00-59) according to the script user's location. Dim sSecond sSecond = CurSecond() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the current second to the caller: This function returns a two digit string value. This function can be called at any time within the call routing script. The current time will be requested making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered.
  6. VBScript → Lua The function returns the current month (01-12) according to the script user's location. Dim sMonth sMonth = CurMonth() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the current month to the caller: This function returns a two digit string value. This function can be called at any time within the call routing script. The current date will be requested making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered.
  7. VBScript → Lua The function returns the current minute (00-59) according to the script user's location. Dim sMinute sMinute = CurMinute() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the current minute to the caller: This function returns a two digit string value. This function can be called at any time within the call routing script. The current time will be requested making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered.
  8. VBScript → Lua The function returns the current hour (01-24) according to the script user's location. Dim sHour sHour = CurHour() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the current hour to the caller: This function returns a two digit string value. This function can be called at any time within the call routing script. The current time will be requested making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered. The CurHour() function can be used for a neat little example: Lets assume you want to greet every caller with a nice welcome announcement. But this should not be one static annoucement, but a little bit more dynamic: in the morning it includes "Good morning, and welcome to..." over the day it includes "Good day, and welcome to..." in the evening it includes "Good evening, and welcome to..." You can use the Choose Announcement block, to setup all three announcement and use the CurHour() function to differentiate between them:
  9. VBScript → Lua The function returns the current day of the week (1-7) according to the script user's location. Dim nDayOfWeek nDayOfWeek = CurDayOfWeek() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the current day of the week (as a number) to the caller: This function returns an integer value. The returned number evaluates to: 1 - Monday 2 - Tuesday 3 - Wednesday 4 - Thursday 5 - Friday 6 - Saturday 7 - Sunday If you are interested in the name of the current day of the week (instead of the number) you can use the VBScript buildin function WeekdayName. In this case you need to know that the language the name is returned in is defined by the regional settings of the SwyxWare Service Account Windows user. Read more about this here. This function can be called at any time within the call routing script. The current date will be requested making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered. Unlike the VBScript buildin function Weekday this function always starts with Monday as 1, regardless of any regional or location settings.
  10. VBScript → Lua The function returns the current day (01-31) according to the script user's location. Dim sDay sDay = CurDay() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the current day to the caller: This function returns a two digit stringvalue. This function can be called at any time within the call routing script. The current date will be requested making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered.
  11. VBScript → Lua This function returns the current date and time according to the script user's location. Dim vDateTime vDateTime = CurDateTime() or if being used directly within a GSE property dialog, e.g. in a Say Date block to directly announce the current date to the caller: This function returns a date / time value. The returned value contains date and time information, unlike CurDate() and CurTime(). Note: This function is not the same as the VBScript build in function Now. While Now returns the current date and time of the SwyxWare Service Account Windows User (according it's regional settings) when being used within a call routing script, CurDateTime() uses the Server Script API function PBXUser.Now to get the script user's date and time according to his location (timezone) configuration within SwyxWare. This is not necessarily the same. The SwyxWare Service Account is the Windows User the SwyxWare Services are running under. As call routing scripts are executed by the SwyxServer Service they use the SwyxWare Service Account configuration. If you prefer using the VBScript build in Now function in favour of CurDateTime() in multi-location environments spreaded over several time zones, you can use SetLocale to adjust the regional settings for the current script. This is just for the current instance of the script and is not permanent on the server. Example: Assuming you have a location in Germany and one in New Zealand. The server is located in Germany. Users from New Zealand are logged in via a direct VPN connection. The server uses a German operating system as also complete German regional settings. Before using Now you need to set the correct locale in order to receive the correct date / time for New Zealand: SetLocale = 5129 ' New Zealand Dim vDate vDate = Now
  12. VBScript → Lua This function returns the current date according to the script user's location. Dim vDate vDate = CurDate() or if being used directly within a GSE property dialog, e.g. in a Say Date block to directly announce the current date to the caller: This function returns a date / time value. The returned value does not contain any time information, unlike CurDateTime(). Note: This function is not the same as the VBScript build in function Now. While Now returns the current date and time of the SwyxWare Service Account Windows User (according it's regional settings) when being used within a call routing script, CurDate() uses the Server Script API function PBXUser.Now to get the script user's date and time according to his location (timezone) configuration within SwyxWare. This is not necessarily the same. The SwyxWare Service Account is the Windows User the SwyxWare Services are running under. As call routing scripts are executed by the SwyxServer Service they use the SwyxWare Service Account configuration. If you prefer using the VBScript build in Now function in favour of CurDate() in multi-location environments spreaded over several time zones, you can use SetLocale to adjust the regional settings for the current script. This is just for the current instance of the script and is not permanent on the server. Example: Assuming you have a location in Germany and one in New Zealand. The server is located in Germany. Users from New Zealand are logged in via a direct VPN connection. The server uses a German operating system as also complete German regional settings. Before using Now you need to set the correct locale in order to receive the correct date / time for New Zealand: SetLocale = 5129 ' New Zealand Dim vDate vDate = Now
  13. VBScript → Lua This function returns date and time when the current call reached the call routing of the user. Dim vCallStart vCallStart = CallStart() or if being used directly within a GSE property dialog, e.g. in a Say Time block to directly announce the start time to the caller: This function returns a date / time value. This function can be called at any time within the call routing script. The start date/time will be request making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered. The start date/time can be used to calculate the duration of the call, but for this purpose there is already the CallDuration() function available.
  14. VBScript → Lua This function returns the unique call id of the current call. Dim nCallID nCallID = CallID() This function returns an integer value. This function is identical to the Server Script API function PBXCall.CallId. Every call within SwyxWare (regardless if internal or external) will be tagged with a unique id by the SwyxServer. This id will also be written into the Call Detail Records (CDR). If a call will be transferred to another user it will automatically get a new CallID assigned. The CDRs will record all these different IDs. For detailed information take a look into the Enreach Knowledgebase article Call Detail Record (CDR) Format (kb2413) The CallID can also be requested once the call is connected to a user (SwyxIt!) from the Client SDK. Do not mistake this CallID by the unique call id you find within the SwyxWare traces files per call. The call id column in the traces files takes a number that will be reset by every restart of the service, while the CallID of course is persistent. Hints on reading SwyxWare traces files (especially in terms of call routing) can be found here: How to filter the Server Trace for Call Routing output of a certain call
  15. VBScript → Lua This function returns the dialed number that has leaded the call to reach the current script. It returns just the first digits to correctly identify the script user but *not* any so called post dialing digits. Dim sCalledNumber sCalledNumber = CalledNumber() This function returns a string value. This function is identical to the Server Script API function PBXCall.CalledPartyNumber. This function replaces the obsolete Extension() function. There is a Server Script API function available PBXCall.DialedNumber which returns all dialed digits, including the so called post dialing digits. If you are interested in the post dialing digits you can use the GSE build-in function PostDialingDigits(). Example: Script user has internal number 200 Internal caller dialed 200123 PBXCall.CalledPartyNumber returns 200 PBXCall.DialedNumber returns 200123 PostDialingDigits() returns 123
  16. VBScript → Lua This function returns the duration (in seconds) of the current call. Dim nDuration nDuration = CallDuration() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the duration to the caller: This function returns an integer value. This function can be called at any time within the call routing script. The duration will be calculated from the CallStart() time and the current time. The start time and the current time will be request making use of the Server Script API function PBXUser.Now. This ensures that the location configuration (time zone) of the script user will be considered.
  17. VBScript → Lua SwxWare 2011 This property takes or returns the current free status text of the script user. ' Getting the script users free status text Dim sUserFreeStatusText sUserFreeStatusText = IpPbx.UserFreeStatusText ' Setting the script users free status text IpPbx.UserFreeStatusText = "I am out for lunch" This property takes or returns a string value. If being used in a group context (from SwyxWare v13.27) this property returns an empty string. Read more about user and group context differences here. This property is identical to the Server Script API property PBXUser.FreeStatusText. The status text of a user is getting in the SwyxIt! client when hovering the mouse pointer above a speed dial key being configured to that user.
  18. VBScript → Lua SwxWare 2011 This function returns the secondory calling party number, i.e. the network provided number. IpPbx.SecondaryCallingNumber This function returns a string value. The function IpPbx.CallingNumber provides the so called user provided number. This number can either be suppressed or manipulated (via "clip no screening") by the caller. The network provided number can't be manipulated by the caller. Usually it is not getting signalled by the provider. On special lines/trunks, e.g. emergency services (police, fire brigade), it will be signalled by the provider. If the SwyxWare is connected to such special line/trunk the IpPbx.SecondaryCallingNumber provides the network provided number. Otherwise it is empty.
  19. VBScript → Lua This property takes or returns the "one way" conference status of the current call. If the call is transfered into a conference this flag defines, if the caller is in "listen only" mode or not. ' Retrieving the current oneway conference status Dim bOneWayConference bOneWayConference = IpPbx.OneWayConference ' Setting the oneway conference status IpPbx.OneWayConference = True This property takes or returns a boolean value. A "one way" conference is a conference where the caller is able to listen only. His own voice will automatically be muted. If you want to enable the "one way" conference for this user, you need to set this property before actually connecting the call to the conference by using the Connect To block. It is also possible to use a special Feature Codes when connecting the call to a conference. The feature code for the one way conference can be requested within the call routing script by using the OneWayConferenceSuffix() function.
  20. VBScript → Lua SwxWare 2011 This property takes or returns the current do not disturb status of the script user. ' Getting the script users current do not disturb (dnd) state Dim bDoNotDisturb bDoNotDisturb = IpPbx.DoNotDisturb ' Setting the script users do not disturb (dnd) state IpPbx.DoNotDisturb = True This property takes or returns a boolean value. If being used in a group context (from SwyxWare v13.27) this property returns false. Read more about user and group context differences here. This property is identical to the Server Script API property PBXUser.DoNotDisturb.
  21. VBScript → Lua This property takes or returns the number of the current caller. ' Retrieving the caller number Dim sNumber sNumber = IpPbx.CallingNumber ' Setting the caller number IpPbx.CallingNumber = "123456789" This property takes or returns a string value. This property can be used to modify the number being displayed on a client (SwyxIt!, SwyxPhone). It does not modify the caller list entry. This can be achieved using the PBXCall.PhoneCallListEntry object. Additionally you can also modify the name being displayed using the IpPbx.CallingName property. Please note that you have to modify this value before actually connecting the call to a user using the Connect To block. This property is identical to the Server Script API property PBXCall.CallingPartyNumber. This forum thread explains how to modify the displayed name and number.
  22. VBScript → Lua This property takes or returns the name of the current caller. ' Retrieving the caller name Dim sName sName = IpPbx.CallingName ' Setting the caller name IpPbx.CallingName = "Erika Mustermann" This property takes or returns a string value. This property can be used to modify the name being displayed on a client (SwyxIt!, SwyxPhone). It does not modify the caller list entry. This can be achieved using the PBXCall.PhoneCallListEntry object. Additionally you can also modify the number being displayed using the IpPbx.CallingNumber property. Please note that you have to modify this value before actually connecting the call to a user using the Connect To block. This property is identical to the Server Script API property PBXCall.CallingPartyName. This forum thread explains how to modify the displayed name and number.
  23. VBScript → Lua SwxWare 2011 This property takes or returns the current away status of the script user. ' Getting the script users current away state Dim bAway bAway = IpPbx.Away ' Setting the script users away state IpPbx.Away = True This property takes or returns a boolean value. If being used in a group context (from SwyxWare v13.27) this property returns false. Read more about user and group context differences here. This property is identical to the Server Script API property PBXUser.Away.
  24. VBScript → Lua The GSE defines a number of usefull functions to make use of within your call routing scripts. At many places within the GSE block parameter dialogs you'll find a button right after a field to enter some value in. For example the properties dialog of the Connect To block: This button has exactly two purposes: telling you that you can put in any VBScript code you like into the field before. Please note, that you have to place a "=" (equal) character in front of your code to tell the GSE that the following will be some VBScript code that needs to be executed/evaluated. providing a list of all build in GSE functions and defined variables within your script by clicking on it. By double clicking on a function or variable (or click on the "Use" button) the selected item will be copied into the configuration field. If this field was initially empty the GSE will automatically place the "=" (equal) character in front of it, otherwise the GSE assumes you have already done that and simply adds the selected item to the content of the configuration field.
  25. Function Description InStr Returns the position of the first occurrence of one string within another. The search begins at the first character of the string InStrRev Returns the position of the first occurrence of one string within another. The search begins at the last character of the string LCase Converts a specified string to lowercase Left Returns a specified number of characters from the left side of a string Len Returns the number of characters in a string LTrim Removes spaces on the left side of a string RTrim Removes spaces on the right side of a string Trim Removes spaces on both the left and the right side of a string Mid Returns a specified number of characters from a string Replace Replaces a specified part of a string with another string a specified number of times Right Returns a specified number of characters from the right side of a string Space Returns a string that consists of a specified number of spaces StrComp Compares two strings and returns a value that represents the result of the comparison String Returns a string that contains a repeating character of a specified length StrReverse Reverses a string UCase Converts a specified string to uppercase
×
×
  • 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.