Asterisk config sirrix.conf AOC Engine

AOC (Advice of Charge) Engine


The Sirrix.PCI channel driver includes a AOC (Advice of Charge) engine for both receiving (in TE mode) and sending AOC messages on Sirrix.PCI ports (NT mode). The current implementation supports AOCD (AOC During the Call) only.


Reception (TE Mode)


Received AOC information is stored automatically in CDR variables. The CDR variables can be written to a file using cdr_custom.conf.

The following CDR variables are available:

aocamount
AOC amount received last. This is an integer number which has to be multiplied by the value in "aocmultiplier"


aocmultiplier
AOC multiplier received last. This is any of the following strings:

  • 0.001
  • 0.01
  • 0.1
  • 1
  • 10
  • 100
  • 1000

The multiplier is not set (empty) when units are received (and aoccurrency is set to "units").


aoccurrency
AOC currency received last (e. g. "EUR"). Can also contain one of the following special strings:

  • n/a
    If we received the information that AOC is not available.
  • free
    If the call was free.
  • units
    If we did not receive AOC currency but AOC units.


Example entry for cdr_custom.conf (all in one line!):


AOC.csv => "${CDR(start)}","${CDR(src)}","${CDR(dst)}","${CDR(duration)}", "${CDR(aocamount)}","${CDR(aocmultiplier)}","${CDR(aoccurrency)}"




Sending (NT Mode)


The AOC engine can easily be configured by using channel variables which can be set in the Asterisk dialplan. The type of AOC information sent out to the device depends on the group settings "aocd" and "aoc_unit" in sirrix.conf. Please see README.config on details on how to configure these settings.

The AOC sending engine can be configured independently from the group setting in sirrix.conf. The channel driver automatically recalculates AOC currency to units and vice-versa. The calculated amount of units is always rounded up while the currency is calculated with maximum precision.


Channel Variables


AOC_TYPE (o) = { "not available", "free", "currency", "units" }

  • "currency"

    AOC_AMOUNT (x) : FLOATING POINT (max. 3 decimal digits) + STRING
    Amount of currency for single cycle and currency string.
    • Example: "1.234 EUR"

    AOC_SUM (x) : FLOATING POINT (max. 3 decimal digits) + STRING
    Accumulated currency for call and currency string. Automatically set and updated by the AOC engine!
    • Example: "1.234 EUR"

  • "units"

    AOC_AMOUNT (x) : INTEGER
    Amount of units for single cycle.
    • Example: "10"

    AOC_SUM (x) : INTEGER
    Accumulated amount of units for call. Automatically set and updated by the AOC engine!

AOC_DURATION (x) : INTEGER
Duration of single cycle in seconds, e. g. "30". Setting the duration to "0" disables AOC after the running cycle has completed. This variable must be set prior to connection of the call in order to activate AOC engine. The AOC engine automatically stops after completing the running cycle if AOC_DURATION is unset or set to "0"; it is not possible to restart the AOC engine for the active call then!


(o) This variable shall not be changed during the call.
(x) This variable may be updated during the call to adapt to changing charging times and prices. Updates are considered when the running cycle has completed.


Dialplan Example



exten => 100,1,Set(AOC_TYPE=currency) ; we define as currency
exten => 100,n,Set(AOC_DURATION=30) ; cycle time of 30 seconds
exten => 100,n,Set(AOC_AMOUNT=0.061 EUR) ; 0.061 EUR per cycle
exten => 100,n,Dial(...) ; AOC starts with answer

exten => 200,1,Set(AOC_TYPE=units) ; we define as units
exten => 200,n,Set(AOC_DURATION=10) ; cycle time of 10 seconds
exten => 200,n,Set(AOC_AMOUNT=2) ; 2 units per cycle
exten => 200,n,Dial(...) ; AOC starts with answer

exten => 300,1,Set(AOC_TYPE=free) ; free call
exten => 300,n,Dial(...) ; dial destination




Manager Example


The defined AOC time slots can easily be changed using the Asterisk Manager interface. Please see the Asterisk documentation about changing dialplan variables at call time.

Asterisk Manager API
Asterisk Manager API Action SetVar





See Also


Previous: Asterisk Channel Variables
Next: Asterisk CallerID Name DB
Index: Asterisk Sirrix ISDN channels

AOC (Advice of Charge) Engine


The Sirrix.PCI channel driver includes a AOC (Advice of Charge) engine for both receiving (in TE mode) and sending AOC messages on Sirrix.PCI ports (NT mode). The current implementation supports AOCD (AOC During the Call) only.


Reception (TE Mode)


Received AOC information is stored automatically in CDR variables. The CDR variables can be written to a file using cdr_custom.conf.

The following CDR variables are available:

aocamount
AOC amount received last. This is an integer number which has to be multiplied by the value in "aocmultiplier"


aocmultiplier
AOC multiplier received last. This is any of the following strings:

  • 0.001
  • 0.01
  • 0.1
  • 1
  • 10
  • 100
  • 1000

The multiplier is not set (empty) when units are received (and aoccurrency is set to "units").


aoccurrency
AOC currency received last (e. g. "EUR"). Can also contain one of the following special strings:

  • n/a
    If we received the information that AOC is not available.
  • free
    If the call was free.
  • units
    If we did not receive AOC currency but AOC units.


Example entry for cdr_custom.conf (all in one line!):


AOC.csv => "${CDR(start)}","${CDR(src)}","${CDR(dst)}","${CDR(duration)}", "${CDR(aocamount)}","${CDR(aocmultiplier)}","${CDR(aoccurrency)}"




Sending (NT Mode)


The AOC engine can easily be configured by using channel variables which can be set in the Asterisk dialplan. The type of AOC information sent out to the device depends on the group settings "aocd" and "aoc_unit" in sirrix.conf. Please see README.config on details on how to configure these settings.

The AOC sending engine can be configured independently from the group setting in sirrix.conf. The channel driver automatically recalculates AOC currency to units and vice-versa. The calculated amount of units is always rounded up while the currency is calculated with maximum precision.


Channel Variables


AOC_TYPE (o) = { "not available", "free", "currency", "units" }

  • "currency"

    AOC_AMOUNT (x) : FLOATING POINT (max. 3 decimal digits) + STRING
    Amount of currency for single cycle and currency string.
    • Example: "1.234 EUR"

    AOC_SUM (x) : FLOATING POINT (max. 3 decimal digits) + STRING
    Accumulated currency for call and currency string. Automatically set and updated by the AOC engine!
    • Example: "1.234 EUR"

  • "units"

    AOC_AMOUNT (x) : INTEGER
    Amount of units for single cycle.
    • Example: "10"

    AOC_SUM (x) : INTEGER
    Accumulated amount of units for call. Automatically set and updated by the AOC engine!

AOC_DURATION (x) : INTEGER
Duration of single cycle in seconds, e. g. "30". Setting the duration to "0" disables AOC after the running cycle has completed. This variable must be set prior to connection of the call in order to activate AOC engine. The AOC engine automatically stops after completing the running cycle if AOC_DURATION is unset or set to "0"; it is not possible to restart the AOC engine for the active call then!


(o) This variable shall not be changed during the call.
(x) This variable may be updated during the call to adapt to changing charging times and prices. Updates are considered when the running cycle has completed.


Dialplan Example



exten => 100,1,Set(AOC_TYPE=currency) ; we define as currency
exten => 100,n,Set(AOC_DURATION=30) ; cycle time of 30 seconds
exten => 100,n,Set(AOC_AMOUNT=0.061 EUR) ; 0.061 EUR per cycle
exten => 100,n,Dial(...) ; AOC starts with answer

exten => 200,1,Set(AOC_TYPE=units) ; we define as units
exten => 200,n,Set(AOC_DURATION=10) ; cycle time of 10 seconds
exten => 200,n,Set(AOC_AMOUNT=2) ; 2 units per cycle
exten => 200,n,Dial(...) ; AOC starts with answer

exten => 300,1,Set(AOC_TYPE=free) ; free call
exten => 300,n,Dial(...) ; dial destination




Manager Example


The defined AOC time slots can easily be changed using the Asterisk Manager interface. Please see the Asterisk documentation about changing dialplan variables at call time.

Asterisk Manager API
Asterisk Manager API Action SetVar





See Also


Previous: Asterisk Channel Variables
Next: Asterisk CallerID Name DB
Index: Asterisk Sirrix ISDN channels

Created by: sirrix, Last modification: Thu 05 of Apr, 2007 (08:44 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+