<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18939">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Avi,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>look at the time, there are 2 identical select /
update in the same second</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=avi@avimarcus.net href="mailto:avi@avimarcus.net">Avi Marcus</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=freeswitch-users@lists.freeswitch.org
href="mailto:freeswitch-users@lists.freeswitch.org">FreeSWITCH Users Help</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, February 08, 2011 2:18
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Freeswitch-users]
nibblebill sql requests</DIV>
<DIV><BR></DIV>
<DIV dir=ltr>I don't see why you think this is duplicate.
<DIV>nibblebill automatically bills every X as per the "heartbeat"
variable.</DIV>
<DIV>Also, since the timer is sometimes slightly off, it has to make up for it
with a fraction at the end.</DIV>
<DIV>Also, the constant "selects" is to enable the lowbal/nobal actions. That
LAST select does seem suspect, however.</DIV>
<DIV><BR></DIV>
<DIV>If you only want POST-call billing, then set the heartbeat variable to 0
I think? or just something big? in the conf xml - <SPAN
style="LINE-HEIGHT: 14px; FONT-FAMILY: monospace; WHITE-SPACE: pre; FONT-SIZE: 13px"
class=Apple-style-span><param name="global_heartbeat"
value="300"></SPAN></DIV>
<DIV>-Avi<BR><BR>
<DIV class=gmail_quote>On Tue, Feb 8, 2011 at 6:11 PM, Madovsky <SPAN
dir=ltr><<A
href="mailto:infos@madovsky.org">infos@madovsky.org</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV bgcolor="#ffffff">
<DIV><FONT size=2>after hangup,</FONT></DIV>
<DIV><FONT size=2>nibblebill makes unnecessary duplicated SQL requests
:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=1>
<P>2011-02-08 11:06:36.894238 [DEBUG] mod_sofia.c:457 Channel
sofia/internal/<A href="mailto:9999999999999@domain.com"
target=_blank>9999999999999@domain.com</A> hanging up, cause:
NORMAL_CLEARING<BR>2011-02-08 11:06:37.018489 [DEBUG] mod_nibblebill.c:433
Attempting to bill at $0.03864 per minute to account
9999999999999<BR>2011-02-08 11:06:37.018489 [INFO] mod_nibblebill.c:485
Beginning new billing on <A href="mailto:461772290@12.34.56.78"
target=_blank>461772290@12.34.56.78</A><BR>2011-02-08 11:06:37.018489
[DEBUG] mod_nibblebill.c:491 1 seconds passed since last bill time of
2011-02-08 11:06:35<BR>2011-02-08 11:06:37.018489 [DEBUG]
mod_nibblebill.c:498 Billing $0.000874 to 9999999999999 (Call: <A
href="mailto:461772290@12.34.56.78" target=_blank>461772290@12.34.56.78</A>
/ 0.000000 so far)<BR>2011-02-08 11:06:37.018489 [DEBUG]
mod_nibblebill.c:321 Doing update query<BR><FONT color=#ff0000>[UPDATE
accounts SET cash=cash-0.000874 WHERE
id='9999999999999']</FONT><BR>2011-02-08 11:06:37.074740 [DEBUG]
mod_nibblebill.c:366 Doing lookup query<BR>[<FONT color=#ff0000>SELECT cash
AS nibble_balance FROM accounts WHERE
id='9999999999999']</FONT><BR>2011-02-08 11:06:37.082844 [DEBUG]
mod_nibblebill.c:376 Retrieved current balance for account 9999999999999
(balance = 9.579666)<BR>2011-02-08 11:06:37.082844 [DEBUG]
switch_core_state_machine.c:46 sofia/internal/<A
href="mailto:9999999999999@domain.com"
target=_blank>9999999999999@domain.com</A> Standard HANGUP, cause:
NORMAL_CLEARING<BR>2011-02-08 11:06:37.082844 [DEBUG]
switch_core_state_machine.c:557 (sofia/internal/<A
href="mailto:9999999999999@domain.com"
target=_blank>9999999999999@domain.com</A>) State HANGUP going to
sleep<BR>2011-02-08 11:06:37.082844 [DEBUG] switch_core_state_machine.c:351
(sofia/internal/<A href="mailto:9999999999999@domain.com"
target=_blank>9999999999999@domain.com</A>) State Change CS_HANGUP ->
CS_REPORTING<BR>2011-02-08 11:06:37.082844 [DEBUG]
switch_core_session.c:1116 Send signal sofia/internal/<A
href="mailto:9999999999999@domain.com"
target=_blank>9999999999999@domain.com</A> [BREAK]<BR>2011-02-08
11:06:37.082844 [DEBUG] switch_core_state_machine.c:320 (sofia/internal/<A
href="mailto:9999999999999@domain.com"
target=_blank>9999999999999@domain.com</A>) Running State Change
CS_REPORTING<BR>2011-02-08 11:06:37.082844 [DEBUG]
switch_core_state_machine.c:617 (sofia/internal/<A
href="mailto:9999999999999@domain.com"
target=_blank>9999999999999@domain.com</A>) State REPORTING<BR>2011-02-08
11:06:37.082844 [DEBUG] mod_nibblebill.c:433 Attempting to bill at $0.03864
per minute to account 9999999999999<BR>2011-02-08 11:06:37.082844 [DEBUG]
mod_nibblebill.c:491 0 seconds passed since last bill time of 2011-02-08
11:06:37<BR>2011-02-08 11:06:37.082844 [DEBUG] mod_nibblebill.c:498 Billing
$0.000041 to 9999999999999 (Call: <A href="mailto:461772290@12.34.56.78"
target=_blank>461772290@12.34.56.78</A> / 0.000874 so far)<BR>2011-02-08
11:06:37.082844 [DEBUG] mod_nibblebill.c:321 Doing update query<BR><FONT
color=#ff0000>[UPDATE accounts SET cash=cash-0.000041 WHERE
id='9999999999999']</FONT><BR>2011-02-08 11:06:37.133170 [DEBUG]
mod_nibblebill.c:366 Doing lookup query<BR><FONT color=#ff0000>[SELECT cash
AS nibble_balance FROM accounts WHERE
id='9999999999999']</FONT><BR>2011-02-08 11:06:37.201557 [DEBUG]
mod_nibblebill.c:376 Retrieved current balance for account 9999999999999
(balance = 9.579625)</P>
<P><FONT size=2>How to avoid duplicate SQL requests with nibblebill
?</FONT></P>
<P><FONT
size=2>Thanks</FONT></P></FONT></DIV></DIV><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></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>FreeSWITCH-users
mailing
list<BR>FreeSWITCH-users@lists.freeswitch.org<BR>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<BR>http://www.freeswitch.org<BR></BLOCKQUOTE></BODY></HTML>