Reputation: 31
Not able keep control in lua script after
session:execute("conference", conf_name);
All the below commands are not able to get executed.
originate {}dialstring &test.lua
test.lua
api = freeswitch.API()
freeswitch.consoleLog("DEBUG", "test1")
session:execute("conference", "test_conf");
freeswitch.consoleLog("DEBUG", "test2")
test2 is not printed in consolelog
Upvotes: 2
Views: 1139
Reputation: 31
yes the control of the script is lost after the session got transferred ton conference.
Logically we can initiate a call from conference itself by
conference dial
Upvotes: 0
Reputation: 891
Posting my answer from the freeswitch mailing list: Question, answer 1, additional information 2.
To the best of my understanding, when you call session:execute
it's a synchronous operation. The Lua script will keep running, waiting for that execute
to finish.
If you would kick the user out of the conference, the lua script would continue where it left off.
(If you would hangup on the user or transfer them, the session would be over and the script may do it's best to continue, but with no active session.)
Alternatives: Depending on what you want to accomplish, you can first schedule a task before the conference. Or call the lua script only for some things and process the rest in the dialplan. When you need, kick it back to another lua script for further processing.
Brian posted one additional piece of information:
It won't continue the lua unless hangup_after_conference=false
. but you
are correct, the script is executing the conference, it stopped there.
Upvotes: 1