#
rewrite_called_station_id {
if (Called-Station-Id && (Called-Station-Id =~ /^${policy.mac-addr-regexp}([^0-9a-f](.+))?$/i)) {
- request.Called-Station-Id := "%toupper(%{1}-%{2}-%{3}-%{4}-%{5}-%{6})"
+ request.Called-Station-Id := %toupper("%{1}-%{2}-%{3}-%{4}-%{5}-%{6}")
# SSID component?
- if ("%{8}") {
- request.Called-Station-SSID := "%{8}"
+ if (%{8}) {
+ request.Called-Station-SSID := %{8}
}
updated
}
#
rewrite_calling_station_id {
if (Calling-Station-Id && (Calling-Station-Id =~ /^${policy.mac-addr-regexp}$/i)) {
- request.Calling-Station-Id := "%toupper(%{1}-%{2}-%{3}-%{4}-%{5}-%{6})"
+ request.Calling-Station-Id := %toupper("%{1}-%{2}-%{3}-%{4}-%{5}-%{6}")
updated
}
# }
#
cui.authorize {
- if ("%client(add_cui)" == 'yes') {
+ if (%client('add_cui') == 'yes') {
request.Chargeable-User-Identity := 0x00
}
}
cui.post-auth {
if (!control.Proxy-To-Realm && Chargeable-User-Identity && !reply.Chargeable-User-Identity &&
(Operator-Name || ('${policy.cui_require_operator_name}' != 'yes')) ) {
- reply.Chargeable-User-Identity = "%sha1(${policy.cui_hash_key}%tolower(%{User-Name}%{Operator-Name || ''}))"
+ reply.Chargeable-User-Identity = %sha1("${policy.cui_hash_key}%tolower(%{User-Name}%{Operator-Name || ''})")
}
#
cui-inner.post-auth {
if (outer.request.Chargeable-User-Identity && \
(outer.request.Operator-Name || ('${policy.cui_require_operator_name}' != 'yes'))) {
- reply.Chargeable-User-Identity := "%sha1(${policy.cui_hash_key}%tolower(%{User-Name}%{outer.request.Operator-Name || ''}))"
+ reply.Chargeable-User-Identity := %sha1("${policy.cui_hash_key}%tolower(%{User-Name}%{outer.request.Operator-Name || ''})")
}
}
# in the DB.
#
if (!Chargeable-User-Identity) {
- request.Chargeable-User-Identity := %cuisql(\
- SELECT cui FROM cui \
- WHERE clientipaddress = '%{Net.Src.IP}' \
- AND callingstationid = '%{Calling-Station-Id}' \
- AND username = '%{User-Name}')
+ request.Chargeable-User-Identity := %cuisql("SELECT cui FROM cui WHERE clientipaddress = '%{Net.Src.IP}' AND callingstationid = '%{Calling-Station-Id}'AND username = '%{User-Name}'")
}
#
# an Operator-Name attribute
#
operator-name.authorize {
- if ("%client(Operator-Name)") {
- request.Operator-Name = "%client(Operator-Name)"
+ if ("%client('Operator-Name')") {
+ request.Operator-Name = "%client('Operator-Name')"
}
}