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 The following function returns True if the current script user can be found in the list of users, where the current call has already been. Please see the Introduction chapter for some usage instructions. '---------------------------------------------------------------- ' IsLoopConfigured ' ' Checks if current script user is in the PreviousScripts list, ' i.e. the call was previously already in that user's call routing. ' So chances are high that this is a loop. ' ' Parameter: ' ' Return: ' boolean true - found in PreviousScripts list ' false - not found in PreviousScripts list. '---------------------------------------------------------------- Function IsLoopConfigured PBXScript.OutputTrace "-------------> IsLoopConfigured" Dim bReturn bReturn = IsRedirectedFromByName(PBXUser.Name) IsLoopConfigured = bReturn PBXScript.OutputTrace "bReturn = " & bReturn PBXScript.OutputTrace "<------------- IsLoopConfigured" End Function This function makes use of the IsRedirectedFromByName function, which is also part of the VBScript Function Collection. It also makes use of the Server Script API function PBXScript.OutputTrace to write trace information into the SwyxServer trace file. This function was initially posted into this forum topic.
  2. VBScript → Lua This function returns true if all members of the given group are logged off. Please see the Introduction chapter for some usage instructions. ''------------------------------------------------------------------- '' Name: IsGroupLoggedOff '' ================ '' '' Checks if all members of a given SwyxWare user group are logged off. '' '' return value: '' integer True - all members of the given group are logged off (or status can't be requested) '' False - at least one member of the given group is logged on ''-------------------------------------------------------------------- Function IsGroupLoggedOff ( sNumber ) PBXScript.OutputTrace("-------------> IsGroupLoggedOff ( sNumber = " & sNumber & " )") Dim bReturn bReturn = True Dim Users Set Users = g_PBXConfig.GetUserByAddress(sNumber) Dim User For Each User In Users PBXScript.OutputTrace("Found user " & User.Name & " with current state " & User.State) If User.State > 1 Then bReturn = False Next IsGroupLoggedOff = bReturn PBXScript.OutputTrace("bReturn = " & bReturn) PBXScript.OutputTrace("<------------- IsGroupLoggedOff") End Function Please note that the status signalling between all involved users (incl. the one the current call routing runs for) must be configured (just as in SwyxIt!). This function makes use of the Server Script API functions PBXConfig.GetUserByAddress to resolve all users in the given group and PBXScript.OutputTrace to write trace information into the SwyxServer trace file. Please note: if you are on SwyxWare v13.27 (or higher) and need to know if all users of the group the current script is running for are logged in/off, you can also use the new Server Script API function PBXGroup.IsLoggedIn. This function was initially posted into this forum topic.
  3. VBScript → Lua This function returns true if the current script user has an unconditional redirection to an external destination enabled. Please see the Introduction chapter for some usage instructions. '---------------------------------------------------------------- ' IsExternalRedirectionConfigured ' ' Checks if there is an unconditional call forwarding configured to an ' external number. The function checks if the configured unconditional ' call forwarding starts with the configured public line access. ' ' Parameter: ' ' Return: ' boolean true - external redirection configured ' false - no external redirection configured '---------------------------------------------------------------- Function IsExternalRedirectionConfigured() PBXScript.OutputTrace "-------------> IsExternalRedirectionConfigured" Dim bReturn bReturn = False Dim sPublicLineAccess sPublicLineAccess = g_PBXConfig.PublicAccessPrefix() PBXScript.OutputTrace "Configured public line access: " & sPublicLineAccess ' check forwarding If PBXUser.UnconditionalRedirect Then PBXScript.OutputTrace "Unconditional call forwarding configured to " & PBXUser.UnconditionalRedirectNumber If Left(PBXUser.UnconditionalRedirectNumber, Len(sPublicLineAccess)) = sPublicLineAccess Then PBXScript.OutputTrace "External call forwarding configured" bReturn = True Else PBXScript.OutputTrace "Internal call forwarding configured" End If Else PBXScript.OutputTrace "No unconditional call forwarding configured" End If IsExternalRedirectionConfigured = bReturn PBXScript.OutputTrace "bReturn: " & bReturn PBXScript.OutputTrace "<------------- IsExternalRedirectionConfigured" End Function This function makes use of the Server Script API function PBXConfig.PublicAccessPrefix to get the configured public line access. Afterwards it uses PBXUser.UnconditionalRedirect and PBXUser.UnconditionalRedirectNumber to check if a redirection is enabled and configured to a number starting with the public line access. It also uses PBXScript.OutputTrace to write trace information into the SwyxServer trace file. This function was initially posted into this forum topic.
  4. VBScript → Lua This function returns true if the call was transferred by another user and is not a direct call. Please see the Introduction chapter for some usage instructions. '---------------------------------------------------------------- ' IsCallTransferred ' ' Checks if the current call was transferred to the current user, ' i.e. was in some other user's call routing before. ' ' Parameter: ' ' Return: ' boolean true - call was transferred ' false - call is a direct call '---------------------------------------------------------------- Function IsCallTransferred PBXScript.OutputTrace "-------> IsCallTransferred()" PBXScript.OutputTrace "PBXScript.PreviousScripts.Count = " & PBXScript.PreviousScripts.Count Dim bReturn bReturn = (PBXScript.PreviousScripts.Count <> 0) IsCallTransferred = bReturn PBXScript.OutputTrace "bReturn = " & bReturn PBXScript.OutputTrace "<------- IsCallTransferred()" End Function This function makes use of the Server script API function PBXScript.PreviousScripts to check if the call has been in some other call routing scripts before (if so, it must have been transferred) and PBXScript.OutputTrace to write trace information into the SwyxServer trace file. This function was initially posted into this forum topic.
  5. VBScript → Lua This function returns true if at least one member of the given group is logged off. Please see the Introduction chapter for some usage instructions. '---------------------------------------------------------------- ' IsAtLeastOneMemberOfGroupLoggedOff ' ' Returns true if at least one member of the given group is logged off. ' ' Parameter: ' sGroup group number or name ' ' Return: ' boolean true - at least one member of group logged off ' false - all members of group are logged in '---------------------------------------------------------------- Function IsAtLeastOneMemberOfGroupLoggedOff ( sGroup ) PBXScript.OutputTrace "---------> IsAtLeastOneMemberOfGroupLoggedOff ( " & sGroup & " )" Dim bReturn bReturn = False Dim Users Set Users = g_PBXConfig.GetUserByAddress(sGroup) Dim User For Each User In Users PBXScript.OutputTrace "Found user '" & User.Name & "' in state '" & User.State & "'" ' state 1 = logged off If User.State = 1 Then bReturn = True Next IsAtLeastOneMemberOfGroupLoggedOff = bReturn PBXScript.OutputTrace "bReturn = " & bReturn PBXScript.OutputTrace "<--------- IsAtLeastOneMemberOfGroupLoggedOff" End Function Please note that the status signalling between all involved users (incl. the one the current call routing runs for) must be configured (just as in SwyxIt!). This function makes use of the Server Script API functions PBXConfig.GetUserByAddress to resolve all users in the given group and PBXScript.OutputTrace to write trace information into the SwyxServer trace file. This function was initially posted into this forum topic.
  6. VBScript → Lua This function returns true if at least one member of the given group is busy. Please see the Introduction chapter for some usage instructions. '---------------------------------------------------------------- ' IsAtLeastOneMemberOfGroupBusy ' ' Returns true if at least one member of the given group is busy. ' ' Parameter: ' sGroup group number or name ' ' Return: ' boolean true - at least one member of group busy ' false . no member of the group is busy '---------------------------------------------------------------- Function IsAtLeastOneMemberOfGroupBusy ( sGroup ) PBXScript.OutputTrace "---------> IsAtLeastOneMemberOfGroupBusy ( " & sGroup & " )" Dim bReturn bReturn = False Dim Users Set Users = g_PBXConfig.GetUserByAddress(sGroup) Dim User For Each User In Users PBXScript.OutputTrace "Found user '" & User.Name & "' in state '" & User.State & "'" ' state 3 = speaking external ' state 5 = speaking internal If (User.State = 3) Or (User.State = 5) Then bReturn = True Next IsAtLeastOneMemberOfGroupBusy = bReturn PBXScript.OutputTrace "bReturn = " & bReturn PBXScript.OutputTrace "<--------- IsAtLeastOneMemberOfGroupBusy" End Function Please note that the status signalling between all involved users (incl. the one the current call routing runs for) must be configured (just as in SwyxIt!). This function makes use of the Server Script API functions PBXConfig.GetUserByAddress to resolve all users in the given group and PBXScript.OutputTrace to write trace information into the SwyxServer trace file. This function was initially posted into this forum topic.
  7. VBScript → Lua The following function returns the user name from a given extension. Please see the Introduction chapter for some usage instructions. '---------------------------------------------------------------- ' GetUserNameFromExtension ' ' Returns the user name for the given extension. ' ' Parameter: ' sExtension extension ' ' Return: ' string user name '---------------------------------------------------------------- Function GetUserNameFromExtension( sExtension ) PBXScript.OutputTrace "------> GetUserNameFromExtension ( " & sExtension & " )" Dim sReturn sReturn = "" Dim oUSers Set oUsers = g_PBXConfig.GetUserByAddress(sExtension) Dim oUser For Each oUser In oUsers PBXScript.OutputTrace "Name: " & oUser.Name sReturn = oUser.Name Next GetUserNameFromExtension = sReturn PBXScript.OutputTrace "sReturn = " & sReturn PBXScript.OutputTrace "<------ GetUserNameFromExtension" End Function This function makes use of the Server Script API functions PBXConfig.GetUserByAddress to get the user name from the given number and PBXScript.OutputTrace to write trace information into the SwyxServer trace file. Examples for the usage of this function can be found in the functions IsRedirectedFromByNumber and IsRedirectionLoopConfigured. This function was initially posted into this forum topic.
  8. VBScript → Lua The following function fills an array with the names of a files in a given folder. The names contain the complete path. It can be used for example, to get a list of announcement (.wav) files in a folder to play them one after each other. See example code below... Please see the Introduction chapter for some usage instructions. '-------------------------------------------------------------- ' GetFilesInFolder() ' ' Reads all file names in given folder into a given array ' ' Parameter: ' Path [in] name of path ' FilesArray [out] array to store all filenames in ' ' Return: ' boolean TRUE - files found ' FALSE - no files found '-------------------------------------------------------------- Function GetFilesInFolder ( Path, ByRef FilesArray ) PBXScript.OutputTrace "-----------> GetFilesInFolder( " & Path & " )" Dim bReturn bReturn = False Dim fso, folder, files, file Set fso = CreateObject("Scripting.FileSystemObject") Set folder = fso.GetFolder(Path) Set files = folder.files Redim FilesArray(0) If files.count <> 0 Then bReturn = True For Each file In files Redim Preserve FilesArray(UBound(FilesArray)+1) FilesArray(UBound(FilesArray)) = file.path PBXScript.OutputTrace CStr(UBound(FilesArray)) & ": " & FilesArray(UBound(FilesArray)) Next End If Set fso = Nothing GetFilesInFolder = bReturn PBXScript.OutputTrace "bReturn = " & bReturn PBXScript.OutputTrace "<----------- GetFilesInFolder" End Function This function makes use of the Server Script API function PBXScript.OutputTrace to write trace information into the SwyxServer trace file. The following example code, which could be placed into an Insert Script Code block play all .wav files in a given folder: Dim Announcements() Dim i If GetFilesInFolder("C:\Announcements\", Announcements) Then For i = LBound(Announcements) to UBound(Announcements) PBXCall.PlayMessage Announcements(i) Next End If This exmaple makes use of the Server Script API function PBXCall.PlayMessage function to play a given .wav file. The .wav files need to be in 16kHz, 16bit, PCM, mono format. This function and the example was initially posted in this forum topic.
  9. VBScript This function returns the name of the computer (i.e. the host hame) the current script (i.e. the SwyxWare) is running on. Please see the Introduction chapter for some usage instructions. ''------------------------------------------------------------------- '' Name: GetComputerName '' =============== '' '' Returns the name of the machine/computer this script (i.e. the SwyxWare) is running on. '' '' return value: '' string computer name '' ''-------------------------------------------------------------------- Function GetComputerName() PBXScript.OutputTrace "---------> GetComputerName" Dim sReturn sReturn = "" On Error Resume Next Dim ob Set ob = CreateObject("WScript.Network") If err <> 0 Then PBXScript.OutputTrace "Error instanziating 'WScript.Network'! (" & err & ")" PBXScript.OutputTrace err.description Else sReturn = ob.ComputerName If err <> 0 Then PBXScript.OutputTrace "Error getting property 'ComputerName'! (" & err & ")" PBXScript.OutputTrace err.description End If End If Set ob = Nothing GetComputerName = sReturn PBXScript.OutputTrace "sReturn = " & sReturn PBXScript.OutputTrace "<--------- GetComputerName" End Function This function makes use of the Server Script API function PBXScript.OutputTrace to write trace information into the SwyxServer trace file. This function was initially posted into this forum topic.
  10. VBScript → Lua This function checks if the current caller (i.e. his phone number) can be found in a given text file. It can be used to create black or white lists for incoming calls on a user. Please see the Introduction chapter for some usage instructions. ' FileOpen iomode Values Const fsoForReading = 1 ' Open a file for reading only. Const fsoForWriting = 2 ' Open a file for writing only. Const fsoForAppending = 8 ' Open a file and write to the end of the file. Const fsoDontCreateIfNotExist = False Const fsoCreateIfNotExist = True Const fsoTristateUseDefault = -2 ' Opens the file by using the system default. Const fsoTristateTrue = -1 ' Opens the file as Unicode. Const fsoTristateFalse = 0 ' Opens the file as ASCII. '---------------------------------------------------------------- ' CheckCallerInTextFile ' ' Returns true if the current callers phone number can be found in a given text file. ' The text file must be formatted with one number per line. ' ' Parameter: ' sFileName text file (incl. path) that contains the numbers to check ' ' Return: ' boolean '---------------------------------------------------------------- Function CheckCallerInTextFile ( sFileName ) PBXScript.OutputTrace "-----------> CheckCallerInTextFile (" & sFileName & ")" Dim bReturn, sCaller, sLine bReturn = False On Error Resume Next sCaller = PBXCall.CallingPartyNumber PBXScript.OutputTrace "sCaller = " & sCaller Dim fso, file Set fso = CreateObject("Scripting.FileSystemObject") If fso.FileExists( sFileName ) Then Set file = fso.OpenTextFile(sFileName, fsoForReading, fsoDontCreateIfNotExist, fsoTristateFalse) If Err = 0 Then PBXScript.OutputTrace "File opened" Do While (Not file.AtEndOfStream) And (Not bReturn) sLine = file.ReadLine PBXScript.OutputTrace "sLine = " & sLine ' does the number in the text file contain the given number? If InStr(sLine, sCaller) > 0 Then bReturn = True PBXScript.OutputTrace "Found!" End If ' does the number in the text file is identical to the given number? 'If sLine = sCaller Then ' bReturn = True ' PBXScript.OutputTrace "Found!" 'End If Loop file.Close Else PBXScript.OutputTrace "Error opening file!" PBXScript.OutputTrace Hex(Err) & ": " & Err.Description End If Set file = Nothing Else PBXScript.OutputTrace "File does not exist!" End If Set fso = Nothing CheckCallerInTextFile = bReturn PBXScript.OutputTrace "bReturn = " & bReturn PBXScript.OutputTrace "<----------- CheckCallerInTextFile" End Function This function makes use of the Server Script API functions PBXCall.CallingPartyNumber to get the callers number and PBXScript.OutputTrace to write trace information into the SwyxServer trace file. You need to make sure, that the file can be accessed from the call routing script. For this it is necessary, that the Windows users the Swyx Server service is running under (usually SwyxServiceAccount) has at least read privileges on the file. The function was originally posted into this forum topic.
  11. VBScript → Lua The following function returns true if the current script user has any redirection configured (unconditional, busy or delayed). Please see the Introduction chapter for some usage instructions. '---------------------------------------------------------------- ' AnyRedirectionConfigured ' ' Returns true if current user has configured any redirection (unconditional, busy or delayed) ' ' Parameter: ' none ' ' Return: ' boolean '---------------------------------------------------------------- Function AnyRedirectionConfigured() PBXScript.OutputTrace "------> AnyRedirectionConfigured ()" Dim bReturn bReturn = (PBXUser.UnconditionalRedirect or PBXUser.BusyRedirect or PBXUser.DelayedRedirect) AnyRedirectionConfigured = bReturn PBXScript.OutputTrace "bReturn = " & bReturn PBXScript.OutputTrace "<------ AnyRedirectionConfigured" End Function This function makes use of the Server Script API functions PBXUser.UnconditionalRedirect, PBXUser.BusyRedirect and PBXUser.DelayedRedirect to figure if any of the script users' redirection is currently enabled and PBXScript.OutputTrace to write trace information into the SwyxServer trace file. This function was originally posted into this forum topic.
  12. Lua → VBScript This is a collection of usefull Lua functions that can be used with GSE call routing rules. Most functions are wrappers around Server Script API functions of GSE build-in functions to make their usage more easy or provide some additional functionality. The functions are taken from the forum section of Swyx Forum, where they had been provided by users over the years. As they were posted in VBScript they have been converted into Lua for this function collection. Usage To use any of these functions just follow these steps: Copy the function code into the Windows clipboard (select the code and press Ctrl-C) Open you GSE call routing rule. Double click the Start block Switch to the Parameters page Click into the huge text field and paste the function code by pressing Ctrl-V. Click OK. The function is now available within you call routing rule and can now be used directly within GSE blocks. Handle boolean return values The above example function IsUserFree() returns a booelan value. It can most conveniently be called with the Evaluate block: Handle numeric return values (up to 10 different ones) If your function returns more than 2 different values you can use an Insert Script Code block to evaluate up to 10 different values graphically. This is an example of how to use the GetUserStatus() function: Handle any return values You can call your own functions nearly everywhere within your GSE script. Where ever you find a button behind a parameter text field, you can call your function if it returns a needed value. For example a function GetDestination() returns the extension a call should be connected to with a Connect To block:
  13. VBScript → Lua This is a collection of usefull VBScript functions that can be used with GSE call routing rules. Most functions are wrappers around Server Script API functions of GSE build-in functions to make their usage more easy or provide some additional functionality. The functions are taken from the forum section of Swyx Forum, where they had been provided by users over the years. Usage To use any of these functions just follow these steps: Copy the function code into the Windows clipboard (select the code and press Ctrl-C) Open you GSE call routing rule. Double click the Start block Switch to the Parameters page Click into the huge text field and paste the function code by pressing Ctrl-V. Click OK. The function is now available within you call routing rule and can now be used directly within GSE blocks. Handle boolean return values The above example function IsUserFree returns a booelan value. It can most conveniently be called with the Evaluate block: Handle numeric return values (up to 10 different ones) If your function returns more than 2 different values you can use an Insert Script Code block to evaluate up to 10 different values graphically. This is an example of how to use the UserStatus function: Handle any return values You can call your own functions nearly everywhere within your GSE script. Where ever you find a button behind a parameter text field, you can call your function if it returns a needed value. For example a function GetDestination returns the extension a call should be connected to with a Connect To block:
  14. Lua → VBScript SwxWare v13.10 This function records a message as a temporary .wav file on the server. local nReturn = PBXCall.RecordMessage(nTimeout) This function returns a PBXResult value of PBXSuccess or PBXTimeout. Parameter nTimeout Maximum number of seconds until recording will be stopped. Valid values are 3 to 600. After the recording as finished the recorded file can be accessed via PBXCall.LastRecordedMessage() and its length (in seconds) can be obtained via PBXCall.LastRecordedMessageLength(). local nReturn = PBXCall.RecordMessage(180) if ((nReturn == PBXSuccess) or (nReturn == PBXTimeout)) then -- simply replay the recorded message PBXCall.PlayMessage(PBXCall.LastRecordedMessage) end
  15. Lua SwxWare v13.10 PBXConfigUser is a class returned by PBXScript.GetUserByAddress(). The member functions are always called in combination with a variable (be aware of the colon ':'). Example: aUsers = PBXScript.GetUserByAddress(UserAddr) for _, oUser in ipairs(aUsers) do PBXScript.OutputTrace("User : " .. oUser:UserID()) PBXScript.OutputTrace("Name : " .. oUser:Name()) PBXScript.OutputTrace("EMailAddress: " .. oUser:EMailAddress()) PBXScript.OutputTrace("Folder : " .. oUser:DataFolder()) PBXScript.OutputTrace("State : " .. oUser:State()) end Reference PBXConfigUser:DataFolder() local sFolder = PBXConfigUser:DataFolder() This function returns the user's data folder as string value. It is obsolete. PBXConfigUser:EMailAddress() local sEMail = PBXConfigUser:EMailAddress() This function returns the user's email address as string value. PBXConfigUser:FreeStatusText() -- get the frew status text local sText = PBXConfigUser:FreeStatusText() -- set a new free status text PBXConfigUser:FreeStatusText("I am out for lunch") This function sets or returns the user's free status text as string value. PBXConfigUser:Name() local sName = PBXConfigUser:Name() This function returns the user's name as string value. PBXConfigUser:NumberOfNewVoicemails() -- get the number of new voicemails local nNumber = PBXConfigUser:NumberOfNewVoicemails() -- set a new number of new voicemails local nNewNumber = 5 PBXConfigUser:NumberOfNewVoicemails(nNewNumber) This function sets or returns the user's numer of new voicemail counter as number value. PBXConfigUser:Numbers() local tNumbers = PBXConfigUser:Numbers() This function returns all internal numbers of the user as table of string values. PBXConfigUser:State() local nState = PBXConfigUser:State() This function returns the current state of the user as PBXUserStateValue value. This can be any of the following predefined constants: -- User object states PBXUserStateUnavailable = 0 -- no mutual status signalling configured PBXUserStateLoggedOff = 1 -- logged off PBXUserStateLoggedOn = 2 -- logged on and free PBXUserStateSpeakingExternal = 3 -- busy externally PBXUserStateAlerting = 4 -- currently altering/rinbing PBXUserStateSpeakingInternal = 5 -- busy internally PBXUserStateAway = 6 -- away status active PBXUserStateDoNotDisturb = 7 -- do not disturb (DND) status active PBXUserStateActive3rdParty = 8 -- busy indication from external presence source (e.g. MS Teams) PBXConfigUser:UserID() local nID = PBXConfigUser:UserID() This function returns the SwyxWare internal id of the user as a number value.
  16. Lua → VBScript SwxWare v13.10 Many of the Server Script API functions make use of predefined constants for parameters and/or return values. PBXResult -- Script result values PBXSuccess = 0 PBXFailure = 1 PBXTimeout = 2 PBXCallTermNormalCallClearing = 3 PBXCallTermDestinationBusy = 4 PBXCallTermReject = 5 PBXCallTermCancelled = 6 PBXCallTermTransferred = 7 PBXCallTermJoinedConference = 8 PBXCallTermNoAnswer = 9 PBXCallTermToLate = 10 PBXCallTermDirectCallImpossible = 11 PBXCallTermWrongNumber = 12 PBXCallTermConnectToCallerImpossible = 13 PBXCallTermDestinationUnreachable = 14 PBXInvalidDTMFDigitReceived = 15 PBXCallTermRedirectionNotPossible = 16 PBXCallTermIgnoreCall = 17 PBXCallTermNoChannelAvailable = 18 PBXCallTermNetworkCongestion = 19 PBXCallTermIncompatibleDestination = 20 PBXCallTermNumberChanged = 21 PBXCallTermOriginatorDisconnected = 22 PBXDestinationScriptStarted = 23 PBXCallTermDeflected = 24 PBXCallTermPermissionDenied = 25 PBXCallTermSubstituteNumberDenied = 26 PBXCallTermSecurityNegotiationFailed = 27 PBXScriptTraceLevel -- Trace level values PBXScript.TraceError = 2 PBXScript.TraceWarn = 3 PBXScript.TraceInfo = 4 PBXScript.TraceInfo2 = 5 PBXScript.TraceInfo3 = 6 PBXBusyResult -- Script busy result values PBXBusyResultFree = 0 PBXBusyResultBusy = 1 PBXBusyResultNotLoggedIn = 2 PBXCheckPinResult -- Possible remote inquiry PIN check result values PBXCheckPinResultOk = 0 PBXCheckPinResultFailure = 1 PBXCheckPinResultMaxAttemptsReached = 2 PBXUserStateValue -- User object states PBXUserStateUnavailable = 0 PBXUserStateLoggedOff = 1 PBXUserStateLoggedOn = 2 PBXUserStateSpeakingExternal = 3 PBXUserStateAlerting = 4 PBXUserStateSpeakingInternal = 5 PBXUserStateAway = 6 PBXUserStateDoNotDisturb = 7 PBXUserStateActive3rdParty = 8 PBXPhoneCallStateValue -- Phone call list state values PBXPhoneCallStateCallAccepted = 0 PBXPhoneCallStateCallNotAccepted = 1 PBXPhoneCallStateCallDiverted = 2 PBXPhoneCallStateCallDivertedToVoiceMessage = 5 PBXEntityTypeValue -- Entity type values PBXEntityTypeClient = 0 PBXEntityTypeTrunk = 1 PBXEntityTypeUnknown = 2 PBXDeviceType -- Device type constants (denoted as bitfield!) PBXDeviceTypeSoftClient = 1 PBXDeviceTypeSIPPhone = 2 PBXDeviceTypeSIPClient = 4 PBXDeviceTypeMobile = 8 PBXDeviceTypeConference = 64 PBXDeviceTypeSIPGateway = 256 PBXDeviceTypeSIPLink = 512 PBXDeviceTypeAll = 0xffffffff PBXFileCategory -- File category constants (subset of CDS file categories!) PBXFileFileCategoryRingTones = 0 PBXFileFileCategoryCallRoutingScripts = 1 PBXFileFileCategoryBitmaps = 2 PBXFileFileCategoryAnnouncements = 3 PBXFileFileCategoryHoldMusic = 4 PBXFileFileCategorySkins = 8 PBXFileFileCategoryFaxAttachments = 10 PBXFileFileCategoryVoiceAttachments = 15 PBXHttpReqVerb -- PBX HTTP request verbs PBXHttpVerbPost = 0 PBXHttpVerbGet = 1 PBXHttpVerbPut = 2 PBXHttpVerbDelete = 3 PBXHttpVerbPatch = 4 PBXHttpVerbHead = 5 PBXHttpReqAuth -- PBX HTTP authentication methods PBXHttpAuthNone = 0 PBXHttpAuthBasic = 1 PBXHttpAuthDigest = 2 PBXHttpAuthBearer = 3 PBXHttpAuthAny = 4 PBXScriptKeyValueResult -- Script key value result PBXScriptKeyValueOk = 0 PBXScriptKeyValueUpdateOk = 1 PBXScriptKeyValueUserNotFound = 2 PBXScriptKeyValueKeyNotFound = 3 PBXScriptKeyValueKeyInvalid = 4 PBXScriptKeyValueValueInvalid = 5 PBXScriptKeyValueDictKeyAlreadyExists = 6 PBXScriptKeyValueMaxDictSizeExceeded = 7 PBXScriptKeyValueDictKeyInvalid = 8 PBXScriptKeyValueDictKeyNotFound = 9 PBXScriptKeyScope -- Script key scopes PBXScriptKeyUserScope = 0 PBXScriptKeyGlobalScope = 1 IsHolidayInGermany -- Federal States of Germany (BundesLänder) GSE_BL_BW = 0x00001 -- Baden-Württemberg GSE_BL_BY = 0x00002 -- Bayern GSE_BL_BE = 0x00004 -- Berlin GSE_BL_BB = 0x00008 -- Brandenburg GSE_BL_HB = 0x00010 -- Bremen GSE_BL_HH = 0x00020 -- Hamburg GSE_BL_HE = 0x00040 -- Hessen GSE_BL_MV = 0x00080 -- Mecklenburg-Vorpommern GSE_BL_NI = 0x00100 -- Niedersachsen GSE_BL_NW = 0x00200 -- Nordrhein-Westfalen GSE_BL_RP = 0x00400 -- Rheinland-Pfalz GSE_BL_SL = 0x00800 -- Saarland GSE_BL_SN = 0x01000 -- Sachsen GSE_BL_ST = 0x02000 -- Sachsen-Anhalt GSE_BL_SH = 0x04000 -- Schleswig-Holstein GSE_BL_TH = 0x08000 -- Thüringen GSE_BL_KD = 0x10200 -- Köln/Düsseldorf (Rosenmontag, GSE_BL_NW is included)
  17. Lua → VBScript SwxWare v13.10 This function takes or returns the number of the current caller. -- get calling party number local sNumber = PBXCall.CallingPartyNumber() -- set new calling partyn umber PBXCall.CallingPartyNumber("123456789") This function sets or returns a string value. This function can be used to modify the number being displayed on a client (SwyxIt!, SwyxPhone). It does not modify the caller list entry. Additionally you can also modify the name being displayed using the PBXCall.CallingPartyName() property. Please note that you have to modify this value before actually connecting the call to a user using the Connect To block. This function is identical to the GSE build-in function IpPbx.CallingNumber().
  18. VBScript Lua To give an early impression of the new Lua based call routing with SwyxWare, I have updated the Zendesk Integration project here on Swyx Forum. It comes now with its full feature set for VBScript based call routing as well as for Lua based call routing. Althouth the Lua based call routing is still in BETA state in SwyxWare 13.10 and should not be used in productive environments, you can use the new version to get an idea of Lua based call routing, how to handle web requests and how to handle Json formatted data. You will see, it really is easy. To do so, just download version 1.4.0 and take a look into the Lua based\ase\Zendesk.lua file from the download package. Of course, if you want to see how to handle web requests and Json formatted data in VBScript, you can do that as well. In this case just take a look into the VBScript based\ase\Zendesk.vbs file. Btw, the new version of the Zendesk Integration project also comes with a new feature: automatically open a Zendesk ticket in an agent's web browser (taken what he has already a browser window opened in which he his logged in into his Zendesk account). Enjoy!
  19. VBScript Lua 1.4.0 This example demonstrates the usage of the Zendesk Open Ticket GSE action. On any incoming call it opens the given ticket in the agent's web browser. In order to have this working, the agent needs to have already at least one web browser window opened in which he is logged in into hisZendesk account. Please note: due to a limitation of the Zendesk Partner Talk API, all web browser windows the agent has currently opened in which he is logged into Zendesk will change to the given ticket. To install it: Open the Call Routing Manager of your desired SwyxWare user. Click the "New Rule..." button. Select "Graphical Script Editor" and click Ok. With the GSE open the File | Import... menu and click No. From the download package select the following file: For VBScript usage: VBScript based\rse\Open Ticket.rse For Lua usage: Lua based\rse\Open Ticket.rse You need to make some modifications in the "Open Ticket" block. They are explained in detail in chapter 3.2 - GSE Action Zendesk Open Ticket.
  20. VBScript Lua 1.4.0 This GSE action can be used to open a given Zendesk ticket in an agent's web browser. An example call routing script can be found in A.5 - Example: Open Ticket. In order to have this working, the agent needs to have already at least one web browser window opened in which he is logged in into his Zendesk account. Please note: due to a limitation of the Zendesk Talk Partner Edition API, all web browser windows the agent has currently opened in which he is logged into Zendesk will change to the given ticket. Configure action parameters By double clicking on every parameter in the list, you can edit it. TicketID The Zendesk ID of the ticket to update. The ID can be given with or without the Zendesk typical # prefix, i.e. 1234 or #1234. Zendesk AgentD The Zendesk user id of the agent in which browser the given ticket should be opened. Zendesk Login User Login user. To connect to Zendesk a Zendesk user login is required. This project uses a username/token authentication instead of username/password. This is a more robust solution, and keeps the call routing script independent from any password changes the Zendesk user might do. Please follow this link to learn how to obtain the needed login token. Zendesk Login Token Login token. To connect to Zendesk a Zendesk user login is required. This project uses a username/token authentication instead of username/password. This is a more robust solution, and keeps the call routing script independent from any password changes the Zendesk user might do. Please follow this link to learn how to obtain the needed login token. Zendesk Domain Your Zendesk domain URL. This is something like "yourcompanyname.zendesk.com". Configure action exits Exit 0 (Default) This exit will be reached on any error during updating the ticket. Please refer to 3.6 - Trouble shooting for more information on how to do a deeper analysis of the error. You should label this exit to something like "error". Exit 1 This exit will be reached if the ticket has been successfully updated. You need to enable this exit (checkbox) and should label it to something like "success". Additional return value (as global variable) g_sLatestZendeskTicketID (string) 1.5.0 This global variable holds the ID of the latest opened ticket after the ok (0) exit has been reached.
  21. Der Trick liegt darin, die "rulePreProcessing.vbs" Datei in den "globalen" Sichtbarkeitsbereich der Datenbank zu laden, wie in meiner ersten Antwort oben beschrieben. Damit wird sie von allen Benutzer gesehen. Die "PreProcessing" GSE Regel (aus der die "rulePreProcessing.vbs" Datei resultiert) ist eine besondere Regel. Bevor das eigene Call Routing Regelwerk eines Benutzers gestartet wird, wird IMMER zuerste die "PreProcessing" Regel gestartet. Wenn der Benutzer keine eigene hat, und sie auch im "globalen" Bereich nicht liegt, wird eine Default Version aus dem "System Default" Bereich geladen. Wenn Du also eine eigene "PreProcessing" Regel in den "globalen" Bereich legt, wird diese für jeden kommenden Ruf geladen. Wichtig ist, dass Du die "rulePreProcessing.vbs" Datei in den "globalen" Bereich lädst. Das macht Du über den "Dateien" Reiter in den Server Einstellungen in der SwyxWare Administration. Ebenso wichtig ist, dass Du die Regel zunächst bei einem Benutzer erstellst und dort sauber austestest. Erst wann alles so läuft wie es soll, machst Du die Datei global. Wenn in der global gemachten Datei Fehler drin stecken, die ggf. sogar zu einem Rufabbruch führen, kann anschliessend kein Benutzer mehr angerufen werden (zumindest solange wie Du die fehlerhafte Datei im globalen Bereich liegen hast). Mit der PreProcessing Regel sollte man also sorgsam umgehen.
  22. Schick mir doch mal Dein angepasstes Skript. Gerne per PN statt öffentlich ins Forum. Einfach links mein Profilbild anklicken, dann "Message".
  23. Was mir auffällt ist, dass Du nicht auf der neusten Version bist (13.10). Kleiner Hinweis an dieser Stelle: das hier ist, wie auf der Startseite des Forum und im Impressum deutlich beschrieben, ein unabhängiges Forum von und für SwyxWare Benutzer und keine offizielle Swyx/Enreach Webseite. Solche Kommentare führen daher beim Enreach Partner oder der Distribution zu mehr Erfolg.
  24. Mit der Einführung von Holacracy ersetzt Enreach das klassische Top-Down-Management. Das Organisationsmodell verteilt die Entscheidungsgewalt unter den Beschäftigten. So kann jeder im Unternehmen die Initiative ergreifen und Verantwortung für das eigene Handeln übernehmen. Rund 70 Prozent der mehr als 1.100 Mitarbeitenden von Enreach in ganz Europa arbeiten inzwischen nach den Prinzipien von Holacracy. Die individuellen Fähigkeiten und Kenntnisse der einzelnen Mitarbeitenden stehen dabei im Sinne des Unternehmenserfolgs und ihrer eigenen Entwicklung stets im Mittelpunkt. Eigeninitiative und proaktives Handeln sind Grundvoraussetzungen. „Ein wichtiges Merkmal von Holacracy ist der Fokus auf den ‚Purpose‘ der gesamten Organisation. Wo es früher feste Stellenbeschreibungen und Abteilungen mit vom Management vorgegebenen Zielen gab, arbeiten wir jetzt mit Kreisen und Rollen, die alle einen eigenen Beitrag zum Unternehmenszweck liefern. Wie dieser Beitrag geleistet wird, kann jederzeit und von jedem hinterfragt werden. So entstehen bei Bedarf neue Rollen oder Kreise und das Unternehmen verwaltet sich selbst. Titel und Hierarchien spielen keine Rolle mehr“, erläutert Sandra Tuulikki Kröger, die in der deutschen Organisation von Enreach den Bereich Talent Lab sowie die Einführung von Holacracy verantwortet. Schlanke Prozesse und Vernetzung untereinander Holacracy macht transparent, wer wofür zuständig ist, und sorgt für Schnelligkeit und Agilität. Das System der Selbstorganisation ermöglicht es jedem im Unternehmen, Führungsstärke zu zeigen. Niemand muss mehr auf die Zustimmung eines Vorgesetzten warten, sondern darf im Rahmen seiner Verantwortlichkeiten selbst entscheiden. Ist beispielsweise jemand mit seiner Rolle nicht zufrieden, kann er oder sie Änderungsvorschläge machen. Gemeinsam mit den anderen im zuständigen Kreis wird geschaut, inwieweit diese umsetzbar sind. Dabei gilt: „Wenn es dem Unternehmen nicht schadet, dann probieren wir es aus.“ Dadurch bleiben Prozesse schlank, Aufgaben werden rasch erledigt und Beschäftigte arbeiten ohne strenge Hierarchien und eng abgesteckte Kompetenzbereiche gemeinschaftlich zusammen. „Holacracy fördert die Vernetzung der Mitarbeiter untereinander und ist ideal für die ortsunabhängige Zusammenarbeit. Das Organisationsmodell ermöglicht es uns, Veränderungen flexibel abzubilden und unterstützt uns dabei als europäische Unternehmensgruppe noch enger zusammenzuwachsen. Damit sind wir für den Weg in die hybride Arbeitswelt gerüstet“, so Sandra Kröger. Eigenverantwortung kommt gut an – auch bei Bewerbern Das Fazit nach der Holacracy-Einführung bei Enreach fällt positiv aus. Die Möglichkeit, aktiv mitzugestalten, kommt bei Mitarbeitenden gut an: Sie können eigene Stärken besser einbringen und schätzen es, dass Veränderungen an ihren Aufgaben und der Organisationsstruktur nicht mehr nur in den Händen einer kleinen Gruppe liegen. Davon profitiert natürlich auch das Unternehmen, das so für zufriedene Mitarbeiter und eine motivierende, produktive Atmosphäre sorgt. Enreach punktet jedoch nicht nur bei der aktuellen Belegschaft mit der Organisationsform. „Holacracy ist auch ein Alleinstellungsmerkmal in Bewerbungsgesprächen, da nicht viele Unternehmen unserer Größenordnung so organisiert sind. Besonders IT-Spezialisten und hochqualifizierte Fachkräfte wünschen sich eine Position, in der sie sich aktiv einbringen können“, schildert Sandra Kröger ihre Erfahrungen. Pressemitteilung auf enreach.de
  25. Lua SwxWare v13.10 This helper function checks if a given date is a federal/public holiday in the given German federal state(s). local bHoliday = IsHolidayInGermany(nFederalState, tCheckDate) This function returns a boolean value. The moving church holidays (Easter) are calculated by the Heiner Lichtenberg formula which extends the original formula by Carl Friedrich Gauss. Parameters nFederalState: One or more (logical or combined) constants defind for each German federal state: GSE_BL_BW -- Baden-Württemberg GSE_BL_BY -- Bayern GSE_BL_BE -- Berlin GSE_BL_BB -- Brandenburg GSE_BL_HB -- Bremen GSE_BL_HH -- Hamburg GSE_BL_HE -- Hessen GSE_BL_MV -- Mecklenburg-Vorpommern GSE_BL_NI -- Niedersachsen GSE_BL_NW -- Nordrhein-Westfalen GSE_BL_RP -- Rheinland-Pfalz GSE_BL_SL -- Saarland GSE_BL_SN -- Sachsen GSE_BL_ST -- Sachsen-Anhalt GSE_BL_SH -- Schleswig-Holstein GSE_BL_TH -- Thüringen GSE_BL_KD -- Köln/Düsseldorf (Rosenmontag) (NRW is included)) tCheckDate: Optional*. The date that should be checked. You can pass the date in different types and formats: string, in "%d.%m.%Y" format, i.e. DD.MM.YYYY number, in os.date "*t" format table, in the following format t.day t.month t.year If the parameter is omitted, the current date (of the script user, according to his time zone settings) will be used. For this you could also use the GSE build-in function CurDate() or the Server Script API function PBXUser.Now(). * Please note: due to a bug in SwyxWare 13.10 this parameter is not optional yet. In the "Lua based call routing" release version of SwyxWare, this will be fixed. Examples -- check the current date in the federal state of Nordrhein-Westfalen if (IsHolidayInGermany(GSE_BL_NW) == true) then -- do something end -- check the current date in the federal states of Bremen and Hamburg if (IsHolidayInGermany((GSE_BL_HB | GSE_BL_HH), CurDate()) == true) then -- do something end You can also use this function directly within the property page of the GSE Evaluate block: When using a VBScript based callrouting there are two similar functions for Germany and Austria available: IsPublicHolidayAT (Austria, including Federal States) IsPublicHolidayDE (Germany, including Federal States)
×
×
  • 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.