<div dir="ltr">Use odbc://freeswitch as the dsn, the syntax you're using is a sqlite filename.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 4 July 2014 14:00, Aqs Younas <span dir="ltr"><<a href="mailto:aqsyounas@gmail.com" target="_blank">aqsyounas@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi
<br>I am getting the following error after call is hangup on the command
line.
<br><br><br>~~ <br>2014-07-04 08:36:50.428532 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.03 per minute to account 1010<br>2014-07-04 08:36:50.428532 [INFO] mod_nibblebill.c:540 Beginning new billing on d71d9966-0377-11e4-a114-2972d0b41bbc<br>
2014-07-04 08:36:50.428532 [DEBUG] mod_nibblebill.c:546 13 seconds passed since last bill time of 2014-07-04 08:36:37<br>2014-07-04 08:36:50.428532 [DEBUG] mod_nibblebill.c:563 Billing $0.006550 to 1010 (Call: d71d9966-0377-11e4-a114-2972d0b41bbc / 0.000000 so far)<br>
2014-07-04 08:36:50.428532 [DEBUG] mod_nibblebill.c:393 Doing update query<br>[UPDATE accounts SET cash=cash-0.006550 WHERE name='1010']<br>2014-07-04 08:36:50.428532 [ERR] switch_core_sqldb.c:586 NATIVE SQL ERR [no such table: accounts]<br>
UPDATE accounts SET cash=cash-0.006550 WHERE name='1010'<br>2014-07-04 08:36:50.428532 [CRIT] mod_nibblebill.c:577 Failed to log to database!<br>2014-07-04 08:36:50.428532 [DEBUG] mod_nibblebill.c:420 Doing lookup query<br>
[SELECT cash AS nibble_balance FROM accounts WHERE name='1010']<br>2014-07-04 08:36:50.428532 [ERR] switch_core_sqldb.c:1196 SQL ERR: [SELECT cash AS nibble_balance FROM accounts WHERE name='1010'] no such table: accounts<br>
2014-07-04 08:36:50.428532 [ERR] mod_nibblebill.c:422 Error running this query: [SELECT cash AS nibble_balance FROM accounts WHERE name='1010']<br><br><pre>~~
I followed steps give on
<a href="http://wiki.freeswitch.org/wiki/Using_ODBC_in_the_core" target="_blank">http://wiki.freeswitch.org/wiki/Using_ODBC_in_the_core</a>
I am on Ubuntu 14.04 LTS and I installed unixodbc, unixodbc-dev, libmyodbc
packages by using apt-get. Then I did ./configure
--enable-core-odbc-support , make, make install on freeswitch and the
config.log shows that unixodbc got recognized and compiled.
I configured the ini files and my odbc works with MySQL
# cat /etc/odbc.ini
[freeswitch]<br>Driver = /usr/lib/i386-linux-gnu/odbc/libmyodbc.so<br>SERVER = localhost<br>PORT = 3306<br>DATABASE = tcapi<br>OPTION = 67108864<br>USER = root<br>PASSWORD = password
# cat /etc/odbcinst.ini
[MySQL]<br>Description = MySQL driver<br>Driver = /usr/lib/i386-linux-gnu/odbc/libmyodbc.so<br>Setup = /usr/lib/i386-linux-gnu/odbc/libodbcmyS.so<br>UsageCount = 1<br>FileUsage = 1<br>Threading = 0<br>
<br>
# isql -v freeswitch
+---------------------------------------+
|<i> Connected! |
</i>|<i> |
</i>|<i> sql-statement |
</i>|<i> help [tablename] |
</i>|<i> quit |
</i>|<i> |
</i>+---------------------------------------+
SQL>
My conf/autoload_configs/nibblebill.conf.xml has the lines
<settings>
param name="odbc-dsn" value="freeswitch"/><br> <param name="db_table" value="accounts"/><br> <param name="db_column_cash" value="cash"/><br>
<param name="db_column_account" value="name"/><br></settings><br><br></pre><pre>Mysql database structure.<br><br>mysql> use tcapi;<br>Database changed<br>mysql> desc accounts;<br>
+-------+--------------+------+-----+---------+-------+<br>
| Field | Type | Null | Key | Default | Extra |<br>+-------+--------------+------+-----+---------+-------+<br>| id | int(11) | NO | PRI | NULL | |<br>| name | varchar(255) | YES | | NULL | |<br>
| cash | double | NO | | NULL | |<br>+-------+--------------+------+-----+---------+-------+<br>3 rows in set (0.01 sec)<br><br>mysql> select * from accounts;<br>+------+------+------------+<br>| id | name | cash |<br>
+------+------+------------+<br>| 0 | 1000 | 7777 |<br>| 1010 | 1010 | 8887.98792 |<br>+------+------+------------+<br>2 rows in set (0.00 sec)<br><br></pre><pre>Though the table exit.But freeswitch is unable to find it. <br>
Any help in this regard would be much appreciated.<br><br></pre><pre>Thanks<br></pre></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>