<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1432252138680_8110">Hello All.</div><div id="yui_3_16_0_1_1432252138680_8110"><br></div><div id="yui_3_16_0_1_1432252138680_8110">I am using FS with nibblebill and mod_lcr.</div><div id="yui_3_16_0_1_1432252138680_8110"><br></div><div id="yui_3_16_0_1_1432252138680_8110">But i do not understand why nibblebill deduc balance two times; my log :</div><div id="yui_3_16_0_1_1432252138680_8110"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.846179 [DEBUG] mod_nibblebill.c:546 31 seconds passed since last bill time of 2015-05-21 19:55:37</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.846179 [DEBUG] mod_nibblebill.c:563 Billing $16.800001 to 2 (Call: c457b3c6-6bc8-445e-9697-2ffc327c6722 / 0.000000 so far)</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.846179 [DEBUG] mod_nibblebill.c:393 Doing update query</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">[UPDATE auth_user SET saldo=saldo-16.800001 WHERE id='2']</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account 2 (balance = 83.199999)</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:60 sofia/external/992797744 Standard HANGUP, cause: NORMAL_CLEARING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:737 (sofia/external/992797744) State HANGUP going to sleep</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:504 (sofia/external/992797744) State Change CS_HANGUP -> CS_REPORTING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_session.c:1388 Send signal sofia/external/992797744 [BREAK]</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:472 (sofia/external/992797744) Running State Change CS_REPORTING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:823 (sofia/external/992797744) State REPORTING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:104 sofia/external/992797744 Standard REPORTING, cause: NORMAL_CLEARING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:823 (sofia/external/992797744) State REPORTING going to sleep</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:498 (sofia/external/992797744) State Change CS_REPORTING -> CS_DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_session.c:1388 Send signal sofia/external/992797744 [BREAK]</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_session.c:1615 Session 8547 (sofia/external/992797744) Locked, Waiting on external entities</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [NOTICE] switch_core_session.c:1633 Session 8547 (sofia/external/992797744) Ended</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [NOTICE] switch_core_session.c:1637 Close Channel sofia/external/992797744 [CS_DESTROY]</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:626 (sofia/external/992797744) Running State Change CS_DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:636 (sofia/external/992797744) State DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] mod_sofia.c:323 sofia/external/992797744 SOFIA DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:111 sofia/external/992797744 Standard DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.866181 [DEBUG] switch_core_state_machine.c:636 (sofia/external/992797744) State DESTROY going to sleep</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] mod_nibblebill.c:420 Doing lookup query</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">[SELECT saldo AS nibble_balance FROM auth_user WHERE id='2']</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account 2 (balance = 66.399998)</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] switch_core_state_machine.c:60 sofia/internal/448908901@ssw.opendata.cl Standard HANGUP, cause: NORMAL_CLEARING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] switch_core_state_machine.c:737 (sofia/internal/448908901@ssw.opendata.cl) State HANGUP going to sleep</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] switch_core_state_machine.c:504 (sofia/internal/448908901@ssw.opendata.cl) State Change CS_HANGUP -> CS_REPORTING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] switch_core_session.c:1388 Send signal sofia/internal/448908901@ssw.opendata.cl [BREAK]</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] switch_core_state_machine.c:472 (sofia/internal/448908901@ssw.opendata.cl) Running State Change CS_REPORTING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] switch_core_state_machine.c:823 (sofia/internal/448908901@ssw.opendata.cl) State REPORTING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:08.886193 [DEBUG] switch_scheduler.c:144 Deleting task 8550 switch_core_session_sched_heartbeat (52f0e5f6-c97e-41c1-9a39-a4d12ec0683f)</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_state_machine.c:104 sofia/internal/448908901@ssw.opendata.cl Standard REPORTING, cause: NORMAL_CLEARING</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_state_machine.c:823 (sofia/internal/448908901@ssw.opendata.cl) State REPORTING going to sleep</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_state_machine.c:498 (sofia/internal/448908901@ssw.opendata.cl) State Change CS_REPORTING -> CS_DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_session.c:1388 Send signal sofia/internal/448908901@ssw.opendata.cl [BREAK]</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_session.c:1615 Session 8546 (sofia/internal/448908901@ssw.opendata.cl) Locked, Waiting on external entities</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [NOTICE] switch_core_session.c:1633 Session 8546 (sofia/internal/448908901@ssw.opendata.cl) Ended</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [NOTICE] switch_core_session.c:1637 Close Channel sofia/internal/448908901@ssw.opendata.cl [CS_DESTROY]</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_state_machine.c:626 (sofia/internal/448908901@ssw.opendata.cl) Running State Change CS_DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_state_machine.c:636 (sofia/internal/448908901@ssw.opendata.cl) State DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] mod_sofia.c:323 sofia/internal/448908901@ssw.opendata.cl SOFIA DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_state_machine.c:111 sofia/internal/448908901@ssw.opendata.cl Standard DESTROY</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.086191 [DEBUG] switch_core_state_machine.c:636 (sofia/internal/448908901@ssw.opendata.cl) State DESTROY going to sleep</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="">2015-05-21 19:56:09.386178 [DEBUG] switch_scheduler.c:144 Deleting task 8549 switch_ivr_schedule_hangup (c457b3c6-6bc8-445e-9697-2ffc327c6722)</div><div dir="ltr" class="" style="" id="yui_3_16_0_1_1432252138680_8247"><br class="" style=""></div><div dir="ltr" class="" style="" id="yui_3_16_0_1_1432252138680_8298"><br></div><div dir="ltr" class="" style="" id="yui_3_16_0_1_1432252138680_8248">As you can see the first time say:</div><div dir="ltr" class="" style=""><br></div><div dir="ltr" class="" style="" id="yui_3_16_0_1_1432252138680_8271"><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;">[UPDATE auth_user SET saldo=saldo-16.800001 WHERE id='2']</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr">2015-05-21 19:56:08.866181 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account 2 (balance = 83.199999)</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr">The new balance is 83.199999 it's fine</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr">and then</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;">2015-05-21 19:56:08.886193 [DEBUG] mod_nibblebill.c:420 Doing lookup query</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;">[SELECT saldo AS nibble_balance FROM auth_user WHERE id='2']</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr">2015-05-21 19:56:08.886193 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account 2 (balance = 66.399998)</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr">But again retrieved balance and now balance is 66.399998 it's wrong!!</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr">My dialplan:</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <extension name="Todo"></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <condition expression="^([2-9]\d{8})$" field="destination_number"></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="export" data="dialed_extension=$1"/></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="set" data="hangup_after_bridge=true"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="set" data="continue_on_fail=true"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="sched_hangup" data="+1800 alloted_timeout"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="limit" data="hash fraud_protection calls_max_intl ${calls_max_intl} !NORMAL_TEMPORARY_FAILURE"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="lcr" data="$1 pg_prefix2"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="set" data="nibble_rate=${lcr_rate_1}"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="set" data="nibble_account=${accountcode}"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="set" data="lowbal_amt=${lowbal_amt}"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="set" data="nobal_amt=${nobal_amt}"/><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <!--<action application="nibblebill" data="heartbeat 10"/>--><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="set" data="bypass_media=true"/></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"> <action application="bridge" data="${lcr_auto_route}"/></div><div dir="ltr" class="" style="" id="yui_3_16_0_1_1432252138680_8505"><br class="" style=""></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr">Anyone give some idea or what i am doing wrong.</div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr"><br></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style="margin-top: 0.1em; margin-bottom: 0.1em;" dir="ltr">Regards</div></div><div id="yui_3_16_0_1_1432252138680_8110" class="" style=""><br class="" style=""></div></div></body></html>