This is an old revision of the document!


mod_feature_capping.pm

Implements traffic or session time based capping defined using certain attributes that can be set at a group or user level.

Attributes

Limits, also known as capping.

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 this value is set to 0 it is taken as unlimited, or uncapped.

SMRadius-Capping-Traffic-Limit  :=  500

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 this value is set to 0 it is taken as unlimited, or uncapped.

SMRadius-Capping-Uptime-Limit  :=  500

Usage manipulation can be used to multiple the current usage to determine limits on other clients.

For instance a user with a 1G traffic limit, may have a multiplication factor of 2 on a LTE network which would result in him only being able to use 500M of traffic.

This attribute is a modifier for traffic limit. The limit for traffic will be multiplied by this value so that the effective traffic limit can be set to a portion of the total limit. Note - this attribute is commonly added to the clients as a client attribute. The advantage is being able to select a portion of users in a larger pool of users who are allowed additional traffic usage, or less traffic usage as needed.

SMRadius-Config-Capping-Traffic-Multiplier  :=  0.5

This attribute is a modifier for uptime limit. The limit for uptime will be multiplied by this value so that the effective uptime limit can be set to a portion of the total limit. Note - this attribute is commonly added to the clients as a client attribute. The advantage is being able to select a portion of users in a larger pool of users who are allowed additional uptime, or less uptime as needed.

SMRadius-Config-Capping-Uptime-Multiplier  :=  0.5

Supported v1.0.x

The same attributes are used for Traffic and Uptime, just replace $TYPE below.

Auto-topups are stored in the topups tableā€¦

               ID: 2078471
           UserID: 11391
        Timestamp: 2016-09-18 13:59:42
             Type: 5   <= The 'Type' is OR'd with the value 4
        ValidFrom: 2016-09-18 00:00:00
          ValidTo: 2016-10-01 00:00:00
            Value: 500
         Depleted: 0
SMAdminDepletedOn: NULL

Type 1 is a Traffic topup.

Type 2 is a Uptime topup.

Type 4 is a Auto-topup.

This attribute enables the $TYPE auto-topup facility. The operator used is := and the value needs to be a positive boolean either 1, true, yes.

SMRadius-AutoTopup-Traffic-Enabled  :=  yes

This is the amount per auto-topup of $TYPE. The operator used is := and the value is in minutes or Mbyte.

SMRadius-AutoTopup-Traffic-Amount  :=  500

This is the limit on the total amount of auto-topups that can be added within the current period. The operator used is := and the value is in minutes or Mbyte.

SMRadius-AutoTopup-Traffic-Amount  :=  2000

This attribute enables the notification mechanism and sets the notification means. The operator used is := and the value is the notification means, for instance an email address. This attributes' value can be comma or semicolon separated.

SMRadius-AutoTopup-Traffic-Notify  :=  joe@example.com

WIP

Configuration Attributes

The below configuration attributes are set by SMRadius.

The amount of additional traffic in Mbyte which the user can consume outside of the normal traffic limit before being disconnected and denied login. This attribute is set by the server using mod_config_sql_topups.pm.

The amount of additional uptime in minutes which the user can remain online for before being disconnected and denied login. This attribute is set by the server using mod_config_sql_topups.pm.

Supported v1.0.x

The amount of traffic added by means of auto-topup in Mbyte. This attribute is set by the server using mod_config_sql_topups.pm.

Supported v1.0.x

The amount of time added by means of auto-topup in minutes. This attribute is set by the server using mod_config_sql_topups.pm.

Hooks

post_auth_hook

Runs the checks based on attribute configuration to determine whether or not traffic or uptime limits have been reached. Runs at the post authentication stage.

post_acct_hook

Runs the checks based on attribute configuration to determine whether or not traffic or uptime limit have been reached. Runs at the post authentication stage.