Lua SwxWare v13.10
This helper function returns the given number of characters from the left side of the given string.
local sLeft = StringLeft(str, len)
This function returns a string value.
Examples:
local sLeft = StringLeft("Erika Mustermann", 5) PBXScript.OutputTrace("sLeft = " .. sLeft) --> sLeft = Erika
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