<div dir="ltr"><div>Hi all,<br><br></div><div>I&#39;m working to configure Freeswith directory users on the fly using<br></div><div>the xml-handler-script option in the autoload_configs/lua.conf.xml configuration file<br></div><div>using the followin option:<br>    &lt;param name=&quot;xml-handler-script&quot; value=&quot;catch-event-directory.lua&quot;/&gt;<br>    &lt;param name=&quot;xml-handler-bindings&quot; value=&quot;directory&quot;/&gt;<br></div><div>as explain in the following url: <a href="https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh">https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh</a><br></div><div><br>But I&#39;m get the following error:<br>   2015-06-23 01:09:23.717880 [WARNING] sofia_reg.c:2827 Can&#39;t find user [<a href="mailto:600300@voip.hablaip.com">600300@voip.hablaip.com</a>] from X.X.X.X<br>You must define a domain called &#39;<a href="http://test.com">test.com</a>&#39; in your directory and add a user with the id=&quot;600300&quot; attribute<br>and you must configure your device to use the proper domain in it&#39;s authentication credentials.<br><br></div><div>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><br></div><div>Any help will be apreciated.<br><br>The FS version is 1.4.19~64bit running on Centos 6.6,<br><br></div><div>and here is the very simple lua script: catch-event-directory.lua that returns the XML_STRING variable:<br></div><div>==================================================================<br>local v_section = XML_REQUEST[&quot;section&quot;] or &quot;&quot;<br>local v_tag_name = XML_REQUEST[&quot;tag_name&quot;] or &quot;&quot;<br>local req_domain = params:getHeader(&quot;domain&quot;) or &quot;&quot;<br>local req_user   = params:getHeader(&quot;user&quot;) or &quot;&quot;<br>local req_context= params:getHeader(&quot;variable_user_context&quot;) or &quot;&quot;<br><br>if (v_section == &quot;directory&quot; and v_tag_name==&quot;domain&quot; and (req_domain) and (req_user)) then<br></div><div>   local password=&quot;some password&quot;<br></div><div>          XML_STRING =<br>        [[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;<br>        &lt;document type=&quot;freeswitch/xml&quot;&gt;<br>          &lt;section name=&quot;directory&quot;&gt;<br>            &lt;domain name=&quot;]] .. req_domain .. [[&quot;&gt;<br>              &lt;user id=&quot;]] .. req_user .. [[&quot;&gt;<br>                &lt;params&gt;<br>                  &lt;param name=&quot;password&quot; value=&quot;]] .. password .. [[&quot;/&gt;<br>                  &lt;param name=&quot;dial-string&quot; value=&quot;{sip_invite_domain=${domain_name},presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}&quot;/&gt;<br>                &lt;/params&gt;<br>                &lt;variables&gt;<br>                  &lt;variable name=&quot;user_context&quot; value=&quot;]] .. req_context .. [[&quot;/&gt;<br>                  &lt;variable name=&quot;limit_max&quot; value=&quot;10&quot;/&gt;<br>                &lt;/variables&gt;<br>              &lt;/user&gt;<br>            &lt;/domain&gt;<br>          &lt;/section&gt;<br>        &lt;/document&gt;]]<br>        -- comment the following line for production:<br>        freeswitch.consoleLog(&quot;notice&quot;, &quot;Debug from catch-event-directory, generated XML:\n&quot; .. XML_STRING .. &quot;\n&quot;)<br></div><div>end<br></div><div><br><br></div><div>Thanks in advance.<br></div><div>Jaime<br></div></div>