Hello!<div><br></div><div>I am now successfully pulling directory information from the database with a Lua script.</div><div><br></div><div>I based my work on this section of the wiki:</div><div><a href="http://wiki.freeswitch.org/wiki/Mod_lua#For_serving_configuration">http://wiki.freeswitch.org/wiki/Mod_lua#For_serving_configuration</a></div>
<div><br></div><div>There were a few odd things in the wiki that initially threw me for a loop, and I have since improved the wiki entry linked above. I hope that it will be easier for the next person!</div><div><br></div>
<div>There is definitely a learning curve to FreeSWITCH, but in the end, FreeSWITCH always does the trick! Keep with it, and you will be rewarded!</div><div><br></div><div>Mike van Lammeren</div><div><a href="http://wiki.freeswitch.org/wiki/Mod_lua#For_serving_configuration"></a><br>
<br><div class="gmail_quote">On Tue, Jan 12, 2010 at 11:50 AM, Mike van Lammeren <span dir="ltr"><<a href="mailto:mike@van.lammeren.net">mike@van.lammeren.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Michael!<div><br></div><div>I've had a look at your blog. Good stuff!</div><div><br></div><div>Thanks!<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Mon, Jan 11, 2010 at 7:36 PM, Michael Collins <span dir="ltr"><<a href="mailto:msc@freeswitch.org" target="_blank">msc@freeswitch.org</a>></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><div class="h5"><br><br><div class="gmail_quote"><div><div></div><div>On Mon, Jan 11, 2010 at 2:53 PM, Mike van Lammeren <span dir="ltr"><<a href="mailto:mike@van.lammeren.net" target="_blank">mike@van.lammeren.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Hello!<div><br></div><div>I'd like to be able to have FreeSWITCH check a database for authorization, every time a user registers. There are some great examples on the wiki, which use either MOD_XML_CURL or Lua to dynamically provide a dialplan, but I cannot find an example for providing a directory.</div>
<div><br></div><div>I am developing an application that will have thousands of users, and will run on multiple FreeSWITCH servers behind a load balancer. Ideally, FreeSWITCH would only look-up directory information, specifically, username and password, whenever a user attempts to connect. The directory information will be changing regularly, as users are added or removed from the system.</div>
<div><br></div><div>Is this possible with FreeSWITCH? Or can only dialplan information be provided dynamically?</div><div><br></div><div>I've written a script in Lua that provides the XML data, such as that found in the example /freeswitch/conf/directory/default/ folders, and I try to call it with this bit of XML in /freeswitch/conf/directory/default.xml:</div>
<div><br></div><div><div><div><div><groups></div><div><span style="white-space:pre">        </span><group name="default"></div><div><span style="white-space:pre">        </span><users></div>
<div><span style="white-space:pre">                </span><param name="xml-handler-script" value="/directory.lua"/></div><div><span style="white-space:pre">                </span><param name="xml-handler-bindings" value="users"/></div>
<div><span style="white-space:pre">        </span></users></div><div></groups></div><div><br></div><div>Is this the right approach? Am I going about this the right way?</div></div></div></div></blockquote></div></div>
<div><br>
You can bind "directory" as well as "dialplan" and a few others. I personally don't use xml_curl in production but for kicks I tried to learn it and I documented some of my journey on my personal blog. (<a href="http://telecommusings.blogspot.com/" target="_blank">http://telecommusings.blogspot.com/</a>)<br>
<br>xml_curl was designed to scale and be applied in your type of scenario. Raymond (intralanman on IRC) has played with it quite a bit as have a number of others. <br>-MC<br></div></div><br><br>
<br></div></div>_______________________________________________<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>
<br></blockquote></div><br></div>
</blockquote></div><br></div>