Asterisk (AMI interface). Параметры соединения и формат данных SMDR/CDR
Данные ниже соответствуют только программе Advanced PBX Data Logger и могут быть не применимы для других программных продуктов.
Customized configuration
Introduction
The Asterisk Manager Interface (AMI) is a client/server model over TCP. With the manager interface, you'll be able to control the PBX, originate calls, check mailbox status, monitor channels and queues as well as execute Asterisk commands.
AMI is the standard management interface into your Asterisk server. You configure AMI in manager.conf. By default, AMI is available on TCP port 5038 if you enable it in manager.conf.
Solution
You have to modify/create 'cdr_manager.conf' in the /etc/asterisk/ directory. Then enable CDR over the Manager API you must enable it in cdr_manager.conf:
;
; Asterisk Call Management CDR
;
[general]
enabled = yes
Once you have saved the file, you have to enter the Asterisk CLI. From the CLI, you will need to reload the cdr_manager.so module. Please do the following:
module reload cdr_manager.so
If you are getting an error that it is not loaded, please load this module:
module load cdr_manager.so
Then, to verify that it is loaded, please type:
cdr show status
You should see something like this:
pbx*CLI> cdr show status
Call Detail Record (CDR) settings
----------------------------------
Logging: Enabled
Mode: Simple
Log unanswered calls: No
Log congestion: No
* Registered Backends
-------------------
cdr_manager
Adaptive ODBC
cdr-custom
PBX Data Logger Settings
The logger should work in TCP client mode. The PBX being in permanent listening on port 5038, therefore you need to specify x.x.x.x:5038, where x.x.x.x should be the IP address of your PBX (e.g. 10.0.0.150).
Configuring PBX Data Logger
Our software should work in the TCP client mode. It means that our software will initiate connection with the PBX and the PBX will work as a server. Add one or several PBX IP addresses here (the IP address of the Asterisk [AMI interface]). The port number should match the port that you have defined within the PBX (5038 in the example below).
Данные, извлекаемые PBX Data Logger
Описание | Тип данных | Имя колонки |
Код абонента | string | ACC |
Конечный number | string | DIALED_PHONE |
Caller ID Name | string | FLAG1 |
Вызывающий телефон | string | CALLER_PHONE |
Тип звонка | string | CALL_TYPE |
Направление | string | DIRECTION |
Линия | string | TRUNK |
Расширение | string | EXT |
Время звонка | datetime | CALL_TIME |
Длительность звонка (sec) | integer | CALL_DURATION_S |
Длительность звонка | datetime | CALL_DURATION |
Total duration (sec) | integer | TOTAL_DURATION_S |
Длительность ожидания ответа (с) | integer | RING_S |
Длительность ожидания ответа | datetime | RING |
Идентификатор вызова | string | FLAG2 |
Замечание: Продукты и компании, указанные здесь используются только для обозначение и идентификации и могут быть торговыми и/или зарегистрированными марками соответствующих компаний.