1;;
2;; %CopyrightBegin%
3;;
4;; Copyright Ericsson AB 2010-2016. All Rights Reserved.
5;;
6;; Licensed under the Apache License, Version 2.0 (the "License");
7;; you may not use this file except in compliance with the License.
8;; You may obtain a copy of the License at
9;;
10;;     http://www.apache.org/licenses/LICENSE-2.0
11;;
12;; Unless required by applicable law or agreed to in writing, software
13;; distributed under the License is distributed on an "AS IS" BASIS,
14;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15;; See the License for the specific language governing permissions and
16;; limitations under the License.
17;;
18;; %CopyrightEnd%
19;;
20
21;;
22;; RFC 4006, Diameter Credit-Control Application
23;;
24
25@id 4
26
27@inherits common
28@inherits rfc4005_nas  Filter-Id
29
30;; ===========================================================================
31
32@avp_types
33
34   CC-Correlation-Id                 411    OctetString   -
35   CC-Input-Octets                   412    Unsigned64    M
36   CC-Money                          413    Grouped       M
37   CC-Output-Octets                  414    Unsigned64    M
38   CC-Request-Number                 415    Unsigned32    M
39   CC-Request-Type                   416    Enumerated    M
40   CC-Service-Specific-Units         417    Unsigned64    M
41   CC-Session-Failover               418    Enumerated    M
42   CC-Sub-Session-Id                 419    Unsigned64    M
43   CC-Time                           420    Unsigned32    M
44   CC-Total-Octets                   421    Unsigned64    M
45   CC-Unit-Type                      454    Enumerated    M
46   Check-Balance-Result              422    Enumerated    M
47   Cost-Information                  423    Grouped       M
48   Cost-Unit                         424    UTF8String    M
49   Credit-Control                    426    Enumerated    M
50   Credit-Control-Failure-Handling   427    Enumerated    M
51   Currency-Code                     425    Unsigned32    M
52   Direct-Debiting-Failure-Handling  428    Enumerated    M
53   Exponent                          429    Integer32     M
54   Final-Unit-Action                 449    Enumerated    M
55   Final-Unit-Indication             430    Grouped       M
56   Granted-Service-Unit              431    Grouped       M
57   G-S-U-Pool-Identifier             453    Unsigned32    M
58   G-S-U-Pool-Reference              457    Grouped       M
59   Multiple-Services-Credit-Control  456    Grouped       M
60   Multiple-Services-Indicator       455    Enumerated    M
61   Rating-Group                      432    Unsigned32    M
62   Redirect-Address-Type             433    Enumerated    M
63   Redirect-Server                   434    Grouped       M
64   Redirect-Server-Address           435    UTF8String    M
65   Requested-Action                  436    Enumerated    M
66   Requested-Service-Unit            437    Grouped       M
67   Restriction-Filter-Rule           438    IPFilterRule  M
68   Service-Context-Id                461    UTF8String    M
69   Service-Identifier                439    Unsigned32    M
70   Service-Parameter-Info            440    Grouped       -
71   Service-Parameter-Type            441    Unsigned32    -
72   Service-Parameter-Value           442    OctetString   -
73   Subscription-Id                   443    Grouped       M
74   Subscription-Id-Data              444    UTF8String    M
75   Subscription-Id-Type              450    Enumerated    M
76   Tariff-Change-Usage               452    Enumerated    M
77   Tariff-Time-Change                451    Time          M
78   Unit-Value                        445    Grouped       M
79   Used-Service-Unit                 446    Grouped       M
80   User-Equipment-Info               458    Grouped       -
81   User-Equipment-Info-Type          459    Enumerated    -
82   User-Equipment-Info-Value         460    OctetString   -
83   Value-Digits                      447    Integer64     M
84   Validity-Time                     448    Unsigned32    M
85
86;; ===========================================================================
87
88@messages
89
90   CCR ::= < Diameter Header: 272, REQ, PXY >
91
92           < Session-Id >
93           { Origin-Host }
94           { Origin-Realm }
95           { Destination-Realm }
96           { Auth-Application-Id }
97           { Service-Context-Id }
98           { CC-Request-Type }
99           { CC-Request-Number }
100           [ Destination-Host ]
101           [ User-Name ]
102           [ CC-Sub-Session-Id ]
103           [ Acct-Multi-Session-Id ]
104           [ Origin-State-Id ]
105           [ Event-Timestamp ]
106         * [ Subscription-Id ]
107           [ Service-Identifier ]
108           [ Termination-Cause ]
109           [ Requested-Service-Unit ]
110           [ Requested-Action ]
111         * [ Used-Service-Unit ]
112           [ Multiple-Services-Indicator ]
113         * [ Multiple-Services-Credit-Control ]
114         * [ Service-Parameter-Info ]
115           [ CC-Correlation-Id ]
116           [ User-Equipment-Info ]
117         * [ Proxy-Info ]
118         * [ Route-Record ]
119         * [ AVP ]
120
121   CCA ::= < Diameter Header: 272, PXY >
122
123           < Session-Id >
124           { Result-Code }
125           { Origin-Host }
126           { Origin-Realm }
127           { Auth-Application-Id }
128           { CC-Request-Type }
129           { CC-Request-Number }
130           [ User-Name ]
131           [ CC-Session-Failover ]
132           [ CC-Sub-Session-Id ]
133           [ Acct-Multi-Session-Id ]
134           [ Origin-State-Id ]
135           [ Event-Timestamp ]
136           [ Granted-Service-Unit ]
137         * [ Multiple-Services-Credit-Control ]
138           [ Cost-Information]
139           [ Final-Unit-Indication ]
140           [ Check-Balance-Result ]
141           [ Credit-Control-Failure-Handling ]
142           [ Direct-Debiting-Failure-Handling ]
143           [ Validity-Time]
144         * [ Redirect-Host]
145           [ Redirect-Host-Usage ]
146           [ Redirect-Max-Cache-Time ]
147         * [ Proxy-Info ]
148         * [ Route-Record ]
149         * [ Failed-AVP ]
150         * [ AVP ]
151
152;; ===========================================================================
153
154@grouped
155
156   Cost-Information ::= < AVP Header: 423 >
157
158           { Unit-Value }
159           { Currency-Code }
160           [ Cost-Unit ]
161
162   Unit-Value ::= < AVP Header: 445 >
163
164           { Value-Digits }
165           [ Exponent ]
166
167   Multiple-Services-Credit-Control ::= < AVP Header: 456 >
168
169           [ Granted-Service-Unit ]
170           [ Requested-Service-Unit ]
171         * [ Used-Service-Unit ]
172           [ Tariff-Change-Usage ]
173         * [ Service-Identifier ]
174           [ Rating-Group ]
175         * [ G-S-U-Pool-Reference ]
176           [ Validity-Time ]
177           [ Result-Code ]
178           [ Final-Unit-Indication ]
179         * [ AVP ]
180
181   Granted-Service-Unit ::= < AVP Header: 431 >
182
183           [ Tariff-Time-Change ]
184           [ CC-Time ]
185           [ CC-Money ]
186           [ CC-Total-Octets ]
187           [ CC-Input-Octets ]
188           [ CC-Output-Octets ]
189           [ CC-Service-Specific-Units ]
190         * [ AVP ]
191
192   Requested-Service-Unit ::= < AVP Header: 437 >
193
194           [ CC-Time ]
195           [ CC-Money ]
196           [ CC-Total-Octets ]
197           [ CC-Input-Octets ]
198           [ CC-Output-Octets ]
199           [ CC-Service-Specific-Units ]
200         * [ AVP ]
201
202   Used-Service-Unit ::= < AVP Header: 446 >
203
204           [ Tariff-Change-Usage ]
205           [ CC-Time ]
206           [ CC-Money ]
207           [ CC-Total-Octets ]
208           [ CC-Input-Octets ]
209           [ CC-Output-Octets ]
210           [ CC-Service-Specific-Units ]
211         * [ AVP ]
212
213   CC-Money ::= < AVP Header: 413 >
214
215           { Unit-Value }
216           [ Currency-Code ]
217
218   G-S-U-Pool-Reference ::= < AVP Header: 457 >
219
220           { G-S-U-Pool-Identifier }
221           { CC-Unit-Type }
222           { Unit-Value }
223
224   Final-Unit-Indication ::= < AVP Header: 430 >
225
226           { Final-Unit-Action }
227         * [ Restriction-Filter-Rule ]
228         * [ Filter-Id ]
229           [ Redirect-Server ]
230
231   Redirect-Server ::= < AVP Header: 434 >
232
233           { Redirect-Address-Type }
234           { Redirect-Server-Address }
235
236   Service-Parameter-Info ::= < AVP Header: 440 >
237
238           { Service-Parameter-Type }
239           { Service-Parameter-Value }
240
241   Subscription-Id ::= < AVP Header: 443 >
242
243           { Subscription-Id-Type }
244           { Subscription-Id-Data }
245
246   User-Equipment-Info ::= < AVP Header: 458 >
247
248           { User-Equipment-Info-Type }
249           { User-Equipment-Info-Value }
250
251;; ===========================================================================
252
253@enum CC-Request-Type
254
255   INITIAL_REQUEST                 1
256   UPDATE_REQUEST                  2
257   TERMINATION_REQUEST             3
258   EVENT_REQUEST                   4
259
260@enum CC-Session-Failover
261
262   NOT_SUPPORTED                   0
263   SUPPORTED                       1
264
265@enum Check-Balance-Result
266
267   ENOUGH_CREDIT                   0
268   NO_CREDIT                       1
269
270@enum Credit-Control
271
272   AUTHORIZATION                   0
273   RE_AUTHORIZATION                1
274
275@enum Credit-Control-Failure-Handling
276
277   TERMINATE                       0
278   CONTINUE                        1
279   RETRY_AND_TERMINATE             2
280
281@enum Direct-Debiting-Failure-Handling
282
283   TERMINATE_OR_BUFFER             0
284   CONTINUE                        1
285
286@enum Tariff-Change-Usage
287
288   UNIT_BEFORE_TARIFF_CHANGE       0
289   UNIT_AFTER_TARIFF_CHANGE        1
290   UNIT_INDETERMINATE              2
291
292@enum CC-Unit-Type
293
294   TIME                            0
295   MONEY                           1
296   TOTAL-OCTETS                    2
297   INPUT-OCTETS                    3
298   OUTPUT-OCTETS                   4
299   SERVICE-SPECIFIC-UNITS          5
300
301@enum Final-Unit-Action
302
303   TERMINATE                       0
304   REDIRECT                        1
305   RESTRICT_ACCESS                 2
306
307@enum Redirect-Address-Type
308
309   IPV4                            0
310   IPV6                            1
311   URL                             2
312   SIP_URI                         3
313
314@enum Multiple-Services-Indicator
315
316   NOT_SUPPORTED                   0
317   SUPPORTED                       1
318
319@enum Requested-Action
320
321   DIRECT_DEBITING                 0
322   REFUND_ACCOUNT                  1
323   CHECK_BALANCE                   2
324   PRICE_ENQUIRY                   3
325
326@enum Subscription-Id-Type
327
328   END_USER_E164                   0
329   END_USER_IMSI                   1
330   END_USER_SIP_URI                2
331   END_USER_NAI                    3
332   END_USER_PRIVATE                4
333
334@enum User-Equipment-Info-Type
335
336   IMEISV                          0
337   MAC                             1
338   EUI64                           2
339   MODIFIED_EUI64                  3
340
341;; ===========================================================================
342
343@define Result-Code
344
345   END_USER_SERVICE_DENIED         4010
346   CREDIT_CONTROL_NOT_APPLICABLE   4011
347   CREDIT_LIMIT_REACHED            4012
348
349   USER_UNKNOWN                    5030
350   RATING_FAILED                   5031
351