Does asterisk write to the queue log on it’s own, or do you have something that processes the log, and adds it to the database?
I have several Asterisk instances, all writing to the same database, no problem. However, not all data fields are used with every event. Some events have no data at all, some has 3-4 values.
For storage, my understanding of MySQL is, that char() fields allocate a fixed amount of storage on disk, while varchar() reserves only what is needed, they are otherwise functionally identical. But best to check with a MySQL specialist if you really need to preserve storage, to be sure. However, you can change from char() to varchar() without a problem. (But probably no storage gain either)
My table is setup like this:
CREATE TABLE `asteriskQueue_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`time` char(26) DEFAULT NULL,
`callid` varchar(255) NOT NULL DEFAULT '',
`queuename` varchar(255) NOT NULL DEFAULT '',
`agent` varchar(255) NOT NULL DEFAULT '',
`event` varchar(255) NOT NULL DEFAULT '',
`data1` varchar(255) NOT NULL DEFAULT '',
`data2` varchar(255) NOT NULL DEFAULT '',
`data3` varchar(255) NOT NULL DEFAULT '',
`data4` varchar(255) NOT NULL DEFAULT '',
`data5` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
As for res_odbc.conf it contains the following
[CDR]
enabled = yes
dsn => CDR
username => <user>
password => <pass>
pre-connect => yes
And in extconfig.conf I have this:
queue_log => odbc,CDR,asteriskQueue_log
As far as I can find, and remember, I didn’t change anything else.