Hi, Is it possible to create global object in startup lua script and use it in other lua scripts in dialplan? -- WBR, Eugene Prokopiev
you can store any data in channel variables 2018-04-04 12:53 GMT+03:00 Eugene Prokopiev <enp@itx.ru>:
Hi,
Is it possible to create global object in startup lua script and use it in other lua scripts in dialplan?
-- WBR, Eugene Prokopiev
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Channel variables can be used while call executing, right? So, impossible to share them between calls. I guess global_setvar in startup script and global_getvar in dialplan can helps, but anyway I can store only some value, not reference to some lua object with methods, right? 2018-04-04 17:59 GMT+03:00 Alexandr Popov <alexandr.popov@iqoption.com>:
you can store any data in channel variables
2018-04-04 12:53 GMT+03:00 Eugene Prokopiev <enp@itx.ru>:
Hi,
Is it possible to create global object in startup lua script and use it in other lua scripts in dialplan?
-- WBR, Eugene Prokopiev
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- WBR, Eugene Prokopiev
On Thu, Apr 5, 2018 at 9:39 AM Eugene Prokopiev <enp@itx.ru> wrote:
Channel variables can be used while call executing, right? So, impossible to share them between calls. I guess global_setvar in startup script and global_getvar in dialplan can helps, but anyway I can store only some value, not reference to some lua object with methods, right?
Correct
You could serialize the data as json prior to writing to the channel variable. Dkjson works well in lua for that. Chris
On Apr 5, 2018, at 09:45, Michael Jerris <mike@jerris.com> wrote:
On Thu, Apr 5, 2018 at 9:39 AM Eugene Prokopiev <enp@itx.ru> wrote: Channel variables can be used while call executing, right? So, impossible to share them between calls. I guess global_setvar in startup script and global_getvar in dialplan can helps, but anyway I can store only some value, not reference to some lua object with methods, right?
Correct _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
You can save channel variables and read them back in subsequent scripts. On Wed, Apr 4, 2018 at 5:53 AM, Eugene Prokopiev <enp@itx.ru> wrote:
Hi,
Is it possible to create global object in startup lua script and use it in other lua scripts in dialplan?
-- WBR, Eugene Prokopiev
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (5)
-
Alexandr Popov
-
Christopher Rienzo
-
cmrienzo@gmail.com
-
Eugene Prokopiev
-
Michael Jerris