<br><br><div class="gmail_quote">On Mon, Jan 11, 2010 at 2:53 PM, 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="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><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/">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>