Ticket #5500 (closed Bugs: fixed)

Opened 1 year ago

Last modified 1 year ago

cdr 2.10 just showing jibbrish and no records

Reported by: bpps Assigned to: mickecarlsson
Priority: major Milestone: Undetermined
Component: CDR Version: 2.10-branch
Keywords: Cc:
Confirmation: Unreviewed Distro:
Backend Engine: Asterisk 1.8 Distro Ver:
Backend Ver: 10 SVN Revision (if applicable):

Description

i installed the 2.10.b3 and now i the cdr shows about five lines of letters and uknown

using asterisk 10

Change History

01/08/12 22:26:15 changed by GameGamer43

Please ensure you have framework 2.10.0beta3.3 installed on your system, as we added some migration for the new cdr module in 2.10.0beta3.2. This migration resolved the issue with data not showing correctly in the new cdr module.

01/09/12 07:40:07 changed by bpps

yup have all the latest modules installed

01/12/12 19:49:08 changed by bpps

i dont if this will help but this is the output of freepbx log
http://pastebin.com/uV6JfQUX[[BR]]
any other ides how to debug this?

01/12/12 19:49:56 changed by bpps

01/14/12 05:45:06 changed by dzone

I have experienced a similar problem with my CDR Reports ever since updating to the 2.10 betas. I have the latest of everything installed, but I get garbage in the data table below the search criteria box when I visit the CDR Reports page. I just looked at the database directly, and afaik all the normally expected data is still being correctly acquired by asterisk.

01/16/12 12:09:43 changed by GameGamer43

Can you run the following for me from the cli and paste the output.

amportal a m use asteriskcdrdb; describe cdr;

01/16/12 12:19:35 changed by GameGamer43

This should be more readable, sorry about the previous post.

Can you run the following for me from the cli and paste the output.

amportal a m
use asteriskcdrdb;
describe cdr;

01/16/12 14:35:01 changed by bpps

Please wait...

Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3222 Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use asteriskcdrdb; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A

Database changed mysql> describe cdr; +-------------+--------------+------+-----+---------------------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------------------+-------+ | calldate | datetime | NO | | 0000-00-00 00:00:00 | | | clid | varchar(80) | NO | | | | | src | varchar(80) | NO | | | | | dst | varchar(80) | NO | | | | | dcontext | varchar(80) | NO | | | | | channel | varchar(80) | NO | | | | | dstchannel | varchar(80) | NO | | | | | lastapp | varchar(80) | NO | | | | | lastdata | varchar(80) | NO | | | | | duration | int(11) | NO | | 0 | | | billsec | int(11) | NO | | 0 | | | disposition | varchar(45) | NO | | | | | amaflags | int(11) | NO | | 0 | | | accountcode | varchar(20) | NO | | | | | uniqueid | varchar(32) | NO | | | | | userfield | varchar(255) | NO | | | | | did | varchar(20) | NO | | | | +-------------+--------------+------+-----+---------------------+-------+ 17 rows in set (0.00 sec)

mysql>

01/16/12 14:38:41 changed by bpps

Database changed

mysql> describe cdr;

+-------------+--------------+------+-----+---------------------+-------+

| Field | Type | Null | Key | Default | Extra |

+-------------+--------------+------+-----+---------------------+-------+

| calldate | datetime | NO | | 0000-00-00 00:00:00 | |

| clid | varchar(80) | NO | | | |

| src | varchar(80) | NO | | | |

| dst | varchar(80) | NO | | | |

| dcontext | varchar(80) | NO | | | |

| channel | varchar(80) | NO | | | |

| dstchannel | varchar(80) | NO | | | |

| lastapp | varchar(80) | NO | | | |

| lastdata | varchar(80) | NO | | | |

| duration | int(11) | NO | | 0 | |

| billsec | int(11) | NO | | 0 | |

| disposition | varchar(45) | NO | | | |

| amaflags | int(11) | NO | | 0 | |

| accountcode | varchar(20) | NO | | | |

| uniqueid | varchar(32) | NO | | | |

| userfield | varchar(255) | NO | | | |

| did | varchar(20) | NO | | | |

+-------------+--------------+------+-----+---------------------+-------+

17 rows in set (0.00 sec)

all this crazy wiki formatting

01/16/12 19:34:03 changed by GameGamer43

Can you try running the following for me:

amportal a m

use asteriskcdrdb;

ALTER TABLE cdr ADD recordingfile VARCHAR ( 255 ) NOT NULL default;

If that works, please let me know and we will need to dig into why the framework migration for 2.10.0beta3 isn't being run.

01/16/12 19:41:59 changed by GameGamer43

(In [13204]) re #5500 - add recordingfile field to cdr table in the cdr module as well

01/17/12 04:29:54 changed by dzone

mysql> describe cdr;
+-------------+--------------+------+-----+---------------------+-------+
| Field       | Type         | Null | Key | Default             | Extra |
+-------------+--------------+------+-----+---------------------+-------+
| calldate    | datetime     | NO   | MUL | 0000-00-00 00:00:00 |       |
| clid        | varchar(80)  | NO   |     |                     |       |
| src         | varchar(80)  | NO   |     |                     |       |
| dst         | varchar(80)  | NO   | MUL |                     |       |
| dcontext    | varchar(80)  | NO   |     |                     |       |
| channel     | varchar(80)  | NO   |     |                     |       |
| dstchannel  | varchar(80)  | NO   |     |                     |       |
| lastapp     | varchar(80)  | NO   |     |                     |       |
| lastdata    | varchar(80)  | NO   |     |                     |       |
| duration    | int(11)      | NO   |     | 0                   |       |
| billsec     | int(11)      | NO   |     | 0                   |       |
| disposition | varchar(45)  | NO   |     |                     |       |
| amaflags    | int(11)      | NO   |     | 0                   |       |
| accountcode | varchar(20)  | NO   | MUL |                     |       |
| uniqueid    | varchar(32)  | NO   |     |                     |       |
| userfield   | varchar(255) | NO   |     |                     |       |
+-------------+--------------+------+-----+---------------------+-------+
16 rows in set (0.60 sec)

01/17/12 04:49:59 changed by dzone

Looking at the data above, I added a couple of fields, but I still see the same gibberish when I run CDR Reports. Here's what I did:

mysql> ALTER TABLE cdr ADD did VARCHAR(20) NOT NULL default '';
Query OK, 86774 rows affected (18.57 sec)
Records: 86774  Duplicates: 0  Warnings: 0

mysql> ALTER TABLE cdr ADD recordingfile VARCHAR ( 255 ) NOT NULL default '';
Query OK, 86774 rows affected (8.28 sec)
Records: 86774  Duplicates: 0  Warnings: 0

mysql> describe cdr;
+---------------+--------------+------+-----+---------------------+-------+
| Field         | Type         | Null | Key | Default             | Extra |
+---------------+--------------+------+-----+---------------------+-------+
| calldate      | datetime     | NO   | MUL | 0000-00-00 00:00:00 |       |
| clid          | varchar(80)  | NO   |     |                     |       |
| src           | varchar(80)  | NO   |     |                     |       |
| dst           | varchar(80)  | NO   | MUL |                     |       |
| dcontext      | varchar(80)  | NO   |     |                     |       |
| channel       | varchar(80)  | NO   |     |                     |       |
| dstchannel    | varchar(80)  | NO   |     |                     |       |
| lastapp       | varchar(80)  | NO   |     |                     |       |
| lastdata      | varchar(80)  | NO   |     |                     |       |
| duration      | int(11)      | NO   |     | 0                   |       |
| billsec       | int(11)      | NO   |     | 0                   |       |
| disposition   | varchar(45)  | NO   |     |                     |       |
| amaflags      | int(11)      | NO   |     | 0                   |       |
| accountcode   | varchar(20)  | NO   | MUL |                     |       |
| uniqueid      | varchar(32)  | NO   |     |                     |       |
| userfield     | varchar(255) | NO   |     |                     |       |
| did           | varchar(20)  | NO   |     |                     |       |
| recordingfile | varchar(255) | NO   |     |                     |       |
+---------------+--------------+------+-----+---------------------+-------+
18 rows in set (0.05 sec)

01/17/12 06:05:38 changed by dzone

OK, I think I located the problem that was causing this symptom. Although it is correct that the migration wasn't running, I suspect the real problem has to do with two references to "CDRTABLENAME" in the module code. One is located in "install.php" and the other in "page.cdr.php" in the version I just downloaded.

When I altered both of those references to use "CDRDBTABLENAME" instead of "CDRTABLENAME" my CDR reports began working correctly. In my /etc/amportal.conf there is a CDRDBTABLENAME defined, but no CDRTABLENAME.

I hope this helps.

01/17/12 06:08:31 changed by bpps

ok it worked for me but the statment you gave gives me a error

MySQL version 5.0.77

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

01/17/12 12:31:40 changed by GameGamer43

  • status changed from new to closed.
  • resolution set to fixed.

(In [13206]) closes #5500 - use the correct array key, thanks dzone