Hi Carlos

This my kamailio config:

#!ifdef CNXCC_MONEY
sql_query("ca", "select * from  billing.sel_customer_credit('pepe','xxxxxxx","ra");

xlog("L_INFO", "Setting up money based credit control");

if($dbr(ra=>rows)> 0){
xlog("L_INFO", "saldo:$dbr(ra=>[0,0]) y seg:$dbr(ra=>[0,1]) ");

$var(credit) = $dbr(ra=>[0,0]); # 30$ of credit
$var(cost_per_sec) = $dbr(ra=>[0,1]); # 1$ per sec
$var(i_pulse) = "1"; # 1$ to establish the call
$var(f_pulse) = "1"; # 1$ per second


}

sql_result_free ("ra");

# if only one call is established, that call should last 9 seconds.

if (!cnxcc_set_max_credit("$var(client)",
"$var(credit)",
"$var(cost_per_sec)",
"$var(i_pulse)",



And this are the values by syslog info

INFO: <script>: saldo:0.0006500000 y seg:0.000666666666666667
ERROR: cnxcc [cnxcc_mod.c:1425]: set_max_credit(): credit value must be > 0: 0.000000



                 


On Fri, May 9, 2014 at 3:08 PM, Carlos Ruiz Díaz <carlos.ruizdiaz@gmail.com> wrote:
Hi,

Can you paste the code you are using, with the values that each variable contain at the moment of initiating the call?

Regards,


On Fri, May 9, 2014 at 2:35 PM, Rene Montilva <renemontilva@gmail.com> wrote:
Hi list

I don't understand prepaid logic calculation, because when my credit is 0 or lees than cost per second, the call is established equal

$var(i_pulse) and $var(f_pulse) how this works????



_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




--

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users