ソースを参照

*** empty log message ***

Jan Janak 20 年 前
コミット
5536870fe1
1 ファイル変更110 行追加50 行削除
  1. 110 50
      db/schema/acc.xml

+ 110 - 50
db/schema/acc.xml

@@ -7,15 +7,17 @@
 
 ]>
 
-<table xmlns:db="http://docbook.org/ns/docbook" xmlns:my="http://iptel.org/dbschema/mysql">
+<table xmlns:db="http://docbook.org/ns/docbook"
+    xmlns:my="http://iptel.org/dbschema/mysql"
+    xmlns:pg="http://iptel.org/dbschema/postgres"
+    xmlns:dt="http://iptel.org/dbschema/dbtext">
     <name>acc</name>
     <description>
 	<db:para>
 	    Acc table is used for accounting purposes. When configured to account
 	    transactions, SER will write one row per transaction into this
 	    table. The table is never read by SER, SER only writes into this
-	    table. SERWeb can query the table to display the list of placed
-	    calls.
+	    table. SERWeb can query the table to display the list of placed calls.
 	</db:para>
 	<db:para>
 	    SER records sucessful transactions (those replied with a 2xx final
@@ -29,25 +31,57 @@
 	    of a subscriber. 
 	</db:para>
     </description>
-    <version>2</version>
+    <version>3</version>
+
+    <column id="acc.id">
+	<name>id</name>
+	<type>int</type>
+	<my:type>INT AUTO_INCREMENT</my:type>
+	<pg:type>SERIAL</pg:type>
+	<dt:type>int,auto</dt:type>
+	<description>
+	    ID that uniquely identifies every record. Useful for post-processing.
+	</description>
+    </column>
+
+    <column>
+	<name>from_uid</name>
+	<type>string</type>
+	<size>&id_len;</size>
+	<null/>
+	<description>
+	    The UID (Unique ID) of the originator of transaction (usually caller).
+	</description>
+    </column>
+
+    <column>
+	<name>to_uid</name>
+	<type>string</type>
+	<size>&id_len;</size>
+	<null/>
+	<description>
+	    The UUID of the user identified by the Request-URI (intended
+	    recipient of the transaction).
+	</description>
+    </column>
 
     <column>
-	<name>caller_UUID</name>
+	<name>to_did</name>
 	<type>string</type>
-	<size>&uuid_len;</size>
+	<size>&id_len;</size>
+	<null/>
 	<description>
-	    The UUID of the user identified by From header field (the
-	    initiator of the transaction).
+	    The domain id of the callee.
 	</description>
     </column>
 
     <column>
-	<name>callee_UUID</name>
+	<name>from_did</name>
 	<type>string</type>
-	<size>&uuid_len;</size>
+	<size>&id_len;</size>
+	<null/>
 	<description>
-	    The UUID of the user identified by the Request-URI (intended recipient of the
-	    transaction).
+	    The domain id of the caller.
 	</description>
     </column>
 
@@ -55,6 +89,7 @@
 	<name>sip_from</name>
 	<type>string</type>
 	<size>&hf_len;</size>
+	<null/>
 	<description>
 	    The body of the From header field, including display name and all
 	    parameters URI and header field parameters.
@@ -65,6 +100,7 @@
 	<name>sip_to</name>
 	<type>string</type>
 	<size>&hf_len;</size>
+	<null/>
 	<description>
 	    The body of the To header field, including display name and all
 	    parameters URI and header field parameters.
@@ -75,6 +111,7 @@
 	<name>sip_status</name>
 	<type>string</type>
 	<size>128</size>
+	<null/>
 	<description>
 	    The status code of the final SIP reply that finished the
 	    transaction being accounted.
@@ -85,6 +122,7 @@
 	<name>sip_method</name>
 	<type>string</type>
 	<size>&method_len;</size>
+	<null/>
 	<description>
 	    The method of the SIP request that created the transaction being
 	    accounted.
@@ -92,9 +130,10 @@
     </column>
 
     <column>
-	<name>i_uri</name>
+	<name>in_ruri</name>
 	<type>string</type>
 	<size>&uri_len;</size>
+	<null/>
 	<description>
 	    Inbound Request-URI. This is the value of the Request-URI as
 	    received by SER from the previous (upstream) element (typically
@@ -103,9 +142,10 @@
     </column>
 
     <column>
-	<name>o_uri</name>
+	<name>out_ruri</name>
 	<type>string</type>
 	<size>&uri_len;</size>
+	<null/>
 	<description>
 	    Outbound Request-URI. This is the value of the Request-URI when the
 	    request leaves SER, i.e. after applying all the modifications and
@@ -119,6 +159,7 @@
 	<name>from_uri</name>
 	<type>string</type>
 	<size>&uri_len;</size>
+	<null/>
 	<description>
 	    The SIP URI extracted from From header field. This is just the
 	    plain SIP URI without display name and header field parameters
@@ -131,6 +172,7 @@
 	<name>to_uri</name>
 	<type>string</type>
 	<size>&uri_len;</size>
+	<null/>
 	<description>
 	    The SIP URI extracted from To header field. This is just the plain
 	    SIP URI without display name and header field parameters (if To
@@ -139,103 +181,121 @@
 	</description>
     </column>
 
-    <column id="sip_callid">
+    <column id="acc.sip_callid">
 	<name>sip_callid</name>
 	<type>string</type>
 	<size>&uri_len;</size>
+	<null/>
 	<description>
 	    The value of the Call-ID header field. This value uniquely
 	    identifies a call.
 	</description>
     </column>
 
-    <column id="username">
-	<name>username</name>
+    <column id="acc.sip_cseq">
+	<name>sip_cseq</name>
+	<type>int</type>
+	<null/>
+	<description>
+	    CSeq number.
+	</description>
+    </column>
+
+    <column id="acc.username">
+	<name>digest_username</name>
 	<type>string</type>
 	<size>&user_len;</size>
+	<null/>
 	<description>
-	    The value of username attribute from digest credentials. If a message does
-	    not contain digest credentials then From header field username is used.
+	    The value of username attribute from digest credentials
 	</description>
     </column>
 
-    <column id="domain">
-	<name>domain</name>
+    <column id="acc.realm">
+	<name>digest_realm</name>
 	<type>string</type>
-	<size>&domain_len;</size>
+	<size>&uri_len;</size>
+	<null/>
 	<description>
-	    In multi-domain setups (SER handling more than one virtual domain)
-	    this is the domain the transaction was processed in.
+	    Digest realm.
 	</description>
     </column>
 
     <column>
-	<name>fromtag</name>
+	<name>from_tag</name>
 	<type>string</type>
 	<size>128</size>
+	<null/>
 	<description>
 	    The value of the tag parameter in From header field.
 	</description>
     </column>
 
     <column>
-	<name>totag</name>
+	<name>to_tag</name>
 	<type>string</type>
 	<size>128</size>
+	<null/>
 	<description>
 	    The value of the tag parameter in To header field.
 	</description>
     </column>
 
     <column>
-	<name>time</name>
+	<name>src_ip</name>
+	<type>unsigned int</type>
+	<null/>
+    </column>
+
+    <column>
+	<name>src_port</name>
+	<type>unsigned short</type>
+	<null/>
+    </column>
+
+    <column>
+	<name>request_timestamp</name>
 	<type>datetime</type>
-	<default>1970-01-01 00:00:00</default>
 	<description>
-	    The time of the completion of the transaction (the time of
-	    forwarding of the final reply upstream by SER).
+	    The date and time of the request arrival to the proxy.
 	</description>
     </column>
 
     <column>
-	<name>timestamp</name>
+	<name>response_timestamp</name>
 	<type>datetime</type>
-	<default>1970-01-01 00:00:00</default>
 	<description>
-	    Timestamp auto-generated by the database server.
+	    The date and time when the final response was sent out.
 	</description>
     </column>
 
     <column>
-	<name>caller_deleted</name>
-	<type>char</type>
+	<name>flags</name>
+	<type>unsigned int</type>
 	<default>0</default>
 	<description>
-	    A flag that will be set to 1 when the caller deleted this record in
-	    his accounting list in SERWeb. The row can be deleted from acc
-	    table once both caller_deleted and callee_delete flags are set to 1.
+	    Various flags (caller_deleted, callee_deleted).
 	</description>
     </column>
 
     <column>
-	<name>callee_deleted</name>
-	<type>char</type>
-	<default>0</default>
+	<name>attrs</name>
+	<type>string</type>
+	<size>255</size>
+	<null/>
 	<description>
-	    A flag that will be set to 1 when the caller deleted this record in
-	    his accounting list in SERWeb. The row can be deleted from acc
-	    table once both caller_deleted and callee_delete flags are set to 1.
+	    Attribute-value pairs.
 	</description>
     </column>
 
     <index>
-	<name>acc_user</name>
-	<colref linkend="username"/>
-	<colref linkend="domain"/>
+	<name>id_key</name>
+	<unique/>
+	<colref linkend="acc.id"/>
     </index>
 
-    <index>
-	<name>sip_callid</name>
-	<colref linkend="sip_callid"/>
+    <index role="serweb">
+	<name>cid_key</name>
+	<colref linkend="acc.sip_callid"/>
     </index>
 </table>