Features/Advice of Charge (AOC)
From Snom User Wiki
Contents |
Introduction
We have two different Types of AOC:
AOC-D During Call AOC-E End of Call
There is also AOC-S, but this is left out for the moment. For a real simple implementation of SIP-AOC, the goal was that the call flow is nearly the same as in ISDN. In ISDN there a two types of charging info: Pulse and Currency. Both were needed.
AOC-D
AOC-D in ISDN is normally sent in an ISDN-Facility Message.
AOC-D with charging Info currency:
--- 1. Q932 FAC IE ---
Invoke ID : 0000 Operation: 0022 Component : 00A1
Data offset: 0004 CallRef : 7FFF CRFlag : 0000
Whole data: A1 1C 02 01 90 02 01 21 30 14 A1 0F 81 03 41 54
53 A2 08 81 03 00 07 D0 82 01 00 82 01 00
---------------------
Facility-Information-Element-Components Components ::=
invokeComp:
invokeID -112
operation-value localValue: aOCDCurrency {ccitt 4 0 182 1 33}
(AOCDCurrencyInfo): specificCurrency:
recordedCurrency
rCurrency "Eur"
rAmount
currencyAmount 2000
multplier oneThousandth
typeOfChargingInfo subTotal
---------------------
AOC-D with charging Info pulse:
--- 1. Q932 FAC IE ---
Invoke ID : 0000 Operation: 0022 Component : 00A1
Data offset: 007D CallRef : 7FFF CRFlag : 0000
Whole data: A1 14 02 01 8A 02 01 22 30 0C A1 07 30 05 02 03
00 00 02 82 01 00
---------------------
Facility-Information-Element-Components Components ::=
invokeComp:
invokeID -118
operation-value localValue: aOCDChargingUnit {ccitt 4 0 182 1 34}
(AOCDChargingUnitInfo): specificChargingUnits:
recordedUnitList
recordedNumberOfUnits: 2
typeOfChargingInfo subTotal
---------------------
As you can see, in both messages there is the typeOfChargingInfo with “subtotal”. This means, that this isn’t the last AOC-D Information. The last AOC-D Info is sent in the ISDN Release Msg as an Facility Info Element.
AOC-E
AOC-E Information is only sent at the end of a call in the ISDN-Release Msg with Facility Info Element. In AOC-E there are also both charging infos possible: pulse & currency
AOCE with charging Info Pulse:
---------------------
Facility-Information-Element-Components Components ::=
invokeComp:
invokeID -108
operation-value localValue: aOCEChargingUnit {ccitt 4 0 182 1 36}
(AOCEChargingUnitInfo):
specificChargingUnits:
recordedUnitsList
recordedNumberOfUnits: 2
---------------------
AOCE with charging Info currency:
---------------------
Facility-Information-Element-Components Components ::=
invokeComp:
invokeID -106
operation-value localValue: aOCECurrency {ccitt 4 0 182 1 35}
(AOCECurrencyInfo):
specificCurrency:
recordedCurrency
rCurrency "EUR"
rAmount
currencyAmount 1000
multplier oneThousandth
---------------------
AOC in SIP
To convert ISDN-AOC-Information we needed a new SIP Header. Header Name in SIP is “AOC”. This AOC-SIP-Header provides the ISDN structure
AOC-D Info, Currency: aOCDCurrency
AOCDCurrencyInfo: specificCurrency: recordedCurrency
rCurrency "Eur"
rAmount
currencyAmount 2000
multplier oneThousandth
typeOfChargingInfo subTotal
This is mapped to the SIP AOC Header:
AOC: type;charging-info;currency;currency-type; amount;multiplier;
AOC-D Info, Pulse:
aOCDChargingUnit
AOCDChargingUnitInfo: specificChargingUnits:
recordedUnitList
recordedNumberOfUnits: 2
typeOfChargingInfo subtotal
This is mapped to the SIP AOC Header:
AOC: charging;type;charging-info;recorded-units;
Mapping of typeOfChargingInfo is not necessary, because we have a clear mapping with INFO and BYE Message. AOC Header-Informationen has to be sent as Key Value Pairs.
Charging: Could be “charging” or “free-of-charge” or “not-available” type: could be „active“ or „terminated“. charging-info: could be „pulse“ or „currency“ currency: could be „eur“ or „usd“….. currency-type: Is the standard how the currency field is written. normally: ISO 4217-a amount: is a number between 0 and 999999 multiplier: Is from 0,001 to 1000 (stepping is 10) recorded-units: Is a number from 1 to 999999 AOC-E Info, Currency - Pulse: Is the same as in AOC-D.
Example for AOC-E:
aOCECurrency
AOCECurrencyInfo: specificCurrency:
recordedCurrency
rCurrency "Eur"
rAmount
currencyAmount 2000
multplier oneThousandth
typeOfChargingInfo subTotal
is mapped to:
INFO …..
......
…..
…..
AOC: charging;type=terminated;charging-info=currency;currency=EUR;
currency-type=iso4217-a;amount=2000;multiplier=0.001;
aOCEChargingUnit
AOCEChargingUnitInfo: specificChargingUnits:
recordedUnitList
recordedNumberOfUnits: 2
typeOfChargingInfo subtotal
is mapped to:
INFO ….. ...... ….. ….. AOC: charging;type=terminated;charging-info=pulse;recorded-units =2;
Example of an SIP-Info Message:
----------------------------------------------------- INFO sip:bla@snom.com SIP/2.0 From: <biller@snom.com>;tag=5354n3 To: <ua@snom.com>;tag=33rfh3 CSeq: 23423 INFO Call-ID: 3452tw43dt354dm03 AOC: charging;state=active; charging-info=currency; currency=EUR; amount=2000; multiplier=0.001 Content-Length: 0 -----------------------------------------------------
AOC Call Flows
AOC-D:
AOC-D Information is sent within an SIP-Info-Message after the Session is established. The last AOC-D-Info is sent in the SIP-BYE-Message if the Gateway is releasing the Call or in the SIP-200 OK if the Server is releasing the call.
AOC-E:
AOC-E Information is only sent when a Call is released.
