[Freeswitch-users] Questio about directory via xml-handler-script
Michael Jerris
mike at jerris.com
Tue Jun 23 19:14:08 MSD 2015
also check what code you are running. There was a bug with this in master
last week that has been fixed.
On Tuesday, June 23, 2015, Roman Dissauer <roman at dissauer.net> wrote:
> first did you restart freeswitch after configuring lua xml_handler?
> If yes, check the debug string in fs_cli created by the lua script:
>
> „ Debug from catch-event-directory, generated XML: …“
>
> 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"
>
> Am 23.06.2015 um 06:28 schrieb Jaime Cruz <jaimecm at gmail.com
> <javascript:_e(%7B%7D,'cvml','jaimecm at gmail.com');>>:
>
> Hi all,
>
> I'm working to configure Freeswith directory users on the fly using
> the xml-handler-script option in the autoload_configs/lua.conf.xml
> configuration file
> using the followin option:
> <param name="xml-handler-script" value="catch-event-directory.lua"/>
> <param name="xml-handler-bindings" value="directory"/>
> as explain in the following url:
> https://wiki.freeswitch.org/wiki/Lua_freeswitch_dbh
>
> But I'm get the following error:
> 2015-06-23 01:09:23.717880 [WARNING] sofia_reg.c:2827 Can't find user [
> 600300 at voip.hablaip.com
> <javascript:_e(%7B%7D,'cvml','600300 at voip.hablaip.com');>] from X.X.X.X
> You must define a domain called 'test.com' in your directory and add a
> user with the id="600300" attribute
> and you must configure your device to use the proper domain in it's
> authentication credentials.
>
> 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.
>
> Any help will be apreciated.
>
> The FS version is 1.4.19~64bit running on Centos 6.6,
>
> and here is the very simple lua script: catch-event-directory.lua that
> returns the XML_STRING variable:
> ==================================================================
> local v_section = XML_REQUEST["section"] or ""
> local v_tag_name = XML_REQUEST["tag_name"] or ""
> local req_domain = params:getHeader("domain") or ""
> local req_user = params:getHeader("user") or ""
> local req_context= params:getHeader("variable_user_context") or ""
>
> if (v_section == "directory" and v_tag_name=="domain" and (req_domain) and
> (req_user)) then
> local password="some password"
> XML_STRING =
> [[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <document type="freeswitch/xml">
> <section name="directory">
> <domain name="]] .. req_domain .. [[">
> <user id="]] .. req_user .. [[">
> <params>
> <param name="password" value="]] .. password .. [["/>
> <param name="dial-string"
> value="{sip_invite_domain=${domain_name},presence_id=${dialed_user}@
> ${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/>
> </params>
> <variables>
> <variable name="user_context" value="]] .. req_context
> .. [["/>
> <variable name="limit_max" value="10"/>
> </variables>
> </user>
> </domain>
> </section>
> </document>]]
> -- comment the following line for production:
> freeswitch.consoleLog("notice", "Debug from catch-event-directory,
> generated XML:\n" .. XML_STRING .. "\n")
> end
>
>
> Thanks in advance.
> Jaime
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> <javascript:_e(%7B%7D,'cvml','consulting at freeswitch.org');>
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> <javascript:_e(%7B%7D,'cvml','FreeSWITCH-users at lists.freeswitch.org');>
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20150623/7fb56f1d/attachment.html
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list