[Freeswitch-users] Extract Channel Variables inline When using Lua script

Jonathan Hunter jhunter at voxboxcoms.co.uk
Mon Sep 14 23:56:42 MSD 2015


Hi Guys,

Sorry for the post here but I just wanted to check if this was possible.

I am using one large  .lua script, and Im setting up channel variables
before the call is connected, so for example I am setting in line;


table.insert(xml, [[<action application="set" data="closedop=voicemail"
inline="true"/>]]);
table.insert(xml, [[<action application="set" data="closedopact=2000"
inline="true"/>]]);


This then terminates on a dialplan, where I would like to use the value of
closedop and closedopact as an anti-action;


<anti-action application="]]..closedop..[[" data="default
]]..h.Customer_Domain..[[ ]]..closedopact..[["/>



I can see in the logs the value is set;

Action set(closedop=voicemail) INLINE
EXECUTE sofia/internal/07917190439 at 62.239.9.74 set(closedop=voicemail)
2015-09-14 20:41:47.828526 [DEBUG] mod_dptools.c:1435 sofia/internal/
07917190438 at 62.239.9.74 *SET [closedop]=[voicemail]*
Dialplan: sofia/internal/07917190439 at 62.239.9.74 Action
set(closedopact=2000) INLINE
EXECUTE sofia/internal/07917190439 at 62.239.9.74 set(closedopact=2000)
2015-09-14 20:41:47.828526 [DEBUG] mod_dptools.c:1435 sofia/internal/
07917190438 at 62.239.9.74 *SET [closedopact]=[2000]*

So I want to set the application to voicemail, and the extension to 2000.

How can I extract this? I have tried using ${closedop}, and
session:getvariables, however this is only suitable when session
established I believe?

Plus I'm doing this inline, so setting variables, then wanting to get them
again before answer.

Can anyone advise?

Thanks

Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150914/8f6ad5bc/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list