<div dir="ltr">Dialplan is parsed in a hunting and execution phase. First it collects the list of actions to run, then it executes them.<div><br></div><div>In your script you're calling the lua script "inline" which means it executes during the hunting phase. If you aren't settingĀ <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">effective_caller_id_na<wbr>me until the execution phase then the lua script will run first.</span></div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">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Ā <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">effective_caller_id_name inline as well.</span></span></div><div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 10 May 2018 at 17:11, Jim Lynch <span dir="ltr"><<a href="mailto:jim@k4gvo.com" target="_blank">jim@k4gvo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>I am calling cidlookup in my dial plan like this:</p>
    <p><action application="set" data="effective_caller_id_numb<wbr>er=$1"
      inline="true"/></p>
    <p>And in my log I see:</p>
    <p>a6a3d389-245d-4705-9a1e-91d74d<wbr>491dd1 Dialplan:
      <a class="m_1582054866024240648m_-1386254682669867497moz-txt-link-abbreviated" href="mailto:sofia/external/+12297960236@4.59.156.121:5060" target="_blank">sofia/external/+12297960236@4.<wbr>59.156.121:5060</a> Action
      set(effective_caller_id_name=$<wbr>{cidlookup(${caller_id_number}<wbr>)}) <br>
    </p>
    <p>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.</p>
    <pre><font size="-1">a6a3d389-245d-4705-9a1e-91d74d<wbr>491dd1 Dialplan: <a class="m_1582054866024240648m_-1386254682669867497moz-txt-link-abbreviated" href="mailto:sofia/external/+12297960236@4.59.156.121:5060" target="_blank">sofia/external/+12297960236@4.<wbr>59.156.121:5060</a> Action info()
a6a3d389-245d-4705-9a1e-91d74d<wbr>491dd1 Dialplan: <a class="m_1582054866024240648m_-1386254682669867497moz-txt-link-abbreviated" href="mailto:sofia/external/+12297960236@4.59.156.121:5060" target="_blank">sofia/external/+12297960236@4.<wbr>59.156.121:5060</a> Action lua(cid.lua ${caller_id_number} ${effective_caller_id_name}) INLINE
a6a3d389-245d-4705-9a1e-91d74d<wbr>491dd1 EXECUTE <a class="m_1582054866024240648m_-1386254682669867497moz-txt-link-abbreviated" href="mailto:sofia/external/+12297960236@4.59.156.121:5060" target="_blank">sofia/external/+12297960236@4.<wbr>59.156.121:5060</a> lua(cid.lua +12297960236 )
2018-05-09 20:28:02.349228 [DEBUG] freeswitch_lua.cpp:365 DBH handle 0x7fefd0092e70 Connected.
a6a3d389-245d-4705-9a1e-91d74d<wbr>491dd1 2018-05-09 20:28:02.349228 [DEBUG] switch_cpp.cpp:745 CoreSession::setVariable(effec<wbr>tive_caller_id_name, ALL LOCATION CZ)

</font></pre>
    <font size="-1">How can I get the data into my lua script?<br>
      <br>
      Thanks,<br>
      Jim.<br>
    </font>
  </div>

<br>______________________________<wbr>______________________________<wbr>_____________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions<wbr>.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.o<wbr>rg</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswi<wbr>tch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/ma<wbr>ilman/listinfo/freeswitch-user<wbr>s</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.frees<wbr>witch.org/mailman/options/<wbr>freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div></div>