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. Lua → VBScript SwxWare v13.10 This function returns the current script users' user id. The user id is a SwyxWare internal representation of a user. local nID = PBXUser.UserId() This function returns a number value. This function allows read access only. Every SwyxWare user has his own unique user id on a SwyxServer. SwyxWare internally uses the user id to identify a user. The user id is also used in the PBXScript.PreviousScripts() function to identify a user's script. Beside this property there is the PBXUser.Name() function which returns the name of the current script user. If you need to resolve the name or the user id of any SwyxWare user (not only the current script user) you can use the PBXScript.GetUserByAddress() function. If you need to differer SwyxWare user in your own application/script you might consider using the user id instead of the PBXUser.Name(). The ids are unique and will not change over the time.
  2. Lua → VBScript SwxWare v13.10 This function sets or returns the state of the script users' (for whom the current script is running) own undconditional redirection number setting, meaning the target of the redirection. if (PBXUser.UnconditionalRedirectNumber() == "100") then -- do something end -- configure redirection target PBXUser.UnconditionalRedirectNumber("200") This function takes or returns a string value. Please note, that you need to enable the redirection using the PBXUser.UnconditionalRedirect() function. SwyxServer handles all telephone numbers as string, so don't miss to use " ". You can use either a number, a user name or a group name as value. There is a magic string "voicemail" to redirect all calls to the user's voicemail. -- redirect all calls to users voicemail PBXUser.UnconditionalRedirect(true) PBXUser.UnconditionalRedirectNumber("voicemail") If your script should check how the users' redirection is configured, make sure it is placed above the Unconditional Redirection rule in the Call Routing Manager list of rules. Otherwise your script will never be reached if the user has enabled his redirection. Example from the Function Collection IsExternalRedirectionConfigured()
  3. Lua → VBScript SwxWare v13.10 This function sets or returns the state of the users' (for whom the current script is running) own undconditional redirection setting. if (PBXUser.UnconditionalRedirect() == true) then -- do something end -- enable redirection PBXUser.UnconditionalRedirect(true) -- disable redirection PBXUser.UnconditionalRedirect(false) This function takes or returns a boolean value. Please note, that you need to set the number to which should be redirected using the PBXUser.UnconditionalRedirectNumber() function. If your script should check how the user's redirection is configured, make sure it is placed above the Unconditional Redirection rule in the Call Routing Manager list of rules. Otherwise your script will never be reached if the user has enabled his redirection. Example from the Function Collection AnyRedirectionConfigured()
  4. Lua → VBScript SwxWare v13.10 The function sets or gets the script users' login pin of his SwyxPhone of DCF desk phone (e.g. Yealink phone). -- get current pin local sPin = PBXUser.PhonePin() -- set new pin PBXUser.PhonePin("12345") This functions takes or returns a string value. A newly set pin must not contain any characters but just digits, and has a maximum length of 16 digits.
  5. Lua → VBScript SwxWare v13.10 This functions gets or sets the script users parallel call numbers. -- get number local sNumber = PBXUser.ParallelCallNumbers() -- set number PBXUser.ParallelCallNumbers("+491234567890") This function takes or returns a string value. When enabling the script users' parallel call feature with the PBXUser.EnableParallelCall() function, the PBXUser.ParallelCallNumbers() define a semicolon separated list of all numbers that should ring in parallel to the current script users extension. PBXUser.EnableParallelCall(true) PBXUser.ParallelCallNumbers("+49231123456") This can also be configured manually either by the user in his SwyxIt! client or the admin in the SwyWare Administration.
  6. Lua → VBScript SwxWare v13.10 This function sets or returns the current number of received new voicemails of the script user. -- get number of new voicemails local nNumber = PBXUser.NumberOfNewVoicemails() -- set number of new voicemails PBXUser.NumberOfNewVoicemails(5) This property takes or returns a number value. By incrementing this value you can enable the new voicemail indication of the current script user. By setting it to 0 you can disable it. -- switch voicemail indication on PBXUser.NumberOfNewVoicemails(PBXUser.NumberOfNewVoicemails() + 1) -- switch voicemail indication off PBXUser.NumberOfNewVoicemails(0)
  7. Lua → VBScript SwxWare v13.10 This function returns the current date and time of the script user. -- get date/time as string local sDateTime = PBXUser.Now() -- in "%d.%m.%Y %H:%M:%S" format -- get date/time as table local tDateTime = PBXUser.Now("*t") -- .sec : number -- .min : number -- .hour : number -- .day : number -- .month : number -- .year : number -- .wday : number -- .yday : number -- .isdst : boolean This function returns a string or a table value. With no parameter given, this function returns the current date and time in "%d.%m.%Y %H:%M:%S" format. With the string parameter "*t" given, this function returns the current date and time in a table format. This function makes use of the Lua build-in function os.date(). If no parameter is used, this function is identical to the GSE build-in function CurDateTime().
  8. Lua → VBScript SwxWare v13.10 This function returns the name of the current script user. local sName = PBXUser.Name() This function returns a string value. Beside the user name there is also the PBXUser.UserId() used to identify a certain user. If you need to resolve the name or the user id of any SwyxWare user (not only the current script user) you can use the PBXScript.GetUserByAddress() function.
  9. Lua → VBScript SwxWare v13.20 This function returns true if the current script user has an appointment in his Outlook/Exchange calendar stating him to be "out of office". if (PBXUser.IsOutOfOffice() == true) then -- do something end This function returns a boolean value. Please refer to the SwyxWare Administrator manual (chapter 5.3.3, Installation for Calendar-Based Call Management) for information on how to setup calendar based call routing correctly. Beside the "out of office" flag of an appointment you can also check for the "busy" flag by using the PBXUser.IsOutlookBusy() function. This function is identical to the GSE build-in function IsOutOfOffice().
  10. Lua → VBScript SwxWare v13.20 This function returns true if the current script user has an appointment in his Outlook/Exchange calendar stating him to be "busy". if (PBXUser.IsOutlookBusy() == true) then -- do something end This function returns a boolean value. Please refer to the SwyxWare Administrator manual (chapter 5.3.3, Installation for Calendar-Based Call Management) for information on how to setup calendar based call routing correctly. Beside the "busy" flag of an appointment you can also check for the "out of office" flag by using the PBXUser.IsOutOfOffice() function. This function is identical to the GSE build-in function IsOutlookBusy().
  11. Lua → VBScript SwxWare v13.10 This function returns true if the script user is currently logged in into his SwyxWare account. if (PBXUser.IsLoggedIn() == true) then -- do something end This function returns a boolean value. Please note, that the SwyxServer caches the busy state of a user. So once you have called this function the first time in the script it will always return the same value if being called again. If you need to get current status of any user within the SwyxWare, you can use the PBXScript.GetUserByAddress() function. This function is identical to the GSE build-in function IsLoggedIn().
  12. Lua → VBScript SwxWare v13.10 This function returns true if the script user is currently busy. if (PBXUser.IsBusy() == true) then -- do something end This function returns a boolean value. Please note, that the SwyxServer caches the busy state of a user. So once you have called this function the first time in the script it will always return the same value if being called again. If you need to get current status of any user within the SwyxWare, you can use the PBXScript.GetUserByAddress() function. This function is identical to the GSE build-in function IsBusy().
  13. Lua → VBScript SwxWare v13.10 This function sets or returns the current status text of the script user. -- get the script users status text local sStatus = PBXUser.FreeStatusText() -- set the script users status text PBXUser.FreeStatusText("I am out for lunch") This function takes or returns a string value. It is identical to the GSE build-in function IpPbx.UserFreeStatusText(). 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.
  14. Lua → VBScript SwxWare v13.10 This function sets the script users' parallel call feature or returns its current enable status. -- get the status of the script users parallel call feature local bParallel = PBXUser.EnableParallelCall() -- enable the script users parallel call feature PBXUser.EnableParallelCall(true) This function takes or returns a boolean value. When enabling the script users' parallel call feature, you should also configure the PBXUser.ParallelCallNumbers(). (a semicolon separated list of all numbers that should ring in parallel to the current script users extension). PBXUser.EnableParallelCall(true) PBXUser.ParallelCallNumbers("+49231123456") This can also be configured manually either by the user in his SwyxIt! client or the admin in the SwyWare Administration.
  15. Lua SwxWare v13.10 This function returns the current external do not disturb status of the script user. local bExternalDND = PBXUser.DoNotDisturbViaPresence() This function returns a boolean value. This function accesses supported external presence sources (e.g. MS Teams). To access the SwyxWare internal presesence information you can use the PBXUser.DoNotDisturb() function. To access the presence information of any SwyxWare user and not just the current script user, please take a look on the PBXScript.GetUserByAddress() function.
  16. Lua → VBScript SwxWare v13.10 This function sets or returns the do not disturb status of the current script user. -- get the script users' current do not disturb state local bDoNotDisturb = PBXUser.DoNotDisturb() -- set the script users' do not disturb state PBXUser.DoNotDisturb(true) This function takes or returns a boolean value. This property is identical to the GSE build-in property IpPbx.DoNotDisturb(). This function accesses the SwyxWare internal presence information. To access supported external presence sources (e.g. MS Teams) you can use the PBXUser.DoNotDisturbViaPresence() function. To access the presence information of any SwyxWare user and not just the current script user, please take a look on the PBXScript.GetUserByAddress() function.
  17. Lua → VBScript SwxWare v13.10 This function sets or returns the timeout of the script users' (for whom the current script is running) own delayed redirection. if (PBXUser.DelayedRedirectTimeout() == 30) then -- do something end -- configure delayed redirection timeout PBXUser.DelayedRedirectTimeout(30) This property takes or returns a number value. Please note, that you need to enable the delayed redirection using the PBXUser.DelayedRedirect() function. Additionally you can configure the delayed redirection target using the function PBXUser.DelayedRedirectNumber(). -- enable delayed redirection of all calls to users voicemail after 30 seconds PBXUser.DelayedRedirect(true) PBXUser.DelayedRedirectNumber("voicemail") PBXUser.DelayedRedirectTimeout(30) If your script should check how the users' redirection is configured, make sure it is placed above the Delayed Redirection rule in the Call Routing Manager list of rules. Otherwise your script will never be reached if the user has enabled his redirection.
  18. Lua → VBScript SwxWare v13.10 This function set or returns the state of the script users' (for whom the current script is running) own delayed redirection number setting, meaning the target of the redirection if (PBXUser.DelayedRedirectNumber() == "100") then -- do something end -- configure delayed redirection target PBXUser.DelayedRedirectNumber("200") This function takes or returns a string value. Please note, that you need to enable the delayed redirection using the PBXUser.DelayedRedirect() function. Additionally you can configure the timeout (in seconds) for the delayed redirection to take affect using the function PBXUser.DelayedRedirectTimeout(). SwyxServer handles all telephone numbers as string, so don't miss to use " ". You can use either a number, a user name or a group name as value. There is a magic string "voicemail" to redirect calls to the user's voicemail: -- enable delayed redirection of all calls to users voicemail after 30 seconds PBXUser.DelayedRedirect(true) PBXUser.DelayedRedirectNumber("voicemail") PBXUser.DelayedRedirectTimeout(30) If your script should check how the users' redirection is configured, make sure it is placed above the Delayed Redirection rule in the Call Routing Manager list of rules. Otherwise your script will never be reached if the user has enabled his redirection.
  19. Lua → VBScript SwxWare v13.10 This function sets or returns the state of the script users' (for whom the current script is running) own delayed redirection setting. if (PBXUser.DelayedRedirect() == true) then -- do something end -- enable delayed redirection PBXUser.DelayedRedirect(true) -- disable delayed redirection PBXUser.DelayedRedirect(false) This function takes or returns a boolean value. Please note, that you need to set the number to which should be redirected using the PBXUser.DelayedRedirectNumber() function. Additionally you can configure the timeout (in seconds) for the delayed redirection to take affect using the function PBXUser.DelayedRedirectTimeout(). If your script should check how the users' redirection is configured, make sure it is placed above the Delayed Redirection rule in the Call Routing Manager list of rules. Otherwise your script will never be reached if the user has enabled his redirection. Example from the Function Collection AnyRedirectionConfigured()
  20. Lua → VBScript SwxWare v13.10 This function sets or returns the state of the script user's (for whom the current script is running) own busy redirection number, meaning the target of the redirection. if (PBXUser.BusyRedirectNumber() == "100") then -- do something end -- configure on busy redirection target PBXUser.BusyRedirectNumber("200") This function takes or returns a string value. Please note, that you need to enable the on busy redirection using the PBXUser.BusyRedirect() function. SwyxServer handles all telephone numbers as strings, so don't miss to use " ". You can use either a number, a user name or a group name as value. There is a magic string "voicemail" to redirect all calls to the user's voicemail. -- redirect all calls if user is busy to his voicemail PBXUser.BusyRedirect(true) PBXUser.BusyRedirectNumber("voicemail") If your script should check how the user's redirection is configured, make sure it is placed above the on Busy Redirection rule in the Call Routing Manager list of rules. Otherwise your script will never be reached if the user has enabled his redirection.
  21. Lua → VBScript SwxWare v13.10 This function sets or returns the state of the script users' (for whom the current script is running) own busy redirection setting. if (PBXUser.BusyRedirect() == true) then -- do something end -- enable own busy redirection PBXUser.BusyRedirect(true) -- disable own busy redirection PBXUser.BusyRedirect(false) This function takes or returns a boolean value. Please note, that you need to set the number to which should be redirected using the PBXUser.BusyRedirectNumber() function. If your script should check how the users' redirection is configured, make sure it is placed above the Busy Redirection rule in the Call Routing Manager list of rules. Otherwise your script will never be reached if the user has enabled his redirection. Example from the Function Collection AnyRedirectionConfigured()
  22. Lua SwxWare v13.10 This function returns the current external away status of the script user. local bExternalAway = PBXUser.AwayViaPresence() This function returns a boolean value. This function accesses supported external presence sources (e.g. MS Teams). To access the SwyxWare internal presesence information you can use the PBXUser.Away() function. To access the presence information of any SwyxWare user and not just the current script user, please take a look on the PBXScript.GetUserByAddress() function.
  23. Lua → VBScript SwxWare v13.10 This function takes or returns the current away status of the script user. -- get the script users current away state local bAway = PBXUser.Away() -- set the script users away state PBXUser.Away(true) This function takes or returns a boolean value. This function is identical to the GSE build-in function IpPbx.Away(). This function accesses the SwyxWare internal presence information. To access supported external presence sources (e.g. MS Teams) you can use the PBXUser.AwayViaPresence() function. To access the presence information of any SwyxWare user and not just the current script user, please take a look on the PBXScript.GetUserByAddress() function.
  24. Lua → VBScript SwxWare v13.10 This function returns if the current call is disconnected or a given timeout is reached. local nReturn = PBXCall.WaitForDisconnect(nTimeout) This function returns a PBXResult value of PBXSuccess, PBXFailure, PBXTimeout, PBXCallTermNormalCallClearing or PBXCallTermOriginatorDisconnected. Parameter nTimeout Optional. Default: 0 Time in seconds to wait for the call to disconnect. A zero timeout waits infinitely, i.e. until the call is disconnected. If the timeout is reached the function returns with the return value PBXTimeout. This function can be used after a call has been connected to a user to keep the script running until the call is finally disconnected. This might be useful if some sort of work has to be done at that point (releasing used memory, writing call details, a.s.o.). Please refer to PBXCall.ConnectedName() or PBXCall.ConnectedNumber() for another usage example of this function.
  25. Lua SwxWare v13.10 This function returns the number of the user that transferred the call into current call routing script. local sNumber = PBXCall.TransferrerNumber() This function returns a string value. If the call is a direct call and not a transferred call the function returns an empty string. If you are interested in the name of the user who transferred the call you can use the PBXCall.TransferrerName() function.
×
×
  • 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.