Call Counters: Difference between revisions

From Yate Documentation
Jump to navigation Jump to search
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:


This module keeps a count of active calls per user specified context and adds one or all counters to be used in routing decisions. The context parameter must be generated in the [[call.cdr]] messages by the cdrbuild module.
This module keeps a count of active calls per user specified context and adds one or all counters to be used in routing decisions.<br> The context parameter must be generated in the [[call.cdr]] messages by the [[CDR Build Module|cdrbuild]] module.


===Parameters===
===Parameters===


The following parameters are interpreted in the call.cdr message:
====call.cdr====


*  chan - the ID of the call leg, always added by cdrbuild
The following parameters are interpreted in the [[call.cdr]] message:
*    direction - direction of the call leg, always added by cdrbuild
*    operation - type of CDR operation, always added by cdrbuild
*    parameter - context parameter as configured


In the call.route message:
* chan - the ID of the call leg, always added by cdrbuild
* direction - direction of the call leg, always added by cdrbuild
* operation - type of CDR operation, always added by cdrbuild
* parameter - context parameter as configured


    allcounters - local override of the configured setting to add all counters
====call.route====
    parameter - context parameter as configured, only if allcounters is not true


If allcounters is false parameter_count will be set to the current counter value. A value of zero is never set as context counters are dynamically created and removed.
In the call.route message:
 
If allcounters is true several parameter_count_context parameters will be set, each holding the current count for context.
 
Example
 
cdrbuild.conf:
[parameters]
context=false
 
callcounters.conf:
[general]
parameter=context


If there are 3 incoming calls with context=abc and 2 with context=xyz in a new call.route with context=abc it will set:
* allcounters - local override of the configured setting to add all counters. Values:
context_count=3
** false: parameter_count will be set to the current counter value. A value of zero is never set as context counters. They are dynamically created and removed.
** true: several parameter_count_context parameters will be set, each holding the current count for context.
* parameter - context parameter as configured, only if allcounters is not true


If allcounters=true then no matter the context in call.route it will set:
===Configuration===
context_count_abc=3
context_count_xyz=2


Configuration file:
File callcounters.conf:
 
callcounters.conf
  [general]
  [general]
  ; Global settings of the per context call counters
  ; Global settings of the per context call counters
Line 63: Line 48:
  ; call.route: integer: Priority of handler used to add counters to routing message
  ; call.route: integer: Priority of handler used to add counters to routing message
  ;call.route=20
  ;call.route=20
'''See also'''
* [[How to use callcounters module to count incoming calls]]
* [[Routing]]
[[Category:Routing]] [[Category:Call counters]] [[Category:CDR]]

Latest revision as of 11:11, 4 November 2013

This module keeps a count of active calls per user specified context and adds one or all counters to be used in routing decisions.
The context parameter must be generated in the call.cdr messages by the cdrbuild module.

Parameters

call.cdr

The following parameters are interpreted in the call.cdr message:

  • chan - the ID of the call leg, always added by cdrbuild
  • direction - direction of the call leg, always added by cdrbuild
  • operation - type of CDR operation, always added by cdrbuild
  • parameter - context parameter as configured

call.route

In the call.route message:

  • allcounters - local override of the configured setting to add all counters. Values:
    • false: parameter_count will be set to the current counter value. A value of zero is never set as context counters. They are dynamically created and removed.
    • true: several parameter_count_context parameters will be set, each holding the current count for context.
  • parameter - context parameter as configured, only if allcounters is not true

Configuration

File callcounters.conf:

[general]
; Global settings of the per context call counters

; parameter: string: Name of the call parameter to use for context counting
; This parameter must exist in the call.cdr messages by adding a line
;  like: context=false to the [parameters] section of cdrbuild.conf
;parameter=

; direction: string: Direction of the call legs counted, set empty to count all
;direction=incoming

; allcounters: boolean: Add all counters instead of just the current context
;allcounters=false


[priorities]
; Numerical priorities of installed message handlers

; call.cdr: integer: Priority of CDR message handler used to count calls
;call.cdr=20

; call.route: integer: Priority of handler used to add counters to routing message
;call.route=20


See also