Hello Santosh,

It seems that you have not registered the module for app_lua. You can do this by adding the below line.
modparam("app_lua", "register", "sqlops")

and try again.

Thanking You,
Sunil More
Ph : 9503338275

On Tue, Aug 22, 2017 at 6:32 PM, santosh gupta <santosh.gupta.g@gmail.com> wrote:
Hi,

Some more INFO

kamialio.lua

sr.sqlops.query("cb", "select grp from address where id='1'", "result");
sr.sqlops.column("result", index);
sr.sqlops.nrows("result");
sr.sqlops.ncols("result");


kamailio.cfg
modparam("sqlops","sqlcon","cb=>mysql://XXXX:XXXX@localhost/XXXX")


Virus-free. www.avg.com

On Tue, Aug 22, 2017 at 6:18 PM, santosh gupta <santosh.gupta.g@gmail.com> wrote:
Hi Robert,

Hope you are doing good.
You have helped me in the past.

I need to set LCR via app_lua, getting rates and destination from mysql.

Link which i am following is 

The issue is I am not able to get connect via sr commands for example

sr.sqlops.query("connection", "query", "result")
What should be exactly is "connection", "query", "result"
Error I am getting in syslog is
/usr/local/kamailio/etc/kamailio/kamailio.lua:1: attempt to index field 'sqlops' (a nil value)

I am using kamailio 5.0.2

A little bit of headsup will help me.
Thanks a lot again.



--
Regards 
Santosh Gupta
+91 9323043570

Virus-free. www.avg.com



--
Regards 
Santosh Gupta
+91 9323043570

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users