Jump to content
  • StringLen()

    StringLen()

    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

     

     

     


    Tom Wellige
     Share


     Share




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