Hello! I am now successfully pulling directory information from the database with a Lua script. I based my work on this section of the wiki: http://wiki.freeswitch.org/wiki/Mod_lua#For_serving_configuration 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! 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! Mike van Lammeren <http://wiki.freeswitch.org/wiki/Mod_lua#For_serving_configuration> On Tue, Jan 12, 2010 at 11:50 AM, Mike van Lammeren <mike@van.lammeren.net>wrote:
Hi Michael!
I've had a look at your blog. Good stuff!
Thanks!
On Mon, Jan 11, 2010 at 7:36 PM, Michael Collins <msc@freeswitch.org>wrote:
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
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org