Review Board 1.7.16


Improve realtime queue logging

Review Request #731 - Created June 16, 2010 and discarded

Paul Belanger
17082
Reviewers
asterisk-dev
coolmig
Asterisk
Posing this review, coolmig seems to be having problems.

---
I was playing with the RT queue log functionality, and found this limitations:

1. If you choose RT queue logging, you won't have the traditional plain text file file log. This file is very useful for backup purposes.
2. The column 'data' stores all the parameters separated by '|', which is not the best way to store it.

I managed to program a patch which overcomes this limitations, and works this way:

1. If you enable RT queue logging, the queue log will still be logged in the plain text file, so you have some backup in case of some database disaster.
2. The parameters are now "exploded", and put in separate fields for each one. The only thing here is that this code must be changed in case that some queue log event delivers more than 4 parameters (the only event that gives 4 parameters is TRANSFER).
3. The calldate is now stored just like the CDR, with a full datetime.
4. The plain text file is left as is, for compatibility purposes.
5. The fieldnames on the table changed a little. 
coolmig
Posted (June 16, 2010, 11:04 a.m.)
Thanks for the patch.  We will also need documentation for the table structure.
  1. An example of table structure is in the additional info of the bug. Because there's a fifth data column, the table structure would look like this for PostgreSQL:
    
    
    CREATE TABLE "queue_log" (
      "id" SERIAL,
      "eventdate" TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL,
      "cdr_uniqueid" VARCHAR(32) DEFAULT ''::character varying NOT NULL,
      "queuename" VARCHAR(32) DEFAULT ''::character varying NOT NULL,
      "agent" VARCHAR(32) DEFAULT ''::character varying NOT NULL,
      "event" VARCHAR(32) DEFAULT ''::character varying NOT NULL,
      "data1" VARCHAR(100) DEFAULT ''::character varying NOT NULL,
      "data2" VARCHAR(100) DEFAULT ''::character varying NOT NULL,
      "data3" VARCHAR(100) DEFAULT ''::character varying NOT NULL,
      "data4" VARCHAR(100) DEFAULT ''::character varying NOT NULL,
      "data5" VARCHAR(100) DEFAULT ''::character varying NOT NULL,
      CONSTRAINT "queue_log_pkey" PRIMARY KEY("id")
    ) WITHOUT OIDS;
    
  2. This still needs to be documented with asterisk some place.  Check out the existing .tex files for an example.
/trunk/main/logger.c (Diff revision 1)
 
 
Red blob.
  1. Done
/trunk/main/logger.c (Diff revision 1)
 
 
spacing after ,
  1. Done
/trunk/main/logger.c (Diff revision 1)
 
 
Another red blob
  1. Done

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.