[Freeswitch-users] Error! Failed to log to database using nibblebill
Shahzad Bhatti
shahzad.bhatti at g-r-v.com
Tue Mar 5 19:11:28 MSK 2013
thanks Mr. Muhammad Shahzad for the reply but issue is that when i use to
access database on console there it works fine but when i use in dialplan
here it not works
here is my console output
*[root at localhost includes]# isql -v freeswitch*
*+---------------------------------------+*
*| Connected! |*
*| |*
*| sql-statement |*
*| help [tablename] |*
*| quit |*
*| |*
*+---------------------------------------+*
*SQL> use test;*
*SQLRowCount returns 0*
*SQL> select * from tb_accounts;*
*
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
*
*| id | name
| cash |*
*
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
*
*| 1 | shahzad
| 10 |*
*| 2 | saeed
| 50 |*
*| 3 | usman
| 10 |*
*
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
*
*SQLRowCount returns 3*
*3 rows fetched*
*SQL> update tb_accounts set cash = cash -1 where id =1;*
*SQLRowCount returns 1*
*SQL> select * from tb_accounts;*
*
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
*
*| id | name
| cash |*
*
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
*
*| 1 | shahzad
| 9 |*
*| 2 | saeed
| 50 |*
*| 3 | usman
| 10 |*
*
+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------+
*
*SQLRowCount returns 3*
*3 rows fetched*
here u can see that update is also working, and here is my dialplan xml
* <document type="freeswitch/xml">*
* <section name="dialplan" description="RE Dial Plan For
FreeSwitch">*
* <context name="public">*
* <extension name="checkBalance">*
* <condition field="destination_number"
expression="^126$">*
* <action application="set"
data="nibble_rate=0.03"/>*
* <action application="set"
data="nibble_account=1"/>*
* <action application="answer"/>*
* <action application="hangup"/>*
* </condition>*
* </extension>*
* </context>*
* </section>*
* </document>
*
i also check that the user and password and database is also correct.
any help is appreciated
Regards
Shahzad Bhatti
---------- Forwarded message ----------
>> From: Muhammad Shahzad <shaheryarkh at gmail.com>
>> To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
>> Cc:
>> Date: Fri, 1 Mar 2013 17:07:39 +0100
>> Subject: Re: [Freeswitch-users] Error! Failed to log to database using
>> nibblebill
>> Problem is with SELECT query, most likely db connection parameters are
>> missing/invalid OR the db user configured does not have enough permissions
>> to execute SELECT,
>>
>> 2013-03-01 22:29:52.293493 [ERR] mod_nibblebill.c:380 Error running this
>> query: [SELECT `cash` AS nibble_balance FROM `tb_accounts` WHERE `id`=1]
>>
>> Login db server from FS machine with same db user as configured in FS
>> configs and run above query, it would give you hint on what is actually
>> wrong.
>>
>> Thank you.
>>
>>
>> On Fri, Mar 1, 2013 at 1:42 PM, Shahzad Bhatti <shahzad.bhatti at g-r-v.com>wrote:
>>
>>> hi
>>> i am using a nibblebill the call cost but have some problem in it.
>>> my nibblebill.conf.xml file is as
>>>
>>> http://pastebin.freeswitch.org/20650
>>>
>>> and console log is
>>>
>>> http://pastebin.freeswitch.org/20651
>>>
>>> i got Error *Failed to log to database! *Doing update query
>>>
>>> reply me about the issue
>>>
>>> Regards
>>>
>>> Shahzad Bhatti
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130305/7538e3d4/attachment.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list