Hello,
I am wondering whether I can add a new parameter (or possibly
parameters) to the sip_uri structure because of performance reasons.
There are some parameter values that need to be accessed frequently, and
having a short-cut to them would be very good, otherwise the linked list
for the parameters is always constructed and freed.
The current request is for the "rn" parameter from RFC 4694 which may be
checked as frequently as ruri.user in certain deployments. If the memory
usage is a concern then I can also introduce a #define statement,
something like URI_PARAM_SHORTCUTS.
Thanks,
Miklos
Module: sip-router
Branch: master
Commit: 205c28ae0de03703fedf235d27f5244a45e3b1d1
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=205c28a…
Author: Miklos Tirpak <miklos(a)iptel.org>
Committer: Miklos Tirpak <miklos(a)iptel.org>
Date: Wed May 13 08:51:27 2009 +0200
typo correction
---
modules_s/cfg_rpc/README | 2 +-
modules_s/cfg_rpc/doc/rpc.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules_s/cfg_rpc/README b/modules_s/cfg_rpc/README
index 7e457da..c3cdc80 100644
--- a/modules_s/cfg_rpc/README
+++ b/modules_s/cfg_rpc/README
@@ -33,7 +33,7 @@ Miklos Tirpak
accepts three parameters: group name, variable name, string value.
* cfg_rpc.commit - Commit the previously prepared configuration
changes. The function does not have any parameters.
- * cfg_rpc.rollback - Drop the prepared configuration changed. The
+ * cfg_rpc.rollback - Drop the prepared configuration changes. The
function does not have any parameters.
* cfg_rpc.get - Get the value of a configuration variable. The
function accepts two parameters: group name, variable name.
diff --git a/modules_s/cfg_rpc/doc/rpc.xml b/modules_s/cfg_rpc/doc/rpc.xml
index eb1e8a0..9307c0a 100644
--- a/modules_s/cfg_rpc/doc/rpc.xml
+++ b/modules_s/cfg_rpc/doc/rpc.xml
@@ -52,7 +52,7 @@
<listitem>
<para>
<emphasis>cfg_rpc.rollback</emphasis> - Drop the prepared
- configuration changed. The function does not have any
+ configuration changes. The function does not have any
parameters.
</para>
</listitem>
Hi, which would be the best example of an already ported Kamailio module? I
mean a Kamailio module that has been *fully* ported (this involves using the
"new"/definitive MI system and so on). I know that there are some K module
ported but they still use the K MI functions.
Thanks a lot.
--
Iñaki Baz Castillo <ibc(a)aliax.net>
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