When I try to use lua to originate a call, I get this:

 

freeswitch@internal> lua test_originate.lua

-ERR encountered

 

freeswitch@internal> 2011-04-12 13:03:17.806648 [ERR] mod_lua.cpp:191 Error in originate expected 4.

.4 args, got 3

stack traceback:

        [C]: in function 'originate'

        /usr/local/freeswitch/scripts/test_originate.lua:3: in main chunk

 

I’m using the following line of code:

 

local new_session = freeswitch.Session();

new_session.originate(session, "sofia/gateway/mygatewayname/mynumber", 60);

 

This is in the Wiki:

session:originate

local new_session = freeswitch.Session();

new_session.originate(session, dest[, timeout]);

dest - quoted dialplan destanation. For example: "sofia/internal/1000@10.0.0.1" or "sofia/gateway/my_sip_provider/my_dest_number"
timeout - origination timeout in seconds

Note: in recent git versions, session.originate expects 4 arguments; the example above does not work (anymore?).

What is the 4th arg?

 

 

-----------------------

Eric Z. Beard, CTO

Loop LLC

w (877) 850-2010 x9249

m (727) 776-2768

eric@loopfx.com