Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
mod_feature_capping.pm [2016-09-19 19:51] – [SMRadius-AutoTopup-$TYPE-NotifyTemplate] wikiadminmod_feature_capping.pm [2017-02-03 08:20] – [SMRadius-AutoTopup-$TYPE-NotifyTemplate] nkukard
Line 2: Line 2:
  
 Implements traffic or session time based capping defined using certain attributes that can be set at a group or user level. Implements traffic or session time based capping defined using certain attributes that can be set at a group or user level.
 +
 +====== Config File ======
 +
 +The following section is supported in the ''smradiusd.conf'' configuration file.
 +===== [mod_feature_capping] =====
 +
 +==== enable_mikrotik ====
 +
 +Enable Mikrotik specific attributes to allow better control of capping and traffic control by setting session limits.
 +<code>
 +enable_mikrotik=yes
 +</code>
 +
 +==== caveat_captrafzero ====
 +
 +<btn type="success" size="xs">Supported <badge>v1.0.x</badge></btn>
 +
 +Enable the captrafzero caveat. This will swap the meaning of 0 and undef on traffic capping limits. There was a logic error prior to v1.0.x.
 +<code>
 +caveat_captrafzero=yes
 +</code>
  
 ====== Attributes ====== ====== Attributes ======
Line 12: Line 33:
 Defines a maximum traffic usage allowed. This value is in Mbyte. Defines a maximum traffic usage allowed. This value is in Mbyte.
  
-If unset, this value is taken as undefined which translates to 0, this means prepaid.+If unset, this value is unlimited.
  
-If this value is set to 0 it is taken as unlimitedor uncapped.+If this value is set to 0, topups must be added.
  
 <code> <code>
Line 24: Line 45:
 Defines a maximum session time allowed. This value is in minutes. Defines a maximum session time allowed. This value is in minutes.
  
-If unset, this value is taken as undefined which translates to 0, this means prepaid.+If unset, this value is unlimited.
  
-If this value is set to 0 it is taken as unlimitedor uncapped.+If this value is set to 0, topups must be added.
  
 <code> <code>
Line 112: Line 133:
 ==== SMRadius-AutoTopup-$TYPE-NotifyTemplate ==== ==== SMRadius-AutoTopup-$TYPE-NotifyTemplate ====
  
-WIP+The template parsing is done using [[http://www.template-toolkit.org/|Template::Toolkit]]. 
 + 
 +Supported macro's include: 
 +  * user.ID 
 +  * user.username 
 +  * usage.total 
 +  * usage.limit 
 +  * autotopup.amount 
 +  * autotopup.limit 
 +  * autotopup.added 
 +  * autotopup.toAdd (if this is 0, it means additional auto-topups cannot be added) 
 +  * autotopup.toAddAmount 
 + 
 +Example below... 
 +<code> 
 +To: [% notify.target %] 
 +From: Test ISP <isp\@example.com> 
 +Subject: [Test ISP] Your account [% user.username %] 
 + 
 +[% IF autotopup.toAdd %] 
 +Please note that you have [% usage.limit - usage.total %]Mbyte available on username [% user.username %]. We added another [% autotopup.toAdd %] automatic topup(s) totalling [% autotopup.toAddAmount %]Mbyte to your username. Your automatic topup usage is [% autotopup.added + autotopup.toAddAmount %]Mbyte of [% autotopup.limit ? autotopup.limit : '-no-limit-' %]Mbyte. 
 +[% ELSE %] 
 +We cannot add another [% autotopup.amount %]Mbyte to your username as you have reached your automatic topup limit of [% autotopup.limit %]Mbyte. Your total usage is [% usage.total %]Mbyte. 
 +[% END %] 
 + 
 +Regards 
 +Your Test ISP 
 +Support: +1 555 555 555 
 +</code>
  
 ==== SMRadius-AutoTopup-$TYPE-Threshold ==== ==== SMRadius-AutoTopup-$TYPE-Threshold ====