On Mon, Jan 11, 2010 at 2:53 PM, Mike van Lammeren <mike@van.lammeren.net>wrote:
Hello!
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.
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.
Is this possible with FreeSWITCH? Or can only dialplan information be provided dynamically?
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:
<groups> <group name="default"> <users> <param name="xml-handler-script" value="/directory.lua"/> <param name="xml-handler-bindings" value="users"/> </users> </groups>
Is this the right approach? Am I going about this the right way?
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. ( http://telecommusings.blogspot.com/) 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. -MC