Category:HowTo:Advice of charge

From Snom User Wiki

Jump to: navigation, search

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

Advice of charge is implemented via an own sip header and via XML. There are different scenarios how to use.

- AOC-D - Charge Information during call via SIP INFO Messages
- AOC-E - Charge Information at the end of the call via BYE or 200 OK Message
- AOC-S - Charge Information before call - new - Snom implemented billing information in 18x messages (change ID SCPP-2201)

SIP Header

Depending of the value of the setting aoc_amount_display, the phone will either show the content of the "amount" parameter (if aoc_amount_display is set to “Charged”), or the content of the "remaining" parameter (if aoc_amount_display is set to “Balance”).

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
----------------------------------------------------- 

Example of a BYE Message:

-----------------------------------------------------
BYE sip:103@10.10.12.154:2048 SIP/2.0
Via: SIP/2.0/UDP 10.10.21.222:5060;branch=z9hG4bK-b3vir7gpi3wg;rport
From: <sip:4988@10.10.12.154>;tag=1
To: <sip:103@10.10.12.154:2048>;tag=qlgpmft8sk
Call-ID: 3c267ac0af37-4c7v47uphnv7
CSeq: 1 BYE
Max-Forwards: 70
Contact: <sip:4988@10.10.21.222:5060>;reg-id=1
AOC: charging;state=active;
 charging-info=currency;
 currency=EUR;
 amount=2000;
 multiplier=0.001
 remaining=888;
Content-Length: 0
-----------------------------------------------------

XML

Example AOC-D

INFO sip:103@10.10.12.188:5060 SIP/2.0
Via: SIP/2.0/UDP 10.10.12.159:5061;branch=z9hG4bK-1-18439@10.10.12.159;rport
From: "2110017: Thomas Test" <sip:4988@10.10.12.188>;tag=1
To: <sip:103@10.10.12.188;user=phone>;tag=pmvsivy1ju
Call-ID: 1-18439@10.10.12.159
CSeq: 3 INFO
Max-Forwards: 70
Contact: <sip:4988@10.10.12.159:5061;line=qhpks806>;reg-id=1
Content-Type: application/vnd.etsi.aoc+xml
Content-Length:   405

<?xml version="1.0" encoding="UTF-8"?>
<aoc xmlns="http://uri.etsi.org/ngn/params/xml/simservs/aoc">
 <aoc-d>
  <charging-info>subtotal</charging-info>
  <recorded-charges>
   <recorded-currency-units>
    <currency-id>EUR</currency-id>
    <currency-amount>0.1</currency-amount>
   </recorded-currency-units>
  </recorded-charges>
  <billing-id>normal-charging</billing-id>
 </aoc-d>
</aoc>

Type: Aoc-D
Type of Charging Information: subtotal (subtotal of the cost are sent to the user on an interval basis
currency-identifier: Euro
Currency-Amount: 0.05 (next INFO would be the sum
Billing Identification: Normal (no credit card e.g.)

Here the conversation cost 5 cent. In the following info would be the actual sum (0.10, 0.15, 0.20...).

Example AOC-E

<?xml version="1.0" encoding="UTF-8"?>
<aoc>
<aoc-e>
  <charging-info>total</charging-info>
  <recorded-charges>
  <recorded-currency-units>
     <currency-id>EUR</currency-id>
     <currency-amount>0.20</currency-amount>
  </recorded-currency-units></recorded-charges>
  <billing-id>normal-charging</billing-id>
</aoc-d>
</aoc>

Same as AOC-D. Only the total charging fee is shown (0.20 Euro)

Example AOC-S

Here are Billing information in the session progress sip messages.

    Received from tcp:217.7.75.80:5060 at 26/10/2010 10:15:34:074 (1829 bytes):

    SIP/2.0 183 Verbindung wird aufgebaut
    Via: SIP/2.0/TCP 217.7.73.37:5060;rport=4868;branch=z9hG4bK-hh3wny48op1l
    To: <sip:01752672679@siptrix.com;user=phone>;tag=534da310
    From: "Claudia" <sip:+4969939950408@siptrix.com>;tag=h9dhv2jctg
    Call-ID: 3980263c30a7-x17ykh5zdteu
    Contact: <sip:TASP001@217.7.75.80:5060>
    Supported: replaces
    CSeq: 2 INVITE
    Allow: ACK, BYE, CANCEL, INFO, INVITE, MESSAGE, NOTIFY, OPTIONS, PRACK, PUBLISH, REFER, REGISTER, SUBSCRIBE, UPDATE
    Content-Type: multipart/mixed;boundary=7914000df02e992c9a95efe950bd8af5
    Content-Length: 1264

    --7914000df02e992c9a95efe950bd8af5
    Content-Type: application/sdp
    Content-Disposition: session

    v=0
    o=hiQ9200 1766820100926101528 1779433502 IN IP4 217.7.75.80
    s=Phone Call via hiQ9200 SIPCA
    c=IN IP4 217.7.75.81
    t=0 0
    m=audio 9178 RTP/AVP 0 8 99 18 101
    a=rtpmap:0 PCMU/8000
    a=fmtp:0 vad=no
    a=rtpmap:8 PCMA/8000
    a=fmtp:8 vad=no
    a=rtpmap:99 G726-32/8000
    a=fmtp:99 vad=no
    a=rtpmap:18 G729/8000
    a=fmtp:18 annexb=no
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=sqn: 0
    a=sendrecv
    a=ptime:20

    --7914000df02e992c9a95efe950bd8af5
    Content-Type: application/vnd.etsi.aoc+xml
    Content-Disposition: session

    <?xml version="1.0" encoding="UTF-8"?>
    <aoc>
    <aoc-s>
    <charged-items>
    <basic>
    <price-timeType>
    <currency-id>EUR</currency-id>
    <currency-amount>0.11</currency-amount>
    <length-time-unit>
    <time-unit>750</time-unit>
    <scale>one-hundreth-second</scale>
    </length-time-unit>
    <charging-type>step-functon</charging-type>
    </price-timeType>
    </basic>
    </charged-items>
    </aoc-s>
    </aoc>

    --7914000df02e992c9a95efe950bd8af5

AOC-Type: AOC-S (before call)
charged-item: basic communication
rate expression: price-timeType (price per time unit, no flatrate, no free of charge)
currency-identifier: Euro
curency-amount: 0.11 (decimal value, price per unit)
time-unit: 750
scale: one-hundreth-seconds (from standard should be deciamal 0.01s)
charging-type: step function (charge is incurred for the time unit, or part thereof; continous = charges are incurred evenly throughout

This would mean that the conversation would cost 0.11 Euro every 7,5 seconds.

Links

[some explantions ISDN AOC]
[ETSI Definition of AOC for ISDN] [ETSI Definition for PSTN]


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.

This category currently contains no pages or media.

Personal tools
Interoperability