Module: sip-router
Branch: master
Commit: c7dc7a88fcf1d2123002c64bcd7b5f20a84b8ad3
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c7dc7a8…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Oct 4 16:11:27 2010 +0200
prefix_route: added xml docbook file
- forgotten to add them in previous commit to this module
---
modules/prefix_route/doc/Makefile | 4 ++
modules/prefix_route/doc/extra.xml | 33 ++++++++++++++++++++
modules/prefix_route/doc/functions.xml | 26 +++++++++++++++
modules/prefix_route/doc/params.xml | 44 ++++++++++++++++++++++++++
modules/prefix_route/doc/prefix_route.xml | 48 +++++++++++++++++++++++++++++
modules/prefix_route/doc/rpc.xml | 24 ++++++++++++++
6 files changed, 179 insertions(+), 0 deletions(-)
diff --git a/modules/prefix_route/doc/Makefile b/modules/prefix_route/doc/Makefile
new file mode 100644
index 0000000..9ec8b5e
--- /dev/null
+++ b/modules/prefix_route/doc/Makefile
@@ -0,0 +1,4 @@
+docs = prefix_route.xml
+
+docbook_dir=../../../docbook
+include $(docbook_dir)/Makefile.module
diff --git a/modules/prefix_route/doc/extra.xml b/modules/prefix_route/doc/extra.xml
new file mode 100644
index 0000000..6acbd77
--- /dev/null
+++ b/modules/prefix_route/doc/extra.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<section id="prefixroute.extra"
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Database Structure</title>
+
+ <para>
+ A prefix route set consists of three fields:
+ </para>
+ <itemizedlist>
+ <listitem><para>prefix - varchar(64) - Prefix
rule</para></listitem>
+ <listitem><para>route - varchar(64) - Route
name</para></listitem>
+ <listitem><para>comment - varchar(64) - Free-form
comment</para></listitem>
+ </itemizedlist>
+ <example>
+ <title>Sample data</title>
+ <programlisting format="linespecific">
+...
+ +--------+-------+---------------+
+ | prefix | route | comment |
+ +--------+-------+---------------+
+ | 46 | SE | Sweden |
+ | 47 | NO | Norway |
+ | 479 | NOMOB | Norway mobile |
+ | 49 | DE | Deutschland |
+ | 39 | IT | Italy |
+ +--------+-------+---------------+
+...
+</programlisting>
+ </example>
+
+</section>
diff --git a/modules/prefix_route/doc/functions.xml
b/modules/prefix_route/doc/functions.xml
new file mode 100644
index 0000000..fd71954
--- /dev/null
+++ b/modules/prefix_route/doc/functions.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<section id="prefixroute.functions"
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Functions</title>
+
+ <section id="prefixroute.prefix_route">
+ <title><function>prefix_route()</function></title>
+ <para>
+ This function tries to find a route from the user part of the request URI.
+ If a route is found, it will be used for further processing. Otherwise the
+ function will return false.
+ </para>
+ <example>
+ <title>prefix_route() usage</title>
+ <programlisting>
+...
+ if (!prefix_route()) {
+ xlog("L_ERR", "prefix_route(): no matching routes\n");
+ }
+...
+ </programlisting>
+ </example>
+ </section>
+</section>
diff --git a/modules/prefix_route/doc/params.xml b/modules/prefix_route/doc/params.xml
new file mode 100644
index 0000000..80bb4e0
--- /dev/null
+++ b/modules/prefix_route/doc/params.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<section id="prefixroute.parameters"
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Parameters</title>
+
+ <section id="prefixroute.db_url">
+ <title><varname>db_url</varname> (string)</title>
+ <para>
+ This is <acronym>URL</acronym> of the database to be used.
+ </para>
+ <para>
+ Default value is "mysql://ser@localhost/ser"
+ </para>
+ <example>
+ <title>Setting db_url parameter</title>
+ <programlisting>
+...
+modparam("prefix_route", "db_url",
"mysql://ser:pass@db_host/ser")
+...
+ </programlisting>
+ </example>
+ </section>
+
+ <section id="prefixroute.db_table">
+ <title><varname>db_table</varname> (string)</title>
+ <para>
+ The name of table where to read prefix route set.
+ </para>
+ <para>
+ Default value is "prefix_route".
+ </para>
+ <example>
+ <title>Setting db_table parameter</title>
+ <programlisting>
+...
+modparam("prefix_route", "db_table", "new_prefix_route")
+...
+ </programlisting>
+ </example>
+ </section>
+
+</section>
diff --git a/modules/prefix_route/doc/prefix_route.xml
b/modules/prefix_route/doc/prefix_route.xml
new file mode 100644
index 0000000..1244849
--- /dev/null
+++ b/modules/prefix_route/doc/prefix_route.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<section id="blst"
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <sectioninfo>
+ <authorgroup>
+ <author>
+ <firstname>Alfred E.</firstname>
+ <surname>Heggestad</surname>
+ <affiliation><orgname>Telio Telecom</orgname></affiliation>
+ </author>
+ </authorgroup>
+ <copyright>
+ <year>2007</year>
+ <holder>Alfred E. Heggestad</holder>
+ </copyright>
+ <copyright>
+ <year>2008</year>
+ <holder>Telio Telecom AS</holder>
+ </copyright>
+ </sectioninfo>
+
+ <title>prefix_route Module</title>
+
+ <section id="prefixroute.overview">
+ <title>Overview</title>
+ <para>
+ The prefix_route module does routing based on a set of prefixes from the
+ database. The prefix rule-set is loaded from the database into a binary
+ tree in memory, either on startup or when issuing the "prefix_route.reload"
RPC
+ command. When calling the "prefix_route()" function from the ser.cfg
+ configuration script, it will try to match the user part of the request URI
+ with the best matching route. If a route is found, it will be used for
+ further processing. If not found normal processing will continue.
+ </para>
+ <para>
+ Development was sponsored by Telio Telecom.
+ </para>
+ </section>
+
+ <xi:include href="params.xml"/>
+ <xi:include href="functions.xml"/>
+ <xi:include href="rpc.xml"/>
+ <xi:include href="extra.xml"/>
+
+</section>
+
diff --git a/modules/prefix_route/doc/rpc.xml b/modules/prefix_route/doc/rpc.xml
new file mode 100644
index 0000000..29a246d
--- /dev/null
+++ b/modules/prefix_route/doc/rpc.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+
+<section id="prefixroute.rpc"
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>RPC Commands</title>
+
+ <section id="prefixroute.reload">
+ <title><function>prefix_route.reload</function></title>
+ <para>
+ Reload prefix route tree from the database.
+ Validation is done and the prefix route tree will
+ only be reloaded if there are no errors.
+ </para>
+ </section>
+
+ <section id="prefixroute.dump">
+ <title><function>prefix_route.dump</function></title>
+ <para>
+ Dump the current prefix route tree.
+ </para>
+ </section>
+
+</section>