浏览代码

srdb1: Added support for logging of messages > 64k in sip_trace with MySQL

- Some SIP requests - especially full-state NOTIFYs for large resource
  losts - can easily exceed 64k.
- This change makes MySQL use the mediumtext type for message contents.
- Feature added by Andrew Miller at Crocodile RCS
pd 14 年之前
父节点
当前提交
8623eeb1c2
共有 2 个文件被更改,包括 8 次插入8 次删除
  1. 1 1
      lib/srdb1/schema/sip_trace.xml
  2. 7 7
      utils/kamctl/mysql/siptrace-create.sql

+ 1 - 1
lib/srdb1/schema/sip_trace.xml

@@ -53,7 +53,7 @@
 
     <column>
         <name>msg</name>
-        <type>text</type>
+        <type>largetext</type>
         <description>Full SIP message</description>
     </column>
 

+ 7 - 7
utils/kamctl/mysql/siptrace-create.sql

@@ -1,7 +1,7 @@
 INSERT INTO version (table_name, table_version) values ('sip_trace','2');
 CREATE TABLE sip_trace (
-    id INT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
-    time_stamp DATETIME DEFAULT '1900-01-01 00:00:01' NOT NULL,
+    id SERIAL PRIMARY KEY NOT NULL,
+    time_stamp TIMESTAMP WITHOUT TIME ZONE DEFAULT '1900-01-01 00:00:01' NOT NULL,
     callid VARCHAR(255) DEFAULT '' NOT NULL,
     traced_user VARCHAR(128) DEFAULT '' NOT NULL,
     msg TEXT NOT NULL,
@@ -11,10 +11,10 @@ CREATE TABLE sip_trace (
     toip VARCHAR(50) DEFAULT '' NOT NULL,
     fromtag VARCHAR(64) DEFAULT '' NOT NULL,
     direction VARCHAR(4) DEFAULT '' NOT NULL
-) ENGINE=MyISAM;
+);
 
-CREATE INDEX traced_user_idx ON sip_trace (traced_user);
-CREATE INDEX date_idx ON sip_trace (time_stamp);
-CREATE INDEX fromip_idx ON sip_trace (fromip);
-CREATE INDEX callid_idx ON sip_trace (callid);
+CREATE INDEX sip_trace_traced_user_idx ON sip_trace (traced_user);
+CREATE INDEX sip_trace_date_idx ON sip_trace (time_stamp);
+CREATE INDEX sip_trace_fromip_idx ON sip_trace (fromip);
+CREATE INDEX sip_trace_callid_idx ON sip_trace (callid);