I haven&#39;t looked too closely at this, but had a couple of comments having done a bunch of the work on mod_lcr.<br><br>1) Using %q is fragile for custom sql.  If the user puts too many in there mprintf is gonna have fits.  You might want to look at using a (temp) event, setting vars on it, and then using the var expansion support instead.  So, instead of %q, you would use ${varname}.  This also makes things more flexible as you go forward in your development.  You can see how it is in done in mod_lcr.  <br>
<br>2) On the sql, I hope the final won&#39;t allow NULL in all fields.  Some of those look like auto-increment primary keys which can&#39;t be null.  Others shouldn&#39;t be null (would it make sense to have a null name?).<br>
<br>I haven&#39;t had a chance to look at the patch.  Any chance you can put it in the jira as a diff with a .txt extension?  Easier to review that way rather than a tgz.<br><br><div class="gmail_quote">On Thu, Jun 18, 2009 at 4:48 AM, Leon de Rooij <span dir="ltr">&lt;<a href="mailto:leon@scarlet-internet.nl">leon@scarlet-internet.nl</a>&gt;</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;">Hi all,<br>
<br>
I&#39;d like to generate user directory xml directly in FS to bypass http<br>
+php (or other scripting language) entirely. So I started writing a<br>
module to do just that. It&#39;s still rough - I don&#39;t code c very often -<br>
but it works.<br>
<br>
<a href="http://jira.freeswitch.org/browse/XML-3" target="_blank">http://jira.freeswitch.org/browse/XML-3</a><br>
<br>
Currently all queries are statically defined in the module so users<br>
cannot deviate from the sql schema. Bkw suggested to have a look at<br>
mod_lcr which look really cool, though I&#39;m not really sure yet how to<br>
get the same behavior in this module.<br>
<br>
The sql schema (without indexes for readability) currently looks like<br>
this:<br>
<br>
<a href="http://pastebin.freeswitch.org/9427" target="_blank">http://pastebin.freeswitch.org/9427</a><br>
<br>
In the module, I&#39;m doing 7 queries:<br>
<br>
Q1: Get domain_id and user_id<br>
Q2: Get domain_params<br>
Q3: Get domain_variables<br>
Q4: Get user_attrs<br>
Q5: Get user_params<br>
Q6: Get user_variables<br>
Q7: Get groups<br>
<br>
Where Q2-Q6 should return a list of name/value pairs.<br>
<br>
To make things more configurable by the user of the module, I could<br>
place all queries in the configuration file, like this:<br>
<br>
<a href="http://pastebin.freeswitch.org/9426" target="_blank">http://pastebin.freeswitch.org/9426</a><br>
<br>
Do you think that would be acceptable ?<br>
<br>
Then I&#39;d remove all code that automatically generates tables (which<br>
would make the code a lot cleaner and I won&#39;t need to find out how to<br>
set auto_increment as it&#39;s different for each database).<br>
<br>
Are there any other things I should think about ?<br>
<br>
Do you think this module could be accepted in FS ? :-)<br>
<br>
Thanks for the input !<br>
<br>
Kind regards,<br>
<br>
Leon<br>
<br>
_______________________________________________<br>
Freeswitch-dev mailing list<br>
<a href="mailto:Freeswitch-dev@lists.freeswitch.org">Freeswitch-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>-Rupa<br>