Module: sip-router
Branch: master
Commit: a23b076fff03adc14dfb366b2827d304c43fb623
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a23b076…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Mon May 11 16:50:15 2009 +0200
doc: xmlrpc functions and params added
---
modules_s/xmlrpc/doc/functions.xml | 84 ++++++++++++++++++++++++++++++++++++
modules_s/xmlrpc/doc/params.xml | 67 ++++++++++++++++++++++++++++
modules_s/xmlrpc/doc/xmlrpc.xml | 3 +
3 files changed, 154 insertions(+), 0 deletions(-)
diff --git a/modules_s/xmlrpc/doc/functions.xml b/modules_s/xmlrpc/doc/functions.xml
new file mode 100644
index 0000000..bc3820f
--- /dev/null
+++ b/modules_s/xmlrpc/doc/functions.xml
@@ -0,0 +1,84 @@
+<?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="xmlrpc.functions" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <sectioninfo>
+ <revhistory>
+ <revision>
+ <revnumber>$Revision$</revnumber>
+ <date>$Date$</date>
+ </revision>
+ </revhistory>
+ </sectioninfo>
+
+ <title>Functions</title>
+
+ <section id="xmlrpc.dispatch_rpc">
+ <title>
+ <function>dispatch_rpc()</function>
+ </title>
+ <para>
+ This function processes an XMLRPC request, found in the body of
+ the request.
+ </para>
+ <para>
+ It should be used only in a route specified using the
+ <varname>"route"</varname> module parameter or if the request method
+ is GET or POST (using it for other request methods will not have
+ adverse side-effects, but it will probably not work).
+ </para>
+ <para>
+ dispatch_rpc() extracts the XML-RPC document from the body of the
+ request to determine the name of the RPC method to be called and then
+ it searches through the list of all the RPC functions to find a
+ function with matching name. If such a function is found then
+ dispatch_rpc() will pass control to the function to handle the
+ request.
+ </para>
+ <example>
+ <title><function>dispatch_rpc</function> usage</title>
+ <programlisting>
+#...
+modparam("xmlrpc", "route", "XMLRPC");
+#...
+route[XMLRPC]{
+ dispatch_rpc();
+}
+ </programlisting>
+ </example>
+ </section>
+
+ <section id="xmlrpc.xmlrpc_reply">
+ <title>
+ <function>xmlrpc_reply(code, reason)</function>
+ </title>
+ <para>
+ This function can be called from the config script to directly
+ generate an XML-RPC reply.
+ </para>
+ <example>
+ <title><function>xmlrpc_reply</function> usage</title>
+ <programlisting>
+#...
+modparam("xmlrpc", "route", "XMLRPC");
+#...
+route[XMLRPC]{
+ # allow XMLRPC requests only on TLS and only if the client
+ # certificate is valid
+ if (proto!=TLS){
+ xmlrpc_reply("400", "xmlrpc allowed only over TLS");
+ return;
+ }
+ if (@tls.peer.verified!=""){
+ xmlrpc_reply("400", "Unauthorized");
+ return;
+ }
+ dispatch_rpc();
+}
+ </programlisting>
+ </example>
+ </section>
+
+
+</section>
diff --git a/modules_s/xmlrpc/doc/params.xml b/modules_s/xmlrpc/doc/params.xml
new file mode 100644
index 0000000..324495d
--- /dev/null
+++ b/modules_s/xmlrpc/doc/params.xml
@@ -0,0 +1,67 @@
+<?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="xmlrpc.parameters" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <sectioninfo>
+ <revhistory>
+ <revision>
+ <revnumber>$Revision$</revnumber>
+ <date>$Date$</date>
+ </revision>
+ </revhistory>
+ </sectioninfo>
+
+ <title>Parameters</title>
+
+ <section id="route">
+ <title><varname>route</varname> (string)</title>
+ <para>
+ Name of the route called for XMLRPC messages.
+ </para>
+ <para>
+ This route will be called only for HTTP messages whose method is
+ either GET or POST. The message visible inside the route
+ will be a HTTP request converted to SIP (the uri will be fixed and
+ a fake via will be added).
+ </para>
+ <para>
+ The route should perform additional security checks to
+ ensure the client is authorized to execute management/RPC functions
+ and then it should call the <function>dispatch_rpc()</function>.
+ </para>
+ <para>
+ Default: the main route is used.
+ </para>
+ <example>
+ <title>Set <varname>route</varname> parameter</title>
+ <programlisting>
+modparam("xmlrpc", "route", "route_for_xmlrpcs")
+ </programlisting>
+ </example>
+ </section>
+
+ <!--
+ Seems to be obsolete (on always) -andrei
+ <section id="enable_introspection">
+ <title><varname>enable_introspection</varname> (integer)</title>
+ <para>
+ Enable/disable additional introspection methods. If set to 1 then
+ the functions defined in
+ http://scripts.incutio.com/xmlrpc/introspection.html
+ will be available on the server. If set to 0 then the functions will
+ be disabled.
+ </para>
+ <para>
+ Default: 1 (enabled).
+ </para>
+ <example>
+ <title>Set <varname>enable_introspection</varname> parameter</title>
+ <programlisting>
+modparam("xmlrpc", "enable_introspection", 0)
+ </programlisting>
+ </example>
+ </section>
+ -->
+
+</section>
diff --git a/modules_s/xmlrpc/doc/xmlrpc.xml b/modules_s/xmlrpc/doc/xmlrpc.xml
index 7a1b908..4438185 100644
--- a/modules_s/xmlrpc/doc/xmlrpc.xml
+++ b/modules_s/xmlrpc/doc/xmlrpc.xml
@@ -686,4 +686,7 @@ Content-Length: 276
</para>
</section>
+ <xi:include href="params.xml"/>
+ <xi:include href="functions.xml"/>
+
</section>
i recently added a new feature to k msilo module and now took a look how
does s msilo compare to k's. it turns out that k msilo module has lots
of stuff that is missing from s version.
there seems to be one difference though. in s module there is this:
registrar (string)
The SIP address used to inform users that destination of their message
is not online and the message will be delivered next time when that
user goes online. If the parameter is not set, the module will not
send any notification. All requests intended for this SIP address will
not be stored for lately delivery.
Default value is "NULL".
Example 5. Set the registrar parameter
...
modparam("msilo", "registrar", "sip:registrar@iptel.org")
and the corresponding thing in k is this:
1.3.3. from_address (string)
The SIP address used to inform users that destination of their
message is not online and the message will be delivered next
time when that user goes online. If the parameter is not set,
the module will not send any notification. It can contain
pseudo-variables.
Default value is "NULL".
Example 1.3. Set the "from_address" parameter
...
modparam("msilo", "from_address", "sip:registrar@example.org")
modparam("msilo", "from_address", "sip:$rU@example.org")
in my opnion the difference is so small that we could adopt k version of
msilo as is.
comments?
-- juha
Module: sip-router
Branch: master
Commit: 83d732f025fb4db086449e095b1c91e8fefaa754
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=83d732f…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Sun May 10 10:56:45 2009 +0200
doc: rpc makefile migrated to the new doc make system
---
doc/rpc/Makefile | 27 +++------------------------
1 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/doc/rpc/Makefile b/doc/rpc/Makefile
index 5d2867c..8f32f6a 100644
--- a/doc/rpc/Makefile
+++ b/doc/rpc/Makefile
@@ -1,29 +1,8 @@
#
# The list of documents to build (without extensions)
#
-DOCUMENTS = ser_rpc
-#
-# The root directory containing Makefile.doc
-#
-ROOT_DIR=../..
-
-#
-# Validate docbook documents before generating output
-# (may be slow)
-#
-#VALIDATE=1
-
-#
-# You can override the stylesheet used to generate
-# xhtml documents here
-#
-#XHTML_XSL=$(ROOT_DIR)/doc/stylesheets/xhtml.xsl
-
-#
-# You can override the stylesheet used to generate
-# plain text documents here
-#
-#TXT_XSL=$(XHTML_XSL)
+docs = ser_rpc.xml
+docbook_dir = ../../docbook
-include $(ROOT_DIR)/Makefile.doc
+include $(docbook_dir)/Makefile