Module: kamailio Branch: master Commit: 4d045438c4451cfc70e995344a2cfb42eb0ccb30 URL: https://github.com/kamailio/kamailio/commit/4d045438c4451cfc70e995344a2cfb42...
Author: Kamailio Dev kamailio.dev@kamailio.org Committer: Kamailio Dev kamailio.dev@kamailio.org Date: 2019-12-19T18:31:12+01:00
modules: readme files regenerated - cnxcc ... [skip ci]
---
Modified: src/modules/cnxcc/README
---
Diff: https://github.com/kamailio/kamailio/commit/4d045438c4451cfc70e995344a2cfb42... Patch: https://github.com/kamailio/kamailio/commit/4d045438c4451cfc70e995344a2cfb42...
---
diff --git a/src/modules/cnxcc/README b/src/modules/cnxcc/README index d2e317de72..425a473f16 100644 --- a/src/modules/cnxcc/README +++ b/src/modules/cnxcc/README @@ -188,18 +188,32 @@ modparam("cnxcc", "credit_check_period", 1)
Associates the call with a customer id and sets the max credit, connect cost, cost per second, initial pulse and final pulse. The discount is - calculated in pulses (30/6, 1/1, etc) and subtracted from the pool of + calculated in pulses (1/1, 60/1, etc) and subtracted from the pool of credit.
The customer value can be provided as a string or a variable holding a - string. + string. This value identifies all calls from the same customer. + + The maxcredit (float) value is the maximum credit available for the + current call. + + The connect (float) value is the connect cost for the current call. + + The cps (float) value is the cost per second for the current call. + + The ipuse (integer) value is the initial pulse and establishes the + minimum time to be charged. For example, value 1 establishes a charge + per second and value 60 sets a charge per minute. If it is taken as + value 60, even if the duration is 5 seconds, 1 minute will be charged.
- The maxcredit, connect and cps can be double (float) or integer values, - they have to be provided as static string values of variables holding - string values. + The fpulse (integer) value is the final pulse and establishes, from the + initial pulse, the time range to be charged. For example, the value 1 + establishes a charge per second, 5 sets a charge in blocks of 5 + seconds, 60 sets a full minute charge.
- The ipulse and fpulse values are integer values, they can be also given - via variables holding integers. + 1/1 will make a charge per seconds for the entire call. 60/1 will make + a charge per seconds with the first full minute. 60/60 always perform a + full minute charge.
Return code: * 1 - successful @@ -210,12 +224,15 @@ modparam("cnxcc", "credit_check_period", 1) ... cnxcc_set_max_credit("john-doe", "100", "3.0", "0.5", 60, 1); ... -$var(customer) = "john-doe-premium"; # customer id -$var(credit) = "100"; # max credit -$var(connect) = "3.0"; # connect const -$var(cps) = "0.5"; # cost per second -$var(initial_p) = 60; # initial pulse -$var(final_p) = 1; # final pulse +$var(customer) = "john-doe"; # customer id +$var(credit) = "100"; # max credit for all calls with the same + # customer id +$var(connect) = "3.0"; # connect cost or initial cost for the call +$var(cps) = "0.5"; # cost per second +$var(initial_p) = 60; # initial pulse (60 = the first minute will be + # charged even if the call is shorter) +$var(final_p) = 1; # final pulse (after the first minute, it will + # be charge in ranges of 1 second) cnxcc_set_max_credit("$var(customer)", "$var(credit)", "$var(connect)", "$var(cps)", "$var(initial_p)", "$var(final_p)"); ...