[Freeswitch-users] question about session:setInputCallback

Artyom Chernetzov chernetsov.artyom at gmail.com
Tue Aug 22 21:34:38 UTC 2017


It will work if you define object in global table, then setup argument as
string name of that object, like so:

somethingToPassAsArg={
name="arg";
}

callbackFunction = function(s, type, obj, arg)
freeswitch.consoleLog("debug","hi, i'm "..arg.name);
end

session:setInputCallback("onInputRecognition","somethingToPassAsArg");

object will be available as arg parameter of callbackFunction

Hi,
> >*From what I understand based on the documentation at
> *https://freeswitch.org/confluence/display/FREESWITCH/Lua+API+Reference#LuaAPIReference-session:setInputCallback
> you can pass an arg to the callback function in the second argument of
> session:setInputCallback, however in my callback if I have function
> my_cb(s, type, obj, arg) the value of arg is always nil, does anybody have
> this working or can confirm if the documentation is correct?
> Thanks
>
> Best regards, Artyom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20170823/f1501423/attachment-0001.html>


More information about the FreeSWITCH-users mailing list