[Freeswitch-users] Is cidlookup asynchronous?

Steven Ayre steveayre at gmail.com
Sat May 12 12:31:11 UTC 2018

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
inline as well.

On 10 May 2018 at 17:11, Jim Lynch <jim at 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 at 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 at Action info()
> a6a3d389-245d-4705-9a1e-91d74d491dd1 Dialplan: sofia/external/+12297960236 at Action lua(cid.lua ${caller_id_number} ${effective_caller_id_name}) INLINE
> a6a3d389-245d-4705-9a1e-91d74d491dd1 EXECUTE sofia/external/+12297960236 at 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 at 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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20180512/59ab5a1a/attachment.html>

More information about the FreeSWITCH-users mailing list