[SR-Users] app_lua sr.sqlops.query exit status
miconda at gmail.com
Tue Jan 9 22:20:29 CET 2018
I needed to know in order to suggest use of "KSR" package or not,
instead of "sr". The "sr" package likely to be obsoleted soon, as KSR
has lot more exported functions and it is part of the kemi framework. See:
However, 5.0 doesn't have so many KSR exports as 5.1, and not sure if
KSR has the sqlops exports in that version -- too late to check more in
the code now...
Looking at the code, sr.sqlops.query() should return -1 in case of error
and 0 if ok.
On 09.01.18 20:53, jenus at cyberchaos.nl wrote:
> Currently running kamailio 5.0.5.
> Daniel-Constantin Mierla schreef op 2018-01-09 13:27:
>> what version of kamailio are you using?
>> On 07.01.18 22:14, jenus at cyberchaos.nl wrote:
>>> I'm doing some tests with a lua script and app_lua. I'm using
>>> sr.sqlops.query to insert records into the database but would like to
>>> test the exit status of the sql query. In kamailio i can do:
>>> if(!sql_query("kamailio", "INSERT INTO subscriber ..."))
>>> Is there some kind of exit status for the lua function sr.sqlops.query
>>> in order to do the same check in lua? In other words, is it possible
>>> to check if a sql query was successful in lua? The result seems to be
>>> nill in all cases for a INSERT in lua using sr.sqlops.query.
>>> Jan Hazenberg
>>> Kamailio (SER) - Users Mailing List
>>> sr-users at lists.kamailio.org
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com
More information about the sr-users