Asterisk+lua+gosub

Hello!

I have two extensions in one lua context:

        ["55555"] = function(c ,e)
            app.noop("AAAAAAAAAA")
            app.gosub(c, "test", 1)
            app.noop("ZZZZZZZZZZZZ")
            app.hangup()
        end;

        ["test"] = function(c ,e)
            app.noop("BBBBBBBBBBBB: " .. e)
            app['return']()
        end;

After executing “test” extension it is not returning to extension 55555. Where is the error? I have this lines in console:

    -- Executing [55555@kamailio:1] noop("SIP/siptest-00000007", "AAAAAAAAAA")
    -- Executing [55555@kamailio:1] gosub("SIP/siptest-00000007", "kamailio,test,1")
    -- Executing [test@kamailio:1] noop("SIP/siptest-00000007", "BBBBBBBBBBBB: test")
    -- Executing [test@kamailio:1] return("SIP/siptest-00000007", "")
    -- Auto fallthrough, channel 'SIP/siptest-00000007' status is 'UNKNOWN'

Hardly anyone uses LUA.

The trace looks weird in that I thought that you couldn’t have multiple lines with the same context, extension and priority. That may be a problem in how LUA compiles dialplan, Gosub will try and return to the next priority, which would be priority 2, but all your steps seem to have priority 1.

I’d be surprised if LUA was officially supported.

LUA Is indeed not officially supported, and as you say I don’t know of anyone really using it.