tools/oracle/siptrace-create.sql
4a81660c
 INSERT INTO version (table_name, table_version) values ('sip_trace','2');
 CREATE TABLE sip_trace (
     id NUMBER(10) PRIMARY KEY,
     time_stamp DATE DEFAULT to_date('1900-01-01 00:00:01','yyyy-mm-dd hh24:mi:ss'),
     callid VARCHAR2(255) DEFAULT '',
     traced_user VARCHAR2(128) DEFAULT '',
     msg CLOB,
     method VARCHAR2(50) DEFAULT '',
     status VARCHAR2(128) DEFAULT '',
     fromip VARCHAR2(50) DEFAULT '',
     toip VARCHAR2(50) DEFAULT '',
     fromtag VARCHAR2(64) DEFAULT '',
     direction VARCHAR2(4) DEFAULT ''
38fac614
 );
4a81660c
 
 CREATE OR REPLACE TRIGGER sip_trace_tr
38fac614
 before insert on sip_trace FOR EACH ROW
 BEGIN
   auto_id(:NEW.id);
 END sip_trace_tr;
 /
4a81660c
 BEGIN map2users('sip_trace'); END;
38fac614
 /
4a81660c
 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);