Sorry for my late reply.I read it somewhere on some blog but could not track it now. I will search it again and correct the mistakes. Thanks a lot for you help and time.It works like charm. On 4 July 2014 19:23, Steven Ayre <steveayre@gmail.com> wrote:
See http://wiki.freeswitch.org/wiki/DSN#DSN_only
Where did you get the example that showed a ODBC DSN could be just "freeswitch"? It would have worked on very old versions (pre-1.2), so if it came from some documentation / sample configs please point us to them so they can be updated.
On 4 July 2014 15:20, Steven Ayre <steveayre@gmail.com> wrote:
Use odbc://freeswitch as the dsn, the syntax you're using is a sqlite filename.
On 4 July 2014 14:00, Aqs Younas <aqsyounas@gmail.com> wrote:
Hi I am getting the following error after call is hangup on the command line.
~~ 2014-07-04 08:36:50.428532 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.03 per minute to account 1010 2014-07-04 08:36:50.428532 [INFO] mod_nibblebill.c:540 Beginning new billing on d71d9966-0377-11e4-a114-2972d0b41bbc 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 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) 2014-07-04 08:36:50.428532 [DEBUG] mod_nibblebill.c:393 Doing update query [UPDATE accounts SET cash=cash-0.006550 WHERE name='1010'] 2014-07-04 08:36:50.428532 [ERR] switch_core_sqldb.c:586 NATIVE SQL ERR [no such table: accounts] UPDATE accounts SET cash=cash-0.006550 WHERE name='1010' 2014-07-04 08:36:50.428532 [CRIT] mod_nibblebill.c:577 Failed to log to database! 2014-07-04 08:36:50.428532 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE name='1010'] 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 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']
~~
I followed steps give onhttp://wiki.freeswitch.org/wiki/Using_ODBC_in_the_core
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] Driver = /usr/lib/i386-linux-gnu/odbc/libmyodbc.so SERVER = localhost PORT = 3306 DATABASE = tcapi OPTION = 67108864 USER = root PASSWORD = password
# cat /etc/odbcinst.ini [MySQL] Description = MySQL driver Driver = /usr/lib/i386-linux-gnu/odbc/libmyodbc.so Setup = /usr/lib/i386-linux-gnu/odbc/libodbcmyS.so UsageCount = 1 FileUsage = 1 Threading = 0
# isql -v freeswitch +---------------------------------------+ |* Connected! | *|* | *|* sql-statement | *|* help [tablename] | *|* quit | *|* | *+---------------------------------------+ SQL>
My conf/autoload_configs/nibblebill.conf.xml has the lines
<settings> param name="odbc-dsn" value="freeswitch"/> <param name="db_table" value="accounts"/> <param name="db_column_cash" value="cash"/>
<param name="db_column_account" value="name"/> </settings>
Mysql database structure.
mysql> use tcapi; Database changed mysql> desc accounts;
+-------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+-------+ | id | int(11) | NO | PRI | NULL | | | name | varchar(255) | YES | | NULL | |
| cash | double | NO | | NULL | | +-------+--------------+------+-----+---------+-------+ 3 rows in set (0.01 sec)
mysql> select * from accounts; +------+------+------------+ | id | name | cash |
+------+------+------------+ | 0 | 1000 | 7777 | | 1010 | 1010 | 8887.98792 | +------+------+------------+ 2 rows in set (0.00 sec)
Though the table exit.But freeswitch is unable to find it.
Any help in this regard would be much appreciated.
Thanks
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org