<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">first did you restart freeswitch after configuring lua xml_handler?<div class="">If yes, check the debug string in fs_cli created by the lua script:</div><div class=""><br class=""></div><div class="">„ Debug from catch-event-directory, generated XML: …“</div><div class=""><br class=""></div><div class="">If you don’t find this string in you console, lua xml_handler is not configured properly. If you find this debug string check if there is your user id=„600300"</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 23.06.2015 um 06:28 schrieb Jaime Cruz &lt;<a href="mailto:jaimecm@gmail.com" class="">jaimecm@gmail.com</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi all,<br class=""><br class=""></div><div class="">I'm working to configure Freeswith directory users on the fly using<br class=""></div><div class="">the xml-handler-script option in the autoload_configs/lua.conf.xml configuration file<br class=""></div><div class="">using the followin option:<br class="">&nbsp;&nbsp;&nbsp; &lt;param name="xml-handler-script" value="catch-event-directory.lua"/&gt;<br class="">&nbsp;&nbsp;&nbsp; &lt;param name="xml-handler-bindings" value="directory"/&gt;<br class=""></div><div class="">as explain in the following url: <a href="https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh" class="">https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh</a><br class=""></div><div class=""><br class="">But I'm get the following error:<br class="">&nbsp;&nbsp; 2015-06-23 01:09:23.717880 [WARNING] sofia_reg.c:2827 Can't find user [<a href="mailto:600300@voip.hablaip.com" class="">600300@voip.hablaip.com</a>] from X.X.X.X<br class="">You must define a domain called '<a href="http://test.com/" class="">test.com</a>' in your directory and add a user with the id="600300" attribute<br class="">and you must configure your device to use the proper domain in it's authentication credentials.<br class=""><br class=""></div><div class="">Also with a local created user in xml files the FS autenticate fine, but with a user created by the directory handler script it fail.<br class=""><br class=""></div><div class="">Any help will be apreciated.<br class=""><br class="">The FS version is 1.4.19~64bit running on Centos 6.6,<br class=""><br class=""></div><div class="">and here is the very simple lua script: catch-event-directory.lua that returns the XML_STRING variable:<br class=""></div><div class="">==================================================================<br class="">local v_section = XML_REQUEST["section"] or ""<br class="">local v_tag_name = XML_REQUEST["tag_name"] or ""<br class="">local req_domain = params:getHeader("domain") or ""<br class="">local req_user&nbsp;&nbsp; = params:getHeader("user") or ""<br class="">local req_context= params:getHeader("variable_user_context") or ""<br class=""><br class="">if (v_section == "directory" and v_tag_name=="domain" and (req_domain) and (req_user)) then<br class=""></div><div class="">&nbsp;&nbsp; local password="some password"<br class=""></div><div class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; XML_STRING =<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [[&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;document type="freeswitch/xml"&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;section name="directory"&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;domain name="]] .. req_domain .. [["&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;user id="]] .. req_user .. [["&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;params&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="password" value="]] .. password .. [["/&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;param name="dial-string" value="{sip_invite_domain=${domain_name},presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/params&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;variables&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;variable name="user_context" value="]] .. req_context .. [["/&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;variable name="limit_max" value="10"/&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/variables&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/user&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/domain&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/section&gt;<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/document&gt;]]<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- comment the following line for production:<br class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; freeswitch.consoleLog("notice", "Debug from catch-event-directory, generated XML:\n" .. XML_STRING .. "\n")<br class=""></div><div class="">end<br class=""></div><div class=""><br class=""><br class=""></div><div class="">Thanks in advance.<br class=""></div><div class="">Jaime<br class=""></div></div>
_________________________________________________________________________<br class="">Professional FreeSWITCH Consulting Services: <br class=""><a href="mailto:consulting@freeswitch.org" class="">consulting@freeswitch.org</a><br class="">http://www.freeswitchsolutions.com<br class=""><br class="">Official FreeSWITCH Sites<br class="">http://www.freeswitch.org<br class="">http://confluence.freeswitch.org<br class="">http://www.cluecon.com<br class=""><br class="">FreeSWITCH-users mailing list<br class="">FreeSWITCH-users@lists.freeswitch.org<br class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br class="">UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br class="">http://www.freeswitch.org</div></blockquote></div><br class=""></div></body></html>