Jump to content
  • StringLeft()


    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.





    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
            PBXScript.OutputTrace ("Internal call forwarding configured")
        PBXScript.OutputTrace ("No unconditional call forwarding configured")



    Tom Wellige


  • 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.