call history + odbc_cdr

Hi! Will call history works with cdr_odbc? I try, but history is empty
'src' and 'dst' fields exists in table

Comments

  • driver (odbc or mysql) does not matter, but you might want to look at the cdr table schema, and database and table names (That you can set in config.php).

    Best regards,
  • The tables is different. I use cdr adaptive odbc with default asterisk schema (asterisk cert 13.8). Its because cdr_mysql is market as depricated.
    We want to buy asternic cdr report too. Do we have to go back to cdr mysql or we can use odbc?

  • Its ODBC
    CREATE TABLE `cdr` (
    `accountcode` varchar(20) DEFAULT NULL,
    `src` varchar(80) DEFAULT NULL,
    `dst` varchar(80) DEFAULT NULL,
    `dcontext` varchar(80) DEFAULT NULL,
    `clid` varchar(80) DEFAULT NULL,
    `channel` varchar(80) DEFAULT NULL,
    `dstchannel` varchar(80) DEFAULT NULL,
    `lastapp` varchar(80) DEFAULT NULL,
    `lastdata` varchar(80) DEFAULT NULL,
    `start` datetime DEFAULT NULL,
    `answer` datetime DEFAULT NULL,
    `end` datetime DEFAULT NULL,
    `duration` int(11) DEFAULT NULL,
    `billsec` int(11) DEFAULT NULL,
    `disposition` varchar(45) DEFAULT NULL,
    `amaflags` varchar(45) DEFAULT NULL,
    `userfield` varchar(256) DEFAULT NULL,
    `uniqueid` varchar(150) DEFAULT NULL,
    `linkedid` varchar(150) DEFAULT NULL,
    `peeraccount` varchar(20) DEFAULT NULL,
    `sequence` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    --
    -- Дамп данных таблицы `cdr`
    --

    INSERT INTO `cdr` (`accountcode`, `src`, `dst`, `dcontext`, `clid`, `channel`, `dstchannel`, `lastapp`, `lastdata`, `start`, `answer`, `end`, `duration`, `billsec`, `disposition`, `amaflags`, `userfield`, `uniqueid`, `linkedid`, `peeraccount`, `sequence`) VALUES
    (NULL, NULL, '17710', 'incom', '"user101" <>', 'IAX2/user101-15651', 'IAX2/user151-21434', 'Dial', 'IAX2/user151/10,40', '2016-12-21 17:08:37', '2016-12-21 17:08:37', '2016-12-21 17:09:17', 40, 40, 'NO ANSWER', 'DOCUMENTATION', NULL, 'List-1482329317.9312', 'List-1482329317.9312', NULL, 1070);

    and MySQL schema

    CREATE TABLE `cdr_old` (
    `id` int(11) NOT NULL,
    `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 '',
    `channel` varchar(80) NOT NULL DEFAULT '',
    `dstchannel` varchar(80) NOT NULL DEFAULT '',
    `lastapp` varchar(80) NOT NULL DEFAULT '',
    `lastdata` varchar(80) NOT NULL DEFAULT '',
    `duration` int(11) NOT NULL DEFAULT '0',
    `billsec` int(11) NOT NULL DEFAULT '0',
    `disposition` varchar(45) NOT NULL DEFAULT '',
    `amaflags` int(11) NOT NULL DEFAULT '0',
    `accountcode` varchar(20) NOT NULL DEFAULT '',
    `userfield` varchar(255) NOT NULL DEFAULT '',
    `uniqueid` varchar(32) NOT NULL DEFAULT ''
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

    --
    -- Дамп данных таблицы `cdr_old`
    --

    INSERT INTO `cdr_old` (`id`, `calldate`, `clid`, `src`, `dst`, `dcontext`, `channel`, `dstchannel`, `lastapp`, `lastdata`, `duration`, `billsec`, `disposition`, `amaflags`, `accountcode`, `userfield`, `uniqueid`) VALUES
    (1, '2015-12-20 18:09:57', '"1001" <1001>', '1001', '7170', 'incom', 'OOH323/cisco', '', 'Dial', '', 3, 3, 'ANSWERED', 3, 'ast_h323', '', 'asterisk_list-1450624197.0');

  • Try to edit calldetailrecords.php and set $datefield to the value corresponding to your schema (start), instead of the default 'calldate'.

    You can set that around line 18 of such script.

    Best regards,
  • I will try tomorrow, thank you!
    What aboute odbc schema and asternic cdr report? Will it work?
  • In Asternic CDR Standalone, in config.php you can configure the $DATEFIELD to be 'start' , so it should work.
  • Its works, but 'View record' page is still empty (In mysql schema it was empty too)..
  • Its printscreen
  • You can enable debug in config.php and see if you get some errors. It is not possible for me to test locally.
  • I get this:

    notice
    /var/www/html/fop2/lib/dblib.php (line 59)

    mysqli::mysqli(): Headers and client library minor version mismatch. Headers:50550 Library:50635
    notice
    /var/www/html/fop2/calldetailrecords.php (line 241)

    Undefined index: filterdir
    notice
    /var/www/html/fop2/calldetailrecords.php (line 260)

    Undefined index: filterdispo
    View Record
    notice
    /var/www/html/fop2/lib/dblib.php (line 356)

    mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
  • hmmm, this:

    Headers and client library minor version mismatch. Headers:50550 Library:50635

    seems to indicate that you have conflicting packages/versions installed for mysql and libaries.... maybe the problem is a result of that mismatch. You will have to be sure you have same version of mysql-xx everything installed.

  • edited December 2016
    I think, the problem is here
    /var/www/html/fop2/lib/dblib.php (line 356)

    mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given

    i.e. mysqli_num_rows(this->result), this->result doesnt contain mysqli_result data. Plese show, where its colled in detail record.
    PS. When I comment this function and return 1 instead, I see "cancel" button on detail record page. The problem is here.
  • The problem was solved by
    diff tmp/dbgrid.php lib/dbgrid.php
    2618c2618
    <         $res = $this->link->consulta("SELECT $this->fields FROM %s %s WHERE %s = %s %s",$this->table,$joinstring,$this->table.".".$this->pk,$id, $this->groupby);
    ---
    >         $res = $this->link->consulta("SELECT $this->fields FROM %s %s WHERE %s = '%s' %s",$this->table,$joinstring,$this->table.".".$this->pk,$id, $this->groupby);
    
Sign In or Register to comment.