<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">hi,</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">in mod_lua for Serving_Configuration ( <span class="yshortcuts" id="lw_1340509000_0" style="outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size: 12px; cursor: pointer; color: rgb(0, 0, 0); background-color: rgb(220, 238, 255); border-bottom-width: 2px; border-bottom-style: dotted; border-bottom-color: rgb(54, 99, 136); "><a rel="nofollow" target="_blank" href="http://wiki.freeswitch.org/wiki/Mod_lua/Serving_Configuration" style="color: rgb(58, 101, 187); outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size:
12px; ">http://wiki.freeswitch.org/wiki/Mod_lua/Serving_Configuration</a> ) </span><span style="font-size: 12pt; ">i have defined the settings as follows:</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span style="font-size: 12pt; ">1-</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span style="font-size: 12pt; "><br></span></div><div><span style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "> </span><font face="'times new roman', 'new york', times, serif"><configuration name="lua.conf" description="LUA Configuration"><br></font></div><div><font face="'times new roman', 'new york', times, serif"> <settings></font></div><div><font face="'times new roman', 'new york', times, serif"><br></font></div><div><font face="'times new roman', 'new york', times, serif"> </font><span
style="font-family: 'times new roman', 'new york', times, serif; "> <param name="xml-handler-script" value="dp.lua"/></span></div><div><font face="'times new roman', 'new york', times, serif"> <param name="xml-handler-bindings" value="directory"/></font></div><div><font face="'times new roman', 'new york', times, serif"> </font></div><div><font face="'times new roman', 'new york', times, serif"> </settings></font></div><div><font face="'times new roman', 'new york', times, serif"></configuration></font></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">2- /usr/local/freeswitch/scripts/dp.lua</div><div><div><font face="'times new roman', 'new york', times, serif">freeswitch.consoleLog("INFO", "SECTION " ..
XML_REQUEST["section"] .. "\n")</font></div><div><font face="'times new roman', 'new york', times, serif">freeswitch.consoleLog("INFO", "TAG_NAME " .. XML_REQUEST["tag_name"] .. "\n")</font></div><div><font face="'times new roman', 'new york', times, serif">freeswitch.consoleLog("INFO", "KEY_NAME " .. XML_REQUEST["key_name"] .. "\n")</font></div><div><font face="'times new roman', 'new york', times, serif">freeswitch.consoleLog("INFO", "KEY_VALUE " .. XML_REQUEST["key_value"] .. "\n")</font></div><div><font face="'times new roman', 'new york', times, serif"><br></font></div><div><font face="'times new roman', 'new york', times, serif">freeswitch.consoleLog("INFO",params:serialize())</font></div><div><font face="'times new roman', 'new york', times, serif">io.write("TEST \n" .. params:serialize("xml") .. "\n");</font></div><div><font face="'times new roman', 'new york', times, serif">--io.write("SIP_AUTH_METHOD\n" ..
params:getHeader("sip_auth_method") .. "\n");</font></div><div><font face="'times new roman', 'new york', times, serif">--io.write("sip_profile\n" .. params:getHeader("sip_profile") .. "\n");</font></div><div><font face="'times new roman', 'new york', times, serif">local sipprofile = params:getHeader("sip_profile");</font></div><div><font face="'times new roman', 'new york', times, serif">print ("sip profile is:" .. sipprofile);</font></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">3- the output of the above lua file is :</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size:
12pt; "><br></div><div><div><font face="'times new roman', 'new york', times, serif"><div>TEST</div><div><event></div><div> <headers></div><div> <Event-Name>REQUEST_PARAMS</Event-Name></div><div> <Core-UUID>1d640ebe-be01-11e1-b2cd-4109894802cc</Core-UUID></div><div> <FreeSWITCH-Hostname>PBX</FreeSWITCH-Hostname></div><div> <FreeSWITCH-Switchname>PBX</FreeSWITCH-Switchname></div><div> <FreeSWITCH-IPv4>192.168.10.89</FreeSWITCH-IPv4></div><div> <FreeSWITCH-IPv6>%3A%3A1</FreeSWITCH-IPv6></div><div> <Event-Date-Local>2012-06-24%2018%3A13%3A48</Event-Date-Local></div><div> <Event-Date-GMT>Sun,%2024%20Jun%202012%2013%3A43%3A48%20GMT</Event-Date-GMT></div><div>
<Event-Date-Timestamp>1340545428075826</Event-Date-Timestamp></div><div> <Event-Calling-File>sofia_reg.c</Event-Calling-File></div><div> <Event-Calling-Function>sofia_reg_parse_auth</Event-Calling-Function></div><div> <Event-Calling-Line-Number>2364</Event-Calling-Line-Number></div><div> <Event-Sequence>1240</Event-Sequence></div><div> <action>sip_auth</action></div><div> <sip_profile>internal</sip_profile></div><div> <sip_user_agent>eyeBeam%20release%201102q%20stamp%2051814</sip_user_agent></div><div> <sip_auth_username>1000</sip_auth_username></div><div> <sip_auth_realm>192.168.10.89</sip_auth_realm></div><div>
<sip_auth_nonce>5fef3276-be02-11e1-b2fd-4109894802cc</sip_auth_nonce></div><div> <sip_auth_uri>sip%3A192.168.10.89</sip_auth_uri></div><div> <sip_contact_user>1000</sip_contact_user></div><div> <sip_contact_host>192.168.18.120</sip_contact_host></div><div> <sip_to_user>1000</sip_to_user></div><div> <sip_to_host>192.168.10.89</sip_to_host></div><div> <sip_from_user>1000</sip_from_user></div><div> <sip_from_host>192.168.10.89</sip_from_host></div><div> <sip_request_host>192.168.10.89</sip_request_host></div><div> <sip_auth_qop>auth</sip_auth_qop></div><div> <sip_auth_cnonce>8725f832cb29a466ba073ef5d63de959</sip_auth_cnonce></div><div>
<sip_auth_nc>00000010</sip_auth_nc></div><div> <sip_auth_response>ee0155cd5b41536e56898ff585502e75</sip_auth_response></div><div> <sip_auth_method>REGISTER</sip_auth_method></div><div> <key>id</key></div><div> <user>1000</user></div><div> <domain>192.168.10.89</domain></div><div> <ip>192.168.18.120</ip></div><div> </headers></div><div></event></div><div><br></div><div>sip profile is :internal<br></div><div>---------------------------------------------------</div><div><br></div><div>Now i am going to check using reltime every user that registers on sip phone -like 3CXphone - instead of in-memory method (flat file on freeswitch), now </div><div>what is the next step for implementing? <br></div><div>Now need to define mysql and insert query in lua
script and compare the query with the value of params:getHeader ?</div><div>the resource for mod_lua serving configuration is a bit<br></div><div><br></div><div>plz help, </div><div>thanks so much</div><div><br></div></font></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div></div></div></body></html>