Dialplan is parsed in a hunting and execution phase. First it collects the list of actions to run, then it executes them.

In your script you're calling the lua script "inline" which means it executes during the hunting phase. If you aren't settingĀ effective_caller_id_name until the execution phase then the lua script will run first.

I suggest avoiding inline unless you actually require it so the logic is easier to follow. If you do need to run that inline then setĀ effective_caller_id_name inline as well.




On 10 May 2018 at 17:11, Jim Lynch <jim@k4gvo.com> wrote:

I am calling cidlookup in my dial plan like this:

<action application="set" data="effective_caller_id_number=$1" inline="true"/>

And in my log I see:

a6a3d389-245d-4705-9a1e-91d74d491dd1 Dialplan: sofia/external/+12297960236@4.59.156.121:5060 Action set(effective_caller_id_name=${cidlookup(${caller_id_number})})

I'm trying to use it in an lua script that is called right after the above action line but the log seems to indicate that it doesn't actually get executed until some time later.

a6a3d389-245d-4705-9a1e-91d74d491dd1 Dialplan: sofia/external/+12297960236@4.59.156.121:5060 Action info()
a6a3d389-245d-4705-9a1e-91d74d491dd1 Dialplan: sofia/external/+12297960236@4.59.156.121:5060 Action lua(cid.lua ${caller_id_number} ${effective_caller_id_name}) INLINE
a6a3d389-245d-4705-9a1e-91d74d491dd1 EXECUTE sofia/external/+12297960236@4.59.156.121:5060 lua(cid.lua +12297960236 )
2018-05-09 20:28:02.349228 [DEBUG] freeswitch_lua.cpp:365 DBH handle 0x7fefd0092e70 Connected.
a6a3d389-245d-4705-9a1e-91d74d491dd1 2018-05-09 20:28:02.349228 [DEBUG] switch_cpp.cpp:745 CoreSession::setVariable(effective_caller_id_name, ALL LOCATION CZ)

How can I get the data into my lua script?

Thanks,
Jim.

_________________________________________________________________________
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