<div dir="ltr"><div><div><div>The user directory is now being generated via the DB using the Lua script.  I just needed to analyse the Lua script, and after playing around with it and checking the logs of the database I figured it out.<br>
<br></div>The example Lua script on the site had many fields, when they returned a nil value it looks to have broke the script.  I have since removed some features from the resulting XML and it works fine.<br><br></div>I also decided to buy the book on Lua and learn more about this powerful programming language<br>
<br><br><br></div>Thank you everyone for your help :)  <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 18, 2014 at 3:46 PM, Chris Tunbridge <span dir="ltr">&lt;<a href="mailto:blasterjr@gmail.com" target="_blank">blasterjr@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">After re-reading your message (and actually paying attention to the log line) can you go into more detail on your configuration?<br>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 18, 2014 at 1:45 PM, Chris Tunbridge <span dir="ltr">&lt;<a href="mailto:blasterjr@gmail.com" target="_blank">blasterjr@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>@<span>cmrienzo -  I don&#39;t think this is the case, as params should
 be defined by FreeSWITCH when called as a lua directory. (Currently 
using LUA to generate my own directory)<br></span></div>
<span><br>joelewhite <br><br>Are you trying to run that script from the command 
line to test it?  If so, params will not be set, make sure you have your
 conf/autoload_configs/lua.xml setup.<br><br>&lt;param name=&quot;xml-handler-script&quot; value=&quot;directory/generate.lua&quot;/&gt;<br>&lt;param name=&quot;xml-handler-bindings&quot; value=&quot;directory&quot;/&gt;<br>



<br></span></div><div><span>Maybe go into more detail about what you&#39;re currently doing/have configured.<br></span></div><div><span><br></span></div><span></span></div><div><div><div class="gmail_extra">

<br><br><div class="gmail_quote">
On Mon, Aug 18, 2014 at 8:53 AM, Christopher Rienzo <span dir="ltr">&lt;<a href="mailto:cmrienzo@gmail.com" target="_blank">cmrienzo@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div dir="ltr">This is an error in your lua script.  On line 5 you must have some code like &quot;params.foo&quot; or &quot;params[foo]&quot; where params is a nil value.  Check why params is nil and fix it if it isn&#39;t supposed to be.  Otherwise add a check to handle the nil case.<br>




<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Mon, Aug 18, 2014 at 9:10 AM, Joel White <span dir="ltr">&lt;<a href="mailto:joelewhite@gmail.com" target="_blank">joelewhite@gmail.com</a>&gt;</span> wrote:<br>




</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div><div><div>I am trying to get Lua generation of the Directory so I can also tie this in with auto provisioning.<br>




<br></div>I have created the table in the Postgres DB and have the lua script specified in the lua module config<br>
<br><br></div>But I keep getting this error<br><br><br>2014-08-18 13:07:11.869818 [ERR] mod_lua.cpp:203 /usr/local/freeswitch/scripts/gen_dir_user_xml.lua:5: attempt to index global &#39;params&#39; (a nil value)<br><br>




<br>
<br></div>I am sure after playing with it for a while I will get everything working properly, but would anyone have some information to point me in the right direction?<br><br></div>Thank you in advance<br><br><br></div>





<br></div></div>_________________________________________________________________________<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" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>
<br>_________________________________________________________________________<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" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>