Browse Source

rtpengine: Update doku for rtpengine database

The module is able to load nodes specified in a database.
Update doku for this.
Stefan Mititelu 9 năm trước cách đây
mục cha
commit
20e4a5d5d4
2 tập tin đã thay đổi với 104 bổ sung3 xóa
  1. 103 2
      modules/rtpengine/doc/rtpengine_admin.xml
  2. 1 1
      modules/rtpengine/rtpengine_db.c

+ 103 - 2
modules/rtpengine/doc/rtpengine_admin.xml

@@ -458,10 +458,86 @@ modparam("rtpengine", "hash_table_tout", "300")
         </section>
 
 
+
+
+	<section id="rtpengine.p.db_url">
+		<title><varname>db_url</varname> (string)</title>
+		<para>
+			The rtpengine datablase url. If present and valid, it activates database mode.
+			Node information is read from database, not from config.
+		</para>
+		<para>
+			By default, the datablase url is NULL (not set).
+		</para>
+		<example>
+		<title>Set <varname>db_url</varname> parameter</title>
+<programlisting format="linespecific">
+...
+modparam("rtpengine", "db_url", "mysql://pass@localhost/db")
+...
+</programlisting>
+		</example>
+	</section>
+
+
+	<section id="rtpengine.p.table_name">
+		<title><varname>table_name</varname> (string)</title>
+		<para>
+			The rtpengine table name. If database mode is activated (i.e. valid db_url),
+			set the name of rtpengine table, on startup.
+		</para>
+		<para>
+			By default, the rtpengine table name is "rtpengine".
+		</para>
+		<para>
+			NOTE: One needs to add the version of the rtpengine table in the version table.
+			The current version is version 1.
+		</para>
+		<example>
+		<title>Set <varname>table_name</varname> parameter</title>
+<programlisting format="linespecific">
+...
+modparam("rtpengine", "table_name", "rtpengine_table_name")
+...
+</programlisting>
+		</example>
+
+		<example>
+		<title>Setup <varname>rtpengine</varname> table</title>
+<programlisting format="linespecific">
+mysql> describe rtpengine;
++----------+------------------+------+-----+---------+-------+
+| Field    | Type             | Null | Key | Default | Extra |
++----------+------------------+------+-----+---------+-------+
+| setid    | int(10) unsigned | NO   |     | NULL    |       |
+| url      | varchar(64)      | NO   |     | NULL    |       |
+| disabled | int(11)          | NO   |     | NULL    |       |
++----------+------------------+------+-----+---------+-------+
+
+mysql> select * from rtpengine;
++-------+---------------------------+----------+
+| setid | url                       | disabled |
++-------+---------------------------+----------+
+|     0 | udp:rtpproxy1.domain:8800 |        0 |
+|     0 | udp:rtpproxy2.domain:8800 |        1 |
++-------+---------------------------+----------+
+
+mysql> select * from version;
++---------------------------+---------------+
+| table_name                | table_version |
++---------------------------+---------------+
+| rtpengine                 |             1 |
++---------------------------+---------------+
+...
+</programlisting>
+		</example>
+	</section>
+
+
 	<section id="rtpengine.p.setid_col">
 		<title><varname>setid_col</varname> (string)</title>
 		<para>
-			Column name in the rtpproxy table. If database mode is activated,
+			Column name in the rtpengine table. If database mode is activated (i.e. valid db_url),
 			set the setid of rtp nodes according to this column, on startup.
 			The MySQL value for this column should be INT UNSIGNED.
 		</para>
@@ -479,10 +555,31 @@ modparam("rtpengine", "setid_col", "setid_column_name")
 	</section>
 
 
+	<section id="rtpengine.p.url_col">
+		<title><varname>url_col</varname> (string)</title>
+		<para>
+			Column name in the rtpengine table. If database mode is activated (i.e. valid db_url),
+			set the url of rtp nodes according to this column, on startup.
+			The MySQL value for this column should be INT UNSIGNED.
+		</para>
+		<para>
+			By default, the column name is "url".
+		</para>
+		<example>
+		<title>Set <varname>url_col</varname> parameter</title>
+<programlisting format="linespecific">
+...
+modparam("rtpengine", "url_col", "url_column_name")
+...
+</programlisting>
+		</example>
+	</section>
+
+
 	<section id="rtpengine.p.disabled_col">
 		<title><varname>disabled_col</varname> (string)</title>
 		<para>
-			Column name in the rtpproxy table. If database mode is activated,
+			Column name in the rtpengine table. If database mode is activated (i.e. valid db_url),
 			set the state of rtp nodes according to this column, on startup.
 			The MySQL value for this column should be INT.
 		</para>
@@ -502,6 +599,10 @@ modparam("rtpengine", "disabled_col", "disabled_column_name")
 
 	</section>
 
+
+
+
+
 	<section>
 	<title>Functions</title>
 	<section id="rtpengine.f.set_rtpengine_set">

+ 1 - 1
modules/rtpengine/rtpengine_db.c

@@ -31,7 +31,7 @@ static db_func_t rtpp_dbf;
 static db1_con_t *rtpp_db_handle = NULL;
 
 str rtpp_db_url = {NULL, 0};
-str rtpp_table_name = str_init("rtpproxy");
+str rtpp_table_name = str_init("rtpengine");
 str rtpp_setid_col = str_init("setid");
 str rtpp_url_col = str_init("url");
 str rtpp_disabled_col = str_init("disabled");