So I recreated the table with a few extra fields. Not sure if this gives any further visibility on what is happening:
I created this table:
CREATE TABLE `cdr` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`calldate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`clid` VARCHAR(80) NOT NULL DEFAULT '',
`src` VARCHAR(80) NOT NULL DEFAULT '',
`dst` VARCHAR(80) NOT NULL DEFAULT '',
`dcontext` VARCHAR(80) NOT NULL DEFAULT '',
`lastapp` VARCHAR(200) NOT NULL DEFAULT '',
`lastdata` VARCHAR(200) NOT NULL DEFAULT '',
`duration` FLOAT UNSIGNED NULL DEFAULT NULL,
`billsec` FLOAT UNSIGNED NULL DEFAULT NULL,
`disposition` ENUM('ANSWERED','BUSY','FAILED','NO ANSWER','CONGESTION') NULL DEFAULT NULL,
`channel` VARCHAR(50) NULL DEFAULT NULL,
`dstchannel` VARCHAR(50) NULL DEFAULT NULL,
`amaflags` VARCHAR(50) NULL DEFAULT NULL,
`accountcode` VARCHAR(20) NULL DEFAULT NULL,
`uniqueid` VARCHAR(32) NOT NULL DEFAULT '',
`userfield` FLOAT UNSIGNED NULL DEFAULT NULL,
`answer` DATETIME NOT NULL,
`end` DATETIME NOT NULL,
PRIMARY KEY (`id`),
INDEX `calldate` (`calldate`),
INDEX `dst` (`dst`),
INDEX `src` (`src`),
INDEX `dcontext` (`dcontext`),
INDEX `clid` (`clid`),
)
This is the output from mysql:
mysql> select id,calldate,src,dst,dstchannel,answer,end from cdr;
+----+---------------------+------------+-------------+------------+---------------------+---------------------+
| id | calldate | src | dst | dstchannel | answer | end |
+----+---------------------+------------+-------------+------------+---------------------+---------------------+
| 1 | 2016-03-18 16:41:42 | 1000| 5000 | NULL | 2016-03-18 16:41:42 | 2016-03-18 16:41:45 |
| 2 | 2016-03-18 16:41:42 | 1000 | 5000 | | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |
+----+---------------------+------------+-------------+------------+---------------------+---------------------+
Notice that the dstchannel, answer and end fields are different. Any ideas?