Nainemom
Nainemom

Reputation: 143

Asterisk 11 queue log to mysql

How can i change default storage of queue log from /var/log/asterisk/queue_log file to asteriskcdrdb.queue_log table in MySQL in Asterisk 11?

Upvotes: 4

Views: 12321

Answers (2)

viktike
viktike

Reputation: 733

You should have in /etc/asterisk/extconfig.conf:

[settings]
queue_log => mysql,dsn,tablename

and in /etc/asterisk/res_config_mysql.conf:

[dsn]
dbname = database_name
dbuser = database_user
dbpass = database_pass
dbcharset = utf8
requirements = warn

The schema for the table is:

CREATE TABLE `tablename` (
  `id` bigint(255) unsigned NOT NULL AUTO_INCREMENT,
  `time` varchar(26) NOT NULL DEFAULT '',
  `callid` varchar(40) NOT NULL DEFAULT '',
  `queuename` varchar(20) NOT NULL DEFAULT '',
  `agent` varchar(20) NOT NULL DEFAULT '',
  `event` varchar(20) NOT NULL DEFAULT '',
  `data` varchar(100) NOT NULL DEFAULT '',
  `data1` varchar(40) NOT NULL DEFAULT '',
  `data2` varchar(40) NOT NULL DEFAULT '',
  `data3` varchar(40) NOT NULL DEFAULT '',
  `data4` varchar(40) NOT NULL DEFAULT '',
  `data5` varchar(40) NOT NULL DEFAULT '',
  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `queue` (`queuename`),
  KEY `event` (`event`)
) DEFAULT CHARSET=utf8;

Upvotes: 10

Nir Simionovich
Nir Simionovich

Reputation: 156

I suggest that you take a look at the following link:

http://www.voip-info.org/wiki/view/Asterisk+queue_log+on+MySQL

Bear in mind that most of these configurations are already well know, and will be documented on the www.voip-info.org wiki.

Upvotes: 2

Related Questions