[Freeswitch-users] Nibblebill database question
David Villasmil
david.villasmil.work at gmail.com
Wed Feb 13 18:33:43 MSK 2013
hello Avi,
that's right, but nevermind that, that's the output when I was trying
something else:
2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new
billing on 58e6762b-c049-470e-84f7-519a815ab6f0
2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to
database!
2013-02-12 19:32:07.784156 [ERR] mod_nibblebill.c:380 Error running this
query: [SELECT balance AS nibble_balance FROM sip_users WHERE id='1']
On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <avi at avimarcus.net> wrote:
> Your logs showed the queries run were:
>
> UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'
> SELECT balance AS nibble_balance FROM sip_users WHERE ='1'
>
> You just tried now.. "WHERE *id*='1' " -- they are not the same query...
>
> -Avi
>
>
>
> On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil <
> david.villasmil.work at gmail.com> wrote:
>
>> Hello Rupa,
>>
>> the query if ok, the user is there:
>>
>> mysql> select * from sip_users;
>>
>> +----+----------+----------+----------------+------------+--------------+--------------+
>> | id | username | password | rateplan | balance | domain |
>> max_channels |
>>
>> +----+----------+----------+----------------+------------+--------------+--------------+
>> | 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 |
>> 1 |
>>
>> +----+----------+----------+----------------+------------+--------------+--------------+
>> 1 row in set (0.00 sec)
>>
>>
>> and the actual sql executed by nibblebill:
>>
>> mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1';
>> +----------------+
>> | nibble_balance |
>> +----------------+
>> | 100.000000 |
>> +----------------+
>> 1 row in set (0.00 sec)
>>
>>
>> so that's ok..
>>
>>
>> any othe ideas?
>>
>> Thanks a lot for your help!
>>
>>
>> David
>>
>>
>>
>> On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <rupa at rupa.com> wrote:
>>
>>>
>>> On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil <
>>> david.villasmil.work at gmail.com> wrote:
>>>
>>>> call goes out fine... no billing though:
>>>>
>>>>
>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:504 22 seconds
>>>> passed since last bill time of 2013-02-12 19:21:27
>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:521 Billing
>>>> $0.018983 to 1 (Call: d442dc6b-a3a7-423a-8450-598d17ca43b3 / 0.000000 so
>>>> far)
>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update
>>>> query
>>>> [UPDATE sip_users SET balance=balance-0.018983 WHERE ='1']
>>>> 2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to
>>>> database!
>>>> 2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup
>>>> query
>>>> [SELECT balance AS nibble_balance FROM sip_users WHERE ='1']
>>>> 2013-02-12 19:21:49.844277 [ERR] mod_nibblebill.c:380 Error running
>>>> this query: [SELECT balance AS nibble_balance FROM sip_users WHERE ='1']
>>>>
>>>>
>>>> the select go fine if executed "by hand"
>>>>
>>>
>>> None of those SQL statements are valid. (hint: WHERE = '1' is no good).
>>> Been a while since I hacked/worked with nibblebill, but I'm pretty sure
>>> the 'id' field isn't not being filled in the sql for some reason.
>>>
>>>
>>> --
>>> -Rupa
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>>
>>>
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at 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 at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>>
>>
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at 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 at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130213/d332609e/attachment.html
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list