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