nibblebill do not terminate calls properly
Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable ) Unfortunately that never hangup my calls using standard dial plan *nibblebill.conf.xml* <configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options --> <!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/> <!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/> <!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/> <!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/> <!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/> <!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/><!-- i don't need this --> <param name="lowbal_action" value="play ding"/> <!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/> <!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/> </settings> </configuration> *outbound route* <extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension> *My balance* My balance is already negative select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com | -0.789471 *A sample call* My balance already negative, the call will be billed but never blocked Dialplan: sofia/internal/5003@company.voip.domain.com Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_account=company.voip.domain.com) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_account]=[company.voip.domain.com] EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id='company.voip.domain.com'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com (balance = -0.860504) *Using b-leg only* Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing ) <action application="bridge" data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1" /> The result is better because the pending call is hanged up when the balance reach 0. 2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com) But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer.
I use following dialplan extension. All work fine <extension name="setNibbleBillRate" continue="true"> <condition field="${destination_number}" expression="^\+7(495|499)\d+$" break="on-true"> <action application="set" data="nibble_rate=1"/> </condition> <condition field="${destination_number}" expression="^\+7800\d+$" break="on-true"> <action application="set" data="nibble_rate=0"/> </condition> <condition field="${destination_number}" expression="^\+7\d+$" break="on-true"> <action application="set" data="nibble_rate=3"/> </condition> <condition field="${destination_number}" expression="^\+\d+$" break="on-true"> <action application="set" data="nibble_rate=20"/> </condition> <condition field="${destination_number}" expression="^[a-zA-Z0-9]+$" break="on-true"> <action application="set" data="nibble_rate=0"/> <anti-action application="set" data="nibble_rate=200000000"/> </condition> </extension> <extension name="froudContol" continue="true"> <condition> <action application="nibblebill" data="flush"/> </condition> </extension> вс, 10 апр. 2016 г. в 14:22, Tanguy <phenix@vfemail.net>:
Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable )
Unfortunately that never hangup my calls using standard dial plan
*nibblebill.conf.xml*
<configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options -->
<!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/>
<!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/>
<!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/>
<!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/>
<!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/>
<!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/> <!-- i don't need this --> <param name="lowbal_action" value="play ding"/>
<!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/>
<!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/>
</settings> </configuration>
*outbound route*
<extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension>
*My balance* My balance is already negative
select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com | -0.789471
*A sample call* My balance already negative, the call will be billed but never blocked
Dialplan: sofia/internal/5003@company.voip.domain.com Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_account= company.voip.domain.com) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_account]=[ company.voip.domain.com] EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id=' company.voip.domain.com'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com (balance = -0.860504)
*Using b-leg only* Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing )
<action application="bridge" data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1" />
The result is better because the pending call is hanged up when the balance reach 0.
2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com)
But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Second extension <extension name="froudContol" continue="true"> <condition> <action application="set" data="nibble_account=${accountcode}"/> <action application="nibblebill" data="flush"/> </condition> </extension> вс, 10 апр. 2016 г. в 20:21, Sergey Safarov <s.safarov@gmail.com>:
I use following dialplan extension. All work fine
<extension name="setNibbleBillRate" continue="true"> <condition field="${destination_number}" expression="^\+7(495|499)\d+$" break="on-true"> <action application="set" data="nibble_rate=1"/> </condition> <condition field="${destination_number}" expression="^\+7800\d+$" break="on-true"> <action application="set" data="nibble_rate=0"/> </condition> <condition field="${destination_number}" expression="^\+7\d+$" break="on-true"> <action application="set" data="nibble_rate=3"/> </condition> <condition field="${destination_number}" expression="^\+\d+$" break="on-true"> <action application="set" data="nibble_rate=20"/> </condition> <condition field="${destination_number}" expression="^[a-zA-Z0-9]+$" break="on-true"> <action application="set" data="nibble_rate=0"/> <anti-action application="set" data="nibble_rate=200000000"/> </condition> </extension>
<extension name="froudContol" continue="true"> <condition>
<action application="nibblebill" data="flush"/>
</condition> </extension>
вс, 10 апр. 2016 г. в 14:22, Tanguy <phenix@vfemail.net>:
Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable )
Unfortunately that never hangup my calls using standard dial plan
*nibblebill.conf.xml*
<configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options -->
<!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/>
<!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/>
<!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/>
<!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/>
<!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/>
<!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/> <!-- i don't need this --> <param name="lowbal_action" value="play ding"/>
<!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/>
<!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/>
</settings> </configuration>
*outbound route*
<extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension>
*My balance* My balance is already negative
select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com | -0.789471
*A sample call* My balance already negative, the call will be billed but never blocked
Dialplan: sofia/internal/5003@company.voip.domain.com Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_account= company.voip.domain.com) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_account]=[ company.voip.domain.com] EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id=' company.voip.domain.com'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com (balance = -0.860504)
*Using b-leg only* Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing )
<action application="bridge" data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1" />
The result is better because the pending call is hanged up when the balance reach 0.
2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com)
But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
There is a known bug and a known patch to fix it. I can't remember right now which one it is. Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable ) Unfortunately that never hangup my calls using standard dial plan *nibblebill.conf.xml* <configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options --> <!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/> <!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/> <!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/> <!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/> <!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/> <!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/> <!-- i don't need this --> <param name="lowbal_action" value="play ding"/> <!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/> <!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/> </settings> </configuration> *outbound route* <extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension> *My balance* My balance is already negative select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com | -0.789471 *A sample call* My balance already negative, the call will be billed but never blocked Dialplan: sofia/internal/5003@company.voip.domain.com Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_account= company.voip.domain.com) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_account]=[ company.voip.domain.com] EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id=' company.voip.domain.com'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com (balance = -0.860504) *Using b-leg only* Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing ) <action application="bridge" data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1" /> The result is better because the pending call is hanged up when the balance reach 0. 2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com) But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer. _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
If there is a known bug and a patch for this, there should be a jira and a pull request for the patch Sent from my iPhone
On Apr 10, 2016, at 12:40 PM, Luis Daniel Lucio Quiroz <luis.daniel.lucio@gmail.com> wrote:
There is a known bug and a known patch to fix it. I can't remember right now which one it is.
Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable )
Unfortunately that never hangup my calls using standard dial plan
nibblebill.conf.xml
<configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options -->
<!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/>
<!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/>
<!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/>
<!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/>
<!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/>
<!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/> <!-- i don't need this --> <param name="lowbal_action" value="play ding"/>
<!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/>
<!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/>
</settings> </configuration>
outbound route
<extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension>
My balance My balance is already negative
select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com | -0.789471
A sample call My balance already negative, the call will be billed but never blocked
Dialplan: sofia/internal/5003@company.voip.domain.com Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_account=company.voip.domain.com) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_account]=[company.voip.domain.com] EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id='company.voip.domain.com'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com (balance = -0.860504)
Using b-leg only Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing )
<action application="bridge" data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1" />
The result is better because the pending call is hanged up when the balance reach 0.
2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com)
But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
There is. It is not from myself. I just don't remember it Le 10 avr. 2016 1:44 PM, "Ken Rice" <krice@freeswitch.org> a écrit :
If there is a known bug and a patch for this, there should be a jira and a pull request for the patch
Sent from my iPhone
On Apr 10, 2016, at 12:40 PM, Luis Daniel Lucio Quiroz < luis.daniel.lucio@gmail.com> wrote:
There is a known bug and a known patch to fix it. I can't remember right now which one it is. Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable )
Unfortunately that never hangup my calls using standard dial plan
*nibblebill.conf.xml*
<configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options -->
<!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/>
<!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/>
<!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/>
<!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/>
<!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/>
<!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/> <!-- i don't need this --> <param name="lowbal_action" value="play ding"/>
<!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/>
<!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/>
</settings> </configuration>
*outbound route*
<extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension>
*My balance* My balance is already negative
select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com | -0.789471
*A sample call* My balance already negative, the call will be billed but never blocked
Dialplan: sofia/internal/5003@company.voip.domain.com Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_account= company.voip.domain.com) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_account]=[ company.voip.domain.com] EXECUTE sofia/internal/5003@company.voip.domain.com set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id=' company.voip.domain.com'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com (balance = -0.860504)
*Using b-leg only* Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing )
<action application="bridge" data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1" />
The result is better because the pending call is hanged up when the balance reach 0.
2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com)
But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
If you can point me to the pull request, I can take a look and see if I can integrate it in. From: <freeswitch-users-bounces@lists.freeswitch.org<mailto:freeswitch-users-bounces@lists.freeswitch.org>> on behalf of Luis Daniel Lucio Quiroz <luis.daniel.lucio@gmail.com<mailto:luis.daniel.lucio@gmail.com>> Reply-To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org<mailto:freeswitch-users@lists.freeswitch.org>> Date: Sunday, April 10, 2016 at 11:09 AM To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org<mailto:freeswitch-users@lists.freeswitch.org>> Subject: Re: [Freeswitch-users] nibblebill do not terminate calls properly There is. It is not from myself. I just don't remember it Le 10 avr. 2016 1:44 PM, "Ken Rice" <krice@freeswitch.org<mailto:krice@freeswitch.org>> a écrit : If there is a known bug and a patch for this, there should be a jira and a pull request for the patch Sent from my iPhone On Apr 10, 2016, at 12:40 PM, Luis Daniel Lucio Quiroz <luis.daniel.lucio@gmail.com<mailto:luis.daniel.lucio@gmail.com>> wrote: There is a known bug and a known patch to fix it. I can't remember right now which one it is. Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable ) Unfortunately that never hangup my calls using standard dial plan nibblebill.conf.xml <configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options --> <!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/> <!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/> <!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/> <!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/> <!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/> <!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/> <!-- i don't need this --> <param name="lowbal_action" value="play ding"/> <!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/> <!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/> </settings> </configuration> outbound route <extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension> My balance My balance is already negative select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com<http://company.voip.mydomain.com> | -0.789471 A sample call My balance already negative, the call will be billed but never blocked Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> set(nibble_account=company.voip.domain.com<http://company.voip.domain.com>) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> SET [nibble_account]=[company.voip.domain.com<http://company.voip.domain.com>] EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com<http://company.voip.domain.com> 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com<http://company.voip.domain.com> (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id='company.voip.domain.com<http://company.voip.domain.com>'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com<http://company.voip.domain.com> (balance = -0.860504) Using b-leg only Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing ) <action application="bridge" data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1" /> The result is better because the pending call is hanged up when the balance reach 0. 2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com<http://company.voip.domain.com>) But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer. _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Sergey Thank you for your piece of dialplan but i don't think it's the solution. You offer a different solution to set the nibble_rate variable, but in my sample case this variable is properly set because the call is billed.
Luis A bug, maybe. I don't remember my freeswitch version ( i can't connect to my servers yet ) but i think it's 1.4 series.
I can try the last 1.6 version, i will also try a standard freeswitch sample configuration ( without config files provided by fusionpbx ) Quoting Darren <d@d-man.org>:
If you can point me to the pull request, I can take a look and see if I can integrate it in.
From: <freeswitch-users-bounces@lists.freeswitch.org<mailto:freeswitch-users-bounces@lists.freeswitch.org>> on behalf of Luis Daniel Lucio Quiroz <luis.daniel.lucio@gmail.com<mailto:luis.daniel.lucio@gmail.com>> Reply-To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org<mailto:freeswitch-users@lists.freeswitch.org>> Date: Sunday, April 10, 2016 at 11:09 AM To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org<mailto:freeswitch-users@lists.freeswitch.org>> Subject: Re: [Freeswitch-users] nibblebill do not terminate calls properly
There is. It is not from myself. I just don't remember it
Le 10 avr. 2016 1:44 PM, "Ken Rice" <krice@freeswitch.org<mailto:krice@freeswitch.org>> a écrit : If there is a known bug and a patch for this, there should be a jira and a pull request for the patch
Sent from my iPhone
On Apr 10, 2016, at 12:40 PM, Luis Daniel Lucio Quiroz <luis.daniel.lucio@gmail.com<mailto:luis.daniel.lucio@gmail.com>> wrote:
There is a known bug and a known patch to fix it. I can't remember right now which one it is.
Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable )
Unfortunately that never hangup my calls using standard dial plan
nibblebill.conf.xml
<configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options -->
<!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/>
<!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/>
<!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/>
<!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/>
<!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/>
<!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/> <!-- i don't need this --> <param name="lowbal_action" value="play ding"/>
<!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/>
<!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/>
</settings> </configuration>
outbound route
<extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension>
My balance My balance is already negative
select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com<http://company.voip.mydomain.com> | -0.789471
A sample call My balance already negative, the call will be billed but never blocked
Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> set(nibble_account=company.voip.domain.com<http://company.voip.domain.com>) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> SET [nibble_account]=[company.voip.domain.com<http://company.voip.domain.com>] EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/5003@company.voip.domain.com> SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com<http://company.voip.domain.com> 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com<http://company.voip.domain.com> (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id='company.voip.domain.com<http://company.voip.domain.com>'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com<http://company.voip.domain.com> (balance = -0.860504)
Using b-leg only Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing )
<action application="bridge" data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1" />
The result is better because the pending call is hanged up when the balance reach 0.
2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com<http://company.voip.domain.com>)
But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
------------------------------------------------- ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options!
I think problem in order of flush command. To take effect nibble rate must be set before execution flush. On Mon, Apr 11, 2016, 22:50 tanguy <phenix@vfemail.net> wrote:
Sergey Thank you for your piece of dialplan but i don't think it's the solution. You offer a different solution to set the nibble_rate variable, but in my sample case this variable is properly set because the call is billed.
Luis A bug, maybe. I don't remember my freeswitch version ( i can't connect to my servers yet ) but i think it's 1.4 series.
I can try the last 1.6 version, i will also try a standard freeswitch sample configuration ( without config files provided by fusionpbx )
Quoting Darren <d@d-man.org>:
If you can point me to the pull request, I can take a look and see if I can integrate it in.
From: <freeswitch-users-bounces@lists.freeswitch.org<mailto: freeswitch-users-bounces@lists.freeswitch.org>> on behalf of Luis Daniel Lucio Quiroz <luis.daniel.lucio@gmail.com<mailto:luis.daniel.lucio@gmail.com>> Reply-To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org<mailto: freeswitch-users@lists.freeswitch.org>> Date: Sunday, April 10, 2016 at 11:09 AM To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org<mailto: freeswitch-users@lists.freeswitch.org>> Subject: Re: [Freeswitch-users] nibblebill do not terminate calls properly
There is. It is not from myself. I just don't remember it
Le 10 avr. 2016 1:44 PM, "Ken Rice" <krice@freeswitch.org<mailto:krice@freeswitch.org>> a écrit : If there is a known bug and a patch for this, there should be a jira and a pull request for the patch
Sent from my iPhone
On Apr 10, 2016, at 12:40 PM, Luis Daniel Lucio Quiroz <luis.daniel.lucio@gmail.com<mailto:luis.daniel.lucio@gmail.com>> wrote:
There is a known bug and a known patch to fix it. I can't remember right now which one it is.
Hello I would like to use nibblebilling for fraud prevention on international and premium numbers ( national or emergency calls should never be blocked and should still working even if the billing database is unavailable )
Unfortunately that never hangup my calls using standard dial plan
nibblebill.conf.xml
<configuration name="nibblebill.conf" description="Nibble Billing"> <settings> <!-- See http://wiki.freeswitch.org/wiki/Mod_nibblebill for help with these options -->
<!-- Information for connecting to your database --> <param name="db_dsn" value="pgsql://hostaddr=127.0.0.1 dbname=xxxx user=xxxx password=xxxx"/>
<!-- The database table where your CASH column is located --> <param name="db_table" value="accounts"/>
<!-- The column name where we store the value of the account --> <param name="db_column_cash" value="cash"/>
<!-- The column name for the unique ID identifying the account --> <param name="db_column_account" value="id"/>
<!-- Default heartbeat interval. Set to 'off' for no heartbeat (i.e. bill only at end of call) --> <param name="global_heartbeat" value="20"/>
<!-- By default, warn a caller when their balance is at $5.00. You can set this to a negative number. --> <param name="lowbal_amt" value="-100"/> <!-- i don't need this --> <param name="lowbal_action" value="play ding"/>
<!-- By default, terminate a caller when their balance hits $0.00. You can set this to a negative number. --> <param name="nobal_amt" value="0"/> <param name="nobal_action" value="hangup"/>
<!-- If a call goes beyond a certain dollar amount, flag or terminate it --> <param name="percall_max_amt" value="10"/> <param name="percall_action" value="hangup"/>
</settings> </configuration>
outbound route
<extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="nibblebill" data="flush"/> <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension>
My balance My balance is already negative
select * from accounts ; id | cash ----------------------------------+----------- company.voip.mydomain.com<http://company.voip.mydomain.com> | -0.789471
A sample call My balance already negative, the call will be billed but never blocked
Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/ 5003@company.voip.domain.com> Action nibblebill(flush) Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/ 5003@company.voip.domain.com> Action set(nibble_account=${accountcode}) Dialplan: sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/ 5003@company.voip.domain.com> Action set(nibble_rate=0.1) EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/ 5003@company.voip.domain.com> nibblebill(flush) EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/ 5003@company.voip.domain.com> set(nibble_account=company.voip.domain.com< http://company.voip.domain.com>) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/ 5003@company.voip.domain.com> SET [nibble_account]=[company.voip.domain.com<http://company.voip.domain.com ] EXECUTE sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/ 5003@company.voip.domain.com> set(nibble_rate=0.1) 2016-04-10 12:10:04.049418 [DEBUG] mod_dptools.c:1477 sofia/internal/5003@company.voip.domain.com<mailto:sofia/internal/ 5003@company.voip.domain.com> SET [nibble_rate]=[0.1] 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com<http://company.voip.domain.com> 2016-04-10 12:10:52.132458 [INFO] mod_nibblebill.c:540 Beginning new billing on 644488fc-ff04-11e5-9a27-fd2791153af9 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:546 42 seconds passed since last bill time of 2016-04-10 12:10:09 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:563 Billing $0.071033 to company.voip.domain.com<http://company.voip.domain.com> (Call: / 0.000000 so far) 2016-04-10 12:10:52.132458 [DEBUG] mod_nibblebill.c:393 Doing update query 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:420 Doing lookup query [SELECT cash AS nibble_balance FROM accounts WHERE id='company.voip.domain.com<http://company.voip.domain.com>'] 2016-04-10 12:10:52.172440 [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account company.voip.domain.com<http://company.voip.domain.com> (balance = -0.860504)
Using b-leg only Alternatively i tried an alternative dialplan ( Even if i don't relay understand what is the meaning of b-leg billing )
<action application="bridge"
data="{enable_heartbeat_events=5,nibble_rate=0.1,nibble_account=${accountcode},originate_timeout=90}sofia/gateway/gw_idt/33$1"
/>
The result is better because the pending call is hanged up when the balance reach 0.
2016-04-10 12:39:59.012462 [CRIT] mod_nibblebill.c:607 Balance of -0.003237 fell below allowed amount of 0.000000! (Account company.voip.domain.com<http://company.voip.domain.com>)
But if i make a new call ( when my balance is negative ) , the caller party is immediately hanged but this did not cancel immediately the bridge: The called party ring and can stay bridged for 61 seconds after answer.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto: FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto: FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto: FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-------------------------------------------------
ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options!
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hello Sergey Thanks for your advice, now i can't place a new call with a negative balance [DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com [DEBUG] mod_nibblebill.c:500 Not billing account company.voip.domain.com - call is not in answered state [DEBUG] mod_nibblebill.c:420 Doing lookup query [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account account company.voip.domain.com (balance = -0.028433) [DEBUG] mod_nibblebill.c:504 Comparing -0.028433 to hangup balance of 0.000000 But currents calls are not hanged up when my balance reach 0 and the database is never updated during the call ( but only after hangup ), i probably have a issue with the "global_heartbeat" parameter. On 11/04/2016 21:59, Sergey Safarov wrote:
I think problem in order of flush command. To take effect nibble rate must be set before execution flush.
On Mon, Apr 11, 2016, 22:50 tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
> Sergey Thank you for your piece of dialplan but i don't think it's the solution. You offer a different solution to set the nibble_rate variable, but in my sample case this variable is properly set because the call is billed.
> Luis A bug, maybe. I don't remember my freeswitch version ( i can't connect to my servers yet ) but i think it's 1.4 series.
I can try the last 1.6 version, i will also try a standard freeswitch sample configuration ( without config files provided by fusionpbx )
Probable. Yes. On my servers, all work as documented in confluence. On Tue, Apr 12, 2016, 00:24 Tanguy <phenix@vfemail.net> wrote:
Hello Sergey
Thanks for your advice, now i can't place a new call with a negative balance
[DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com [DEBUG] mod_nibblebill.c:500 Not billing account company.voip.domain.com - call is not in answered state
[DEBUG] mod_nibblebill.c:420 Doing lookup query [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account account company.voip.domain.com (balance = -0.028433) [DEBUG] mod_nibblebill.c:504 Comparing -0.028433 to hangup balance of 0.000000
But currents calls are not hanged up when my balance reach 0 and the database is never updated during the call ( but only after hangup ), i probably have a issue with the "global_heartbeat" parameter.
On 11/04/2016 21:59, Sergey Safarov wrote:
I think problem in order of flush command. To take effect nibble rate must be set before execution flush.
On Mon, Apr 11, 2016, 22:50 tanguy <phenix@vfemail.net> wrote:
Sergey Thank you for your piece of dialplan but i don't think it's the solution. You offer a different solution to set the nibble_rate variable, but in my sample case this variable is properly set because the call is billed.
Luis A bug, maybe. I don't remember my freeswitch version ( i can't connect to my servers yet ) but i think it's 1.4 series.
I can try the last 1.6 version, i will also try a standard freeswitch sample configuration ( without config files provided by fusionpbx )
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hello again I tried to force heartbeat using dialplan and it's works: When the balance reach 0, my calls are hanged up and i can't place a new call. I don't understand why this did not work with *global_heartbeat* but it's not really annoying if i can bypass this. <extension name="international" > <condition field="destination_number" expression="^00(\d{6,20})$" > <action application="set" data="nibble_account=${accountcode}"/> <action application="set" data="nibble_rate=0.1"/> *<action application="nibblebill" data="heartbeat 30"/>* <action application="nibblebill" data="flush"/> <action application="bridge" data="sofia/gateway/gw_idt/$1" /> </condition> </extension> On 11/04/2016 23:55, Sergey Safarov wrote:
Probable. Yes. On my servers, all work as documented in confluence.
On Tue, Apr 12, 2016, 00:24 Tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
Hello Sergey
Thanks for your advice, now i can't place a new call with a negative balance
[DEBUG] mod_nibblebill.c:488 Attempting to bill at $0.1 per minute to account company.voip.domain.com <http://company.voip.domain.com> [DEBUG] mod_nibblebill.c:500 Not billing account company.voip.domain.com <http://company.voip.domain.com> - call is not in answered state
[DEBUG] mod_nibblebill.c:420 Doing lookup query [DEBUG] mod_nibblebill.c:428 Retrieved current balance for account account company.voip.domain.com <http://company.voip.domain.com> (balance = -0.028433) [DEBUG] mod_nibblebill.c:504 Comparing -0.028433 to hangup balance of 0.000000
But currents calls are not hanged up when my balance reach 0 and the database is never updated during the call ( but only after hangup ), i probably have a issue with the "global_heartbeat" parameter.
On 11/04/2016 21:59, Sergey Safarov wrote:
I think problem in order of flush command. To take effect nibble rate must be set before execution flush.
On Mon, Apr 11, 2016, 22:50 tanguy <phenix@vfemail.net <mailto:phenix@vfemail.net>> wrote:
> Sergey Thank you for your piece of dialplan but i don't think it's the solution. You offer a different solution to set the nibble_rate variable, but in my sample case this variable is properly set because the call is billed.
> Luis A bug, maybe. I don't remember my freeswitch version ( i can't connect to my servers yet ) but i think it's 1.4 series.
I can try the last 1.6 version, i will also try a standard freeswitch sample configuration ( without config files provided by fusionpbx )
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (6)
-
Darren
-
Ken Rice
-
Luis Daniel Lucio Quiroz
-
Sergey Safarov
-
tanguy
-
Tanguy