<div dir="ltr"><br>Hi, sorry. It looks like I messed up the code. I pasted in some easier to copy code:<br><br>api = freeswitch.API()<br>require"luasql.sqlite3"<br>env = luasql.sqlite3()<br>conn = env:connect("db.db")<br>session:answer()<br>query = [[INSERT INTO TEST_TABLE VALUES("0000000000")]]<br>session:consoleLog("info", query .. "\n")<br>conn:execute(query)<br>conn:commit()<br>conn:close()<br>env:close()<br>session:hangup()<br><br>----<br><br>require"luasql.sqlite3"<br>env = luasql.sqlite3()<br>conn = env:connect("db.db") <br>query = [[INSERT INTO TEST_TABLE VALUES("0000000000")]]<br>conn:execute(query)<br>conn:commit()<br>conn:close()<br>env:close()<br><br><br><div><div class="gmail_extra"><div class="gmail_quote">On Sat, May 30, 2015 at 10:41 PM, Doug Vought <span dir="ltr"><<a href="mailto:doug.vought@gmail.com" target="_blank">doug.vought@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><<a href="https://freeswitch.org/confluence/display/FREESWITCH/Lua+with+Database" target="_blank">https://freeswitch.org/confluence/display/FREESWITCH/Lua+with+Database</a>><br></div><div><br>On this confluence page, it indicates that one can use LuaSQL to connect to a database.<br><br></div><div>FreeSWITCH Version 1.4.18-1~64bit (-1 64bit)<br></div><div>Lua 5.2.1 <br></div><div>Linux freeswitch 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64<br></div><br></div>Utilizing the LuaSQL-sqlite3 database connector, I will attempt to INSERT, but the value never gets inserted.<br><br></div>The reason I think it is freeswitch is because utilizing the same code (without the freeswitch hooks), the INSERT works just fine.<br><br></div>Here's what I'm doing: <br><br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">api = freeswitch.API()<br>require"luasql.sqlite3"<br>env = luasql.sqlite3()<br>conn = env:connect("db.db")<br>session:answer()<br>query = [[INSERT INTO TEST_TABLE VALUES("0000000000")]]<br>session:consoleLog("info", query .. "\n")<br>conn:execute(query)<br>conn:commit()<br>conn:close()<br>env:close()<br>session:hangup()<br></blockquote><div><br></div><div>The Lua interpreter is not throwing me any errors and the dialplan ends, so I assume it's working. I go into the database to see and nothing has been inserted. <br><br></div><div>Also note: I did try to make sure I was taking locking into account by giving env:connect() the appropriate millisecond value, but this did not change anything.<br></div><div><br></div><div>If I do this same thing, but without Freeswitch involved and ran by the Lua interpreter:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">require"luasql.sqlite3"<br>env = luasql.sqlite3()<br>conn = env:connect("db.db") </blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div>query = [[INSERT INTO TEST_TABLE VALUES("0000000000")]]<br></div></blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div>conn:execute(query)<br>conn:commit()<br>conn:close()<br>env:close()</div></blockquote><div><br></div><div> The values are inserted.<br><br></div><div>----<br><br></div><div>I am putting this here because I am assuming this is a failure on my part and I don't want to muck up Jira if that's the case. <br><br></div><div>BUT, it would be nice to see the LuaSQL recommendation removed if doesn't work as expected with Freeswitch.<br><br></div><div>Can anyone try this and see if they are having the same problem? Maybe we can save a few people some time by getting that info off of the confluence page if it's found not to work with multiple people :).<br><br></div><div>Thanks,<br></div><div>Doug<br></div></div></div>
</blockquote></div><br></div></div></div>