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