@@ -40,7 +40,7 @@ cui_require_operator_name = "no"
4040#
4141cui.authorize {
4242 if ("%client(add_cui)" == 'yes') {
43- & request.Chargeable-User-Identity := 0x00
43+ request.Chargeable-User-Identity := 0x00
4444 }
4545}
4646
@@ -52,9 +52,9 @@ cui.authorize {
5252# use_tunneled_reply parameter MUST be set to yes
5353#
5454cui.post-auth {
55- if (!& control.Proxy-To-Realm && & Chargeable-User-Identity && !& reply.Chargeable-User-Identity &&
56- (& Operator-Name || ('${policy.cui_require_operator_name}' != 'yes')) ) {
57- & reply.Chargeable-User-Identity = "%sha1(${policy.cui_hash_key}%tolower(%{User-Name}%{& Operator-Name || ''}))"
55+ if (!control.Proxy-To-Realm && Chargeable-User-Identity && !reply.Chargeable-User-Identity &&
56+ (Operator-Name || ('${policy.cui_require_operator_name}' != 'yes')) ) {
57+ reply.Chargeable-User-Identity = "%sha1(${policy.cui_hash_key}%tolower(%{User-Name}%{Operator-Name || ''}))"
5858 }
5959
6060 #
@@ -65,19 +65,19 @@ cui.post-auth {
6565 # If your NAS can do CUI based accounting themselves or you do not care about
6666 # accounting, comment out the 'cuisql' line below.
6767 #
68- if (& reply.Chargeable-User-Identity) {
68+ if (reply.Chargeable-User-Identity) {
6969 # Force User-Name to be the User-Name from the request
70- & reply.User-Name := &request.User-Name
70+ reply.User-Name := &request.User-Name
7171
7272 cuisql
7373 }
7474}
7575
7676
7777cui-inner.post-auth {
78- if (& outer.request.Chargeable-User-Identity && \
79- (& outer.request.Operator-Name || ('${policy.cui_require_operator_name}' != 'yes'))) {
80- & reply.Chargeable-User-Identity := "%sha1(${policy.cui_hash_key}%tolower(%{User-Name}%{& outer.request.Operator-Name || ''}))"
78+ if (outer.request.Chargeable-User-Identity && \
79+ (outer.request.Operator-Name || ('${policy.cui_require_operator_name}' != 'yes'))) {
80+ reply.Chargeable-User-Identity := "%sha1(${policy.cui_hash_key}%tolower(%{User-Name}%{outer.request.Operator-Name || ''}))"
8181 }
8282}
8383
@@ -92,8 +92,8 @@ cui.accounting {
9292 # If the CUI isn't in the packet, see if we can find it
9393 # in the DB.
9494 #
95- if (!& Chargeable-User-Identity) {
96- & request.Chargeable-User-Identity := %cuisql(\
95+ if (!Chargeable-User-Identity) {
96+ request.Chargeable-User-Identity := %cuisql(\
9797 SELECT cui FROM cui \
9898 WHERE clientipaddress = '%{Net.Src.IP}' \
9999 AND callingstationid = '%{Calling-Station-Id}' \
@@ -104,7 +104,7 @@ cui.accounting {
104104 # If it exists now, then write out when we last saw
105105 # this CUI.
106106 #
107- if (& Chargeable-User-Identity && (& Chargeable-User-Identity != '')) {
107+ if (Chargeable-User-Identity && (Chargeable-User-Identity != '')) {
108108 cuisql
109109 }
110110}
0 commit comments