Lua SwxWare v13.10
This helper function returns the length of a given string.
local nLength = StringLen(str)
This function returns a number value.
Examples:
local nLength = StringLen("Erika Mustermann") PBXScript.OutputTrace("nLength = " .. tostring(nLength)) --> nLength = 16
local tConfig = nil local sPublicLineAccess = "" tConfig = PBXScript.GetPBXConfig() sPublicLineAccess = tConfig.publicaccessprefix PBXScript.OutputTrace ("Configured public line access: " .. sPublicLineAccess) -- check forwarding if (PBXUser.UnconditionalRedirect()) then PBXScript.OutputTrace ("Unconditional call forwarding configured to " .. PBXUser.UnconditionalRedirectNumber()) if (StringLeft(PBXUser.UnconditionalRedirectNumber(), StringLen(sPublicLineAccess)) == sPublicLineAccess) then PBXScript.OutputTrace ("External call forwarding configured") bReturn = true else PBXScript.OutputTrace ("Internal call forwarding configured") end else PBXScript.OutputTrace ("No unconditional call forwarding configured") end
By Tom Wellige