<div dir="ltr">I don&#39;t see why you think this is duplicate.<div>nibblebill automatically bills every X as per the &quot;heartbeat&quot; 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 &quot;selects&quot; 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 class="Apple-style-span" style="font-family: monospace; font-size: 13px; line-height: 14px; white-space: pre; ">&lt;param name=&quot;global_heartbeat&quot; value=&quot;300&quot;&gt;</span></div>

<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>-Avi<br><br><div class="gmail_quote">On Tue, Feb 8, 2011 at 6:11 PM, Madovsky <span dir="ltr">&lt;<a href="mailto:infos@madovsky.org">infos@madovsky.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">





<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=&#39;9999999999999&#39;]</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=&#39;9999999999999&#39;]</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 -&gt; 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=&#39;9999999999999&#39;]</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=&#39;9999999999999&#39;]</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>