Hello,
"i_pulse" and "f_pulse" are direct translations of the Spanish (I noticed you speak it) phrases "pulso inicial" and "pulso final", which I don't think have the same meaning in English. Updating the docs and using the proper terminology are pending matters on this module.
Both values represent the initial and interim costs of the call, in your case, it is being billed second by second (1:1), subtracting "0.000666666666666667" every second from a pool of credit that is equal to "0.0006500000".
The message that's being shown, looks like a precision loss error, which is unlikely because I used numbers even smaller than yours. Please print the values of $var(credit) and $var(cost_per_sec) before calling the cnxcc function.
Furthermore, you should also consider checking your values before passing them to the function. For example:
1. check if the credit is greater than the cost per second, *before*.
if ($var(credit) > $var(cost_per_second)) {
sl_send_reply("402", "payment required");
exit;
}
There's no reason to call the function when the conditions are not met. Cnxcc will authorize the call and hang it immediately (1 second later).
I may need to add this check myself inside the module.
2. make sure you are rejecting the call in case of module's error.
if (!cnxcc_set_max_credit("$var(client)",
"$var(credit)",
"$var(cost_per_sec)",
"$var(i_pulse)",
"$var(f_pulse)") {
sl_send_reply("503", "something's wrong in the server");
exit;
}
Regards,
Carlos