<div dir="ltr">hello Avi,<div><br></div><div style>that's right, but nevermind that, that's the output when I was trying something else:</div><div style><br></div><div style><div>2013-02-12 19:32:07.784156 [INFO] mod_nibblebill.c:498 Beginning new billing on 58e6762b-c049-470e-84f7-519a815ab6f0</div>
<div>2013-02-12 19:32:07.784156 [CRIT] mod_nibblebill.c:535 Failed to log to database!</div><div>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']</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 13, 2013 at 12:58 PM, Avi Marcus <span dir="ltr"><<a href="mailto:avi@avimarcus.net" target="_blank">avi@avimarcus.net</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">Your logs showed the queries run were:<div><br></div><div><div class="im"><div style="color:rgb(34,34,34);font-size:12.571428298950195px;font-family:arial,sans-serif">
UPDATE sip_users SET balance=balance-0.018983 WHERE ='1'</div>
</div><div class="im"><div style="color:rgb(34,34,34);font-size:12.571428298950195px;font-family:arial,sans-serif">SELECT balance AS nibble_balance FROM sip_users WHERE ='1'</div></div></div><div><br></div>
<div>
You just tried now.. "WHERE <b>id</b>='1' " -- they are not the same query...</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888"><div>
<div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small">-Avi</span></div>
</div></font></span><div><div class="h5"><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small"><br></span></div><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small"><br>
</span></div>
<br><div class="gmail_quote">On Wed, Feb 13, 2013 at 12:48 PM, David Villasmil <span dir="ltr"><<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@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"><font face="courier new, monospace">Hello Rupa,</font><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">the query if ok, the user is there:</font></div>
<div><font face="courier new, monospace"><br></font></div><div><div><font face="courier new, monospace">mysql> select * from sip_users;</font></div><div><font face="courier new, monospace">+----+----------+----------+----------------+------------+--------------+--------------+</font></div>
<div><font face="courier new, monospace">| id | username | password | rateplan | balance | domain | max_channels |</font></div><div><font face="courier new, monospace">+----+----------+----------+----------------+------------+--------------+--------------+</font></div>
<div><font face="courier new, monospace">| 1 | 1002 | 1234 | retail_default | 100.000000 | 192.168.1.44 | 1 |</font></div><div><font face="courier new, monospace">+----+----------+----------+----------------+------------+--------------+--------------+</font></div>
<div><font face="courier new, monospace">1 row in set (0.00 sec)</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">and the actual sql executed by nibblebill:</font></div>
<div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace"><div>mysql> SELECT balance AS nibble_balance FROM sip_users WHERE id='1';</div><div>+----------------+</div>
<div>| nibble_balance |</div><div>+----------------+</div><div>| 100.000000 |</div><div>+----------------+</div><div>1 row in set (0.00 sec)</div><div><br></div><div><br></div><div>so that's ok..</div><div>
<br></div><div><br></div><div>any othe ideas?</div><div><br></div><div>Thanks a lot for your help!</div><span><font color="#888888"><div><br></div><div><br></div><div>David</div></font></span></font></div>
<div><font face="courier new, monospace"><br>
</font></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Wed, Feb 13, 2013 at 3:35 AM, Rupa Schomaker <span dir="ltr"><<a href="mailto:rupa@rupa.com" target="_blank">rupa@rupa.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div class="gmail_extra"><div><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 5:26 PM, David Villasmil <span dir="ltr"><<a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@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>call goes out fine... no billing though:</div><div><br></div><div><br></div><div><div>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</div>
<div>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)</div><div>2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:351 Doing update query</div>
<div>[UPDATE sip_users SET balance=balance-0.018983 WHERE ='1']</div><div>2013-02-12 19:21:49.844277 [CRIT] mod_nibblebill.c:535 Failed to log to database!</div><div>2013-02-12 19:21:49.844277 [DEBUG] mod_nibblebill.c:378 Doing lookup query</div>
<div>[SELECT balance AS nibble_balance FROM sip_users WHERE ='1']</div><div>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']</div>
<div><br></div><div><br></div><div>the select go fine if executed "by hand"</div></div></blockquote></div><br></div>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. <span><font color="#888888"><br>
<br clear="all"><div><br></div>-- <br>-Rupa
</font></span></div></div>
<br></div></div><div>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div></blockquote></div><br></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org" target="_blank">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" target="_blank">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></div></div></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>