Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asterisk 11 queue log to mysql

Tags:

asterisk

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?

like image 264
Nainemom Avatar asked Jan 09 '23 10:01

Nainemom


2 Answers

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;
like image 98
viktike Avatar answered Feb 19 '23 02:02

viktike


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.

like image 40
Nir Simionovich Avatar answered Feb 19 '23 02:02

Nir Simionovich