<div dir="ltr">I don&#39;t know why the first is billing so soon - is your heartbeat set to 1 second?<div>But the second is billing again because the call hung up.</div><div>-Avi<br><br><div class="gmail_quote">On Wed, Feb 9, 2011 at 12:51 AM, 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">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><div></div><div class="h5">
  <div style="font:10pt arial">----- Original Message ----- </div>
  <div style="font:10pt arial;background:#e4e4e4"><b>From:</b> 
  <a title="avi@avimarcus.net" href="mailto:avi@avimarcus.net" target="_blank">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" target="_blank">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&#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 style="line-height:14px;font-family:monospace;white-space:pre-wrap;font-size:13px">&lt;param name=&quot;global_heartbeat&quot; 
  value=&quot;300&quot;&gt;</span></div>
  <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" target="_blank">infos@madovsky.org</a>&gt;</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=&#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" 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><p>
  </p><hr><div class="im">

  <p></p>_______________________________________________<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>

</div><p></p></blockquote></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>