<div dir="ltr"><div><div><div><div>Hi Michael,<br><br></div>Thanks very much for your help,<br><br></div>Now I have my FS up &amp; running with a directory working via LUA scripting.<br><br><br></div>Thanks<br></div>Jaime<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 23, 2015 at 12:14 PM, Michael Jerris <span dir="ltr">&lt;<a href="mailto:mike@jerris.com" target="_blank">mike@jerris.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">also check what code you are running.  There was a bug with this in master last week that has been fixed.<div class="HOEnZb"><div class="h5"><span></span><br><br>On Tuesday, June 23, 2015, Roman Dissauer &lt;<a href="mailto:roman@dissauer.net" target="_blank">roman@dissauer.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">first did you restart freeswitch after configuring lua xml_handler?<div>If yes, check the debug string in fs_cli created by the lua script:</div><div><br></div><div>„ Debug from catch-event-directory, generated XML: …“</div><div><br></div><div>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&quot;</div><div><br><div><blockquote type="cite"><div>Am 23.06.2015 um 06:28 schrieb Jaime Cruz &lt;<a>jaimecm@gmail.com</a>&gt;:</div><br><div><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" target="_blank">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>600300@voip.hablaip.com</a>] from X.X.X.X<br>You must define a domain called &#39;<a href="http://test.com/" target="_blank">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>
_________________________________________________________________________<br>Professional FreeSWITCH Consulting Services: <br><a>consulting@freeswitch.org</a><br><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br><br>Official FreeSWITCH Sites<br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br><a href="http://confluence.freeswitch.org" target="_blank">http://confluence.freeswitch.org</a><br><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br><br>FreeSWITCH-users mailing list<br><a>FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></div></blockquote></div><br></div></div></blockquote>
</div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" rel="noreferrer" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://confluence.freeswitch.org" rel="noreferrer" target="_blank">http://confluence.freeswitch.org</a><br>
<a href="http://www.cluecon.com" rel="noreferrer" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" rel="noreferrer" target="_blank">http://www.freeswitch.org</a><br></blockquote></div><br></div>