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