Carlos

Member

Last active 5 years ago

  1. 5 years ago
    Fri Jan 31 20:55:29 2014

    Hey,

    I too was looking for this functionality, and Nicolas recommended me to try out your modifications.

    After patching the code it now works perfectly. Thanks a lot!

    Carlos

  2. Sun Jan 26 21:26:26 2014

    Hello again,

    Thanks for your answer. It turns out it was a permission issue as suspected. After granting the fop2 user access to the asteriskcdrdb database with the following command:
    GRANT ALL PRIVILEGES ON asteriskcdrdb.* to fop2@'localhost' identified by 'password';
    it now works perfectly!

    Best regards,
    Carlos

  3. Fri Jan 24 21:41:37 2014

    Thank you for your answer Nicolas !

    So I created the asteriskcdrdb database:

    CREATE DATABASE asteriskcdrdb;

    Added the user:

    GRANT INSERT, SELECT ON asteriskcdrdb.* TO asteriskcdruser@'localhost' IDENTIFIED BY 'XXXXXXXXX';

    Created the necessary table and columns:

    CREATE TABLE `cdr` (
    `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 '',
    `uniqueid` VARCHAR(32) NOT NULL default '',
    `userfield` VARCHAR(255) NOT NULL default '',
    `peeraccount` VARCHAR(20) NOT NULL default '',
    `linkedid` VARCHAR(32) NOT NULL default '',
    `sequence` int(11) NOT NULL default '0'
    );

    ALTER TABLE `cdr` ADD INDEX ( `calldate` );
    ALTER TABLE `cdr` ADD INDEX ( `dst` );
    ALTER TABLE `cdr` ADD INDEX ( `accountcode` );

    Then edited cdr_mysql.conf for the right credentials.

    Everything seems to be working:

    asterisk*CLI> cdr mysql status
    Connected to asteriskcdrdb on socket file default using table cdr for 12 seconds.

    And I can see my logged testcall by running
    mysql> SELECT * FROM cdr;

    So far so good !

    Unfortunately after editing phonetabs.cdr and showcdr.php I still don't see the call history tab.
    Is there any more files that I need to edit? Could there be a permission problem since config.php is set to the fop2 database?

    Best regards,
    Carlos

  4. Thu Jan 23 22:44:10 2014

    Hi,

    I'm trying to setup the exact same thing. I'm running standalone asterisk 11.7.0 and FOP2 2.27 on CentOS 6.4.
    Already set up phonebook and recordings with MySql which works great. Only call history tab left.

    As I understand it from this post and View Post 3478 you have to
    edit showcdr.php, phonetabs.php and config.php (in /var/www/html/fop2) to set the correct names of which database and table to use.

    My question is if there will be a user/permission problem if you use another database for CDR logs than "fop2" (which is already set in config.php for phonebook and recordings). Would it be best/easiest to create a new "cdr" table in the fop2 database (which the fop2 user already has acces rights to)?
    The reason for my question is that most "howtos" regarding mysql cdr logging tell you to setup an "asteriskcdrdb" database and "cdr" table with access for an "asterisk" user.

    Best regards
    Carlos