[Freeswitch-users] nibblebill sql requests

Madovsky infos at madovsky.org
Wed Feb 9 02:49:19 MSK 2011


no 60s
but maybe it could be I hanged up at the same time
of the last second of 60 seconds
but I'd like to be sure... I test again..
  ----- Original Message ----- 
  From: Avi Marcus 
  To: FreeSWITCH Users Help 
  Sent: Tuesday, February 08, 2011 6:30 PM
  Subject: Re: [Freeswitch-users] nibblebill sql requests


  I don't know why the first is billing so soon - is your heartbeat set to 1 second?
  But the second is billing again because the call hung up.
  -Avi


  On Wed, Feb 9, 2011 at 12:51 AM, Madovsky <infos at madovsky.org> wrote:

    Avi,

    look at the time, there are 2 identical select / update in the same second
      ----- Original Message ----- 
      From: Avi Marcus 
      To: FreeSWITCH Users Help 
      Sent: Tuesday, February 08, 2011 2:18 PM
      Subject: Re: [Freeswitch-users] nibblebill sql requests


      I don't see why you think this is duplicate. 
      nibblebill automatically bills every X as per the "heartbeat" variable.
      Also, since the timer is sometimes slightly off, it has to make up for it with a fraction at the end.
      Also, the constant "selects" is to enable the lowbal/nobal actions. That LAST select does seem suspect, however.


      If you only want POST-call billing, then set the heartbeat variable to 0 I think? or just something big? in the conf xml - <param name="global_heartbeat" value="300">
      -Avi


      On Tue, Feb 8, 2011 at 6:11 PM, Madovsky <infos at madovsky.org> wrote:

        after hangup,
        nibblebill makes unnecessary duplicated SQL requests :

        2011-02-08 11:06:36.894238 [DEBUG] mod_sofia.c:457 Channel sofia/internal/9999999999999 at domain.com hanging up, cause: NORMAL_CLEARING
        2011-02-08 11:06:37.018489 [DEBUG] mod_nibblebill.c:433 Attempting to bill at $0.03864 per minute to account 9999999999999
        2011-02-08 11:06:37.018489 [INFO] mod_nibblebill.c:485 Beginning new billing on 461772290 at 12.34.56.78
        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
        2011-02-08 11:06:37.018489 [DEBUG] mod_nibblebill.c:498 Billing $0.000874 to 9999999999999 (Call: 461772290 at 12.34.56.78 / 0.000000 so far)
        2011-02-08 11:06:37.018489 [DEBUG] mod_nibblebill.c:321 Doing update query
        [UPDATE accounts SET cash=cash-0.000874 WHERE id='9999999999999']
        2011-02-08 11:06:37.074740 [DEBUG] mod_nibblebill.c:366 Doing lookup query
        [SELECT cash AS nibble_balance FROM accounts WHERE id='9999999999999']
        2011-02-08 11:06:37.082844 [DEBUG] mod_nibblebill.c:376 Retrieved current balance for account 9999999999999 (balance = 9.579666)
        2011-02-08 11:06:37.082844 [DEBUG] switch_core_state_machine.c:46 sofia/internal/9999999999999 at domain.com Standard HANGUP, cause: NORMAL_CLEARING
        2011-02-08 11:06:37.082844 [DEBUG] switch_core_state_machine.c:557 (sofia/internal/9999999999999 at domain.com) State HANGUP going to sleep
        2011-02-08 11:06:37.082844 [DEBUG] switch_core_state_machine.c:351 (sofia/internal/9999999999999 at domain.com) State Change CS_HANGUP -> CS_REPORTING
        2011-02-08 11:06:37.082844 [DEBUG] switch_core_session.c:1116 Send signal sofia/internal/9999999999999 at domain.com [BREAK]
        2011-02-08 11:06:37.082844 [DEBUG] switch_core_state_machine.c:320 (sofia/internal/9999999999999 at domain.com) Running State Change CS_REPORTING
        2011-02-08 11:06:37.082844 [DEBUG] switch_core_state_machine.c:617 (sofia/internal/9999999999999 at domain.com) State REPORTING
        2011-02-08 11:06:37.082844 [DEBUG] mod_nibblebill.c:433 Attempting to bill at $0.03864 per minute to account 9999999999999
        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
        2011-02-08 11:06:37.082844 [DEBUG] mod_nibblebill.c:498 Billing $0.000041 to 9999999999999 (Call: 461772290 at 12.34.56.78 / 0.000874 so far)
        2011-02-08 11:06:37.082844 [DEBUG] mod_nibblebill.c:321 Doing update query
        [UPDATE accounts SET cash=cash-0.000041 WHERE id='9999999999999']
        2011-02-08 11:06:37.133170 [DEBUG] mod_nibblebill.c:366 Doing lookup query
        [SELECT cash AS nibble_balance FROM accounts WHERE id='9999999999999']
        2011-02-08 11:06:37.201557 [DEBUG] mod_nibblebill.c:376 Retrieved current balance for account 9999999999999 (balance = 9.579625)

        How to avoid duplicate SQL requests with nibblebill ?

        Thanks


        _______________________________________________
        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






--------------------------------------------------------------------------


      _______________________________________________
      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



    _______________________________________________
    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






------------------------------------------------------------------------------


  _______________________________________________
  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/20110208/c9bc3834/attachment.html 


More information about the FreeSWITCH-users mailing list