<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 <<a href="mailto:jaimecm@gmail.com" class="">jaimecm@gmail.com</a>>:</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=""> <param name="xml-handler-script" value="catch-event-directory.lua"/><br class=""> <param name="xml-handler-bindings" value="directory"/><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=""> 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 = 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=""> local password="some password"<br class=""></div><div class=""> XML_STRING =<br class=""> [[<?xml version="1.0" encoding="UTF-8" standalone="no"?><br class=""> <document type="freeswitch/xml"><br class=""> <section name="directory"><br class=""> <domain name="]] .. req_domain .. [["><br class=""> <user id="]] .. req_user .. [["><br class=""> <params><br class=""> <param name="password" value="]] .. password .. [["/><br class=""> <param name="dial-string" value="{sip_invite_domain=${domain_name},presence_id=${dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/><br class=""> </params><br class=""> <variables><br class=""> <variable name="user_context" value="]] .. req_context .. [["/><br class=""> <variable name="limit_max" value="10"/><br class=""> </variables><br class=""> </user><br class=""> </domain><br class=""> </section><br class=""> </document>]]<br class=""> -- comment the following line for production:<br class=""> 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>