Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

FOP2 Community Forum

  1. Home
  2. Support
  3. Activate CDR button in Phonebook

Activate CDR button in Phonebook

Scheduled Pinned Locked Moved Support
8 Posts 3 Posters 583 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    S
    seregh
    wrote on last edited by
    #1

    How can i activate "Call history" button in Phonebook.

    I can see CDRs by http:// /showcdr.php but there is no "call history" button in Phonebook page.

    Standalone asterisk 1.4 installation. 2.27j version of fop2.

    Best regards,
    Sergio.

    1 Reply Last reply
    0
    • S
      S
      seregh
      wrote on last edited by
      #2

      Answering myself with Nicolas live chat help. 🙂

      We have to look at two files showcdr.php and phonetabs.php. In both files it must be set the correct name of DB.table of CDR storage.

      So if we have
      $grid->set_table('asterisk.cdr'); in showcdr.php
      we must have
      $res = $db->consulta("DESC asterisk.cdr");
      in phonetabs.php

      Best regards,
      Sergio.

      1 Reply Last reply
      0
      • N
        N
        nicolas
        wrote on last edited by
        #3

        thanks for posting the solution.

        1 Reply Last reply
        0
        • C
          C
          Carlos
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • N
            N
            nicolas
            wrote on last edited by
            #5

            You do not need to create a table on a different database, you can specify a database and table name using the format

            databasename.tablename

            That is what is set in the stock/default .php files where the cdr table is in the asteriskcdr database (while the rest of the freepbx configs are on the asterisk database, or the fop2 database if you do not use freepbx).

            So, if your cdrs are in database asteriskcdrdb and the table is cdr it will work as is, if the database and tables are named differently, just grep for asteriskcdrdb.cdr on the .php files and replace where needed.

            Best regards,

            1 Reply Last reply
            0
            • C
              C
              Carlos
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • N
                N
                nicolas
                wrote on last edited by
                #7

                Could there be a permission problem since config.php is set to the fop2 database?

                Yes, it could be a permission issue. Whatever user/pass you have in config.php in fop2 must be granted access to asteriskcdrdb.cdr

                1 Reply Last reply
                0
                • C
                  C
                  Carlos
                  wrote on last edited by
                  #8

                  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

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  Powered by NodeBB Contributors
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups