Module: sip-router
Branch: master
Commit: e3f78196b345ab22eaba8f4ade7492e660782485
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e3f7819…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Jan 20 11:59:00 2013 +0100
perl: xs file updated to use Kamailio instead of OpenSER
---
modules_k/perl/kamailioxs.xs | 60 +++++++++++++++++++++---------------------
1 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/modules_k/perl/kamailioxs.xs b/modules_k/perl/kamailioxs.xs
index a7f536b..7f6ffdb 100644
--- a/modules_k/perl/kamailioxs.xs
+++ b/modules_k/perl/kamailioxs.xs
@@ -429,19 +429,19 @@ inline int sv2int_str(SV *val, int_str *is,
/* ************************************************************************ */
/* Object methods begin here */
-=head1 OpenSER
+=head1 Kamailio
-This module provides access to a limited number of OpenSER core functions.
+This module provides access to a limited number of Kamailio core functions.
As the most interesting functions deal with SIP messages, they are located
-in the OpenSER::Message class below.
+in the Kamailio::Message class below.
=cut
-MODULE = OpenSER PACKAGE = OpenSER
+MODULE = Kamailio PACKAGE = Kamailio
=head2 log(level,message)
-Logs the message with OpenSER's logging facility. The logging level
+Logs the message with Kamailio's logging facility. The logging level
is one of the following:
* L_ALERT
@@ -454,10 +454,10 @@ is one of the following:
Please note that this method is I<NOT> automatically exported, as it collides
with the perl function log (which calculates the logarithm). Either explicitly
-import the function (via C<use OpenSER qw ( log );>), or call it with its full
+import the function (via C<use Kamailio qw ( log );>), or call it with its full
name:
- OpenSER::log(L_INFO, "foobar");
+ Kamailio::log(L_INFO, "foobar");
=cut
@@ -481,13 +481,13 @@ log(level, log)
-MODULE = OpenSER PACKAGE = OpenSER::Message
+MODULE = Kamailio PACKAGE = Kamailio::Message
PROTOTYPES: ENABLE
-=head1 OpenSER::Message
+=head1 Kamailio::Message
-This package provides access functions for an OpenSER C<sip_msg> structure and
+This package provides access functions for an Kamailio C<sip_msg> structure and
its sub-components. Through its means it is possible to fully configure
alternative routing decisions.
@@ -845,7 +845,7 @@ parameters self, string1, string2.
C<string1> and/or C<string2> may be omitted.
As this function provides access to the functions that are exported to the
-OpenSER configuration file, it is autoloaded for unknown functions. Instead of
+Kamailio configuration file, it is autoloaded for unknown functions. Instead of
writing
$m->moduleFunction("sl_send_reply", "500", "Internal Error");
@@ -858,7 +858,7 @@ you may as well write
WARNING
-In OpenSER 1.2, only a limited subset of module functions is available. This
+In Kamailio 1.2, only a limited subset of module functions is available. This
restriction will be removed in a later version.
Here is a list of functions that are expected to be working (not claiming
@@ -991,7 +991,7 @@ moduleFunction (self, func, string1 = NULL, string2 = NULL)
=head2 log(level,message) (deprecated type)
-Logs the message with OpenSER's logging facility. The logging level
+Logs the message with Kamailio's logging facility. The logging level
is one of the following:
* L_ALERT
@@ -1002,8 +1002,8 @@ is one of the following:
* L_INFO
* L_DBG
-The logging function should be accessed via the OpenSER module variant. This
-one, located in OpenSER::Message, is deprecated.
+The logging function should be accessed via the Kamailio module variant. This
+one, located in Kamailio::Message, is deprecated.
=cut
@@ -1211,7 +1211,7 @@ append_branch(self, branch = NULL, qval = NULL)
=head2 getParsedRURI()
-Returns the current destination URI as an OpenSER::URI object.
+Returns the current destination URI as an Kamailio::URI object.
=cut
@@ -1233,7 +1233,7 @@ getParsedRURI(self)
uri = &(msg->parsed_uri);
ret = sv_newmortal();
- sv_setref_pv(ret, "OpenSER::URI", (void *)uri);
+ sv_setref_pv(ret, "Kamailio::URI", (void *)uri);
SvREADONLY_on(SvRV(ret));
ST(0) = ret;
@@ -1241,9 +1241,9 @@ getParsedRURI(self)
-MODULE = OpenSER PACKAGE = OpenSER::URI
+MODULE = Kamailio PACKAGE = Kamailio::URI
-=head1 OpenSER::URI
+=head1 Kamailio::URI
This package provides functions for access to sip_uri structures.
@@ -1513,9 +1513,9 @@ r2_val(self)
-=head1 OpenSER::AVP
+=head1 Kamailio::AVP
-This package provides access functions for OpenSER's AVPs.
+This package provides access functions for Kamailio's AVPs.
These variables can be created, evaluated, modified and removed through this
package.
@@ -1526,20 +1526,20 @@ documentation of add method below.
=cut
-MODULE = OpenSER PACKAGE = OpenSER::AVP
+MODULE = Kamailio PACKAGE = Kamailio::AVP
=head2 add(name,val)
Add an AVP.
-Add an OpenSER AVP to its environment. name and val may both be integers or
+Add an Kamailio AVP to its environment. name and val may both be integers or
strings; this function will try to guess what is correct. Please note that
- OpenSER::AVP::add("10", "10")
+ Kamailio::AVP::add("10", "10")
is something different than
- OpenSER::AVP::add(10, 10)
+ Kamailio::AVP::add(10, 10)
due to this evaluation: The first will create _string_ AVPs with the name
10, while the latter will create a numerical AVP.
@@ -1579,10 +1579,10 @@ add(p_name, p_val)
=head2 get(name)
-get an OpenSER AVP:
+get an Kamailio AVP:
- my $numavp = OpenSER::AVP::get(5);
- my $stravp = OpenSER::AVP::get("foo");
+ my $numavp = Kamailio::AVP::get(5);
+ my $stravp = Kamailio::AVP::get("foo");
=cut
@@ -1632,8 +1632,8 @@ get(p_name)
Destroy an AVP.
- OpenSER::AVP::destroy(5);
- OpenSER::AVP::destroy("foo");
+ Kamailio::AVP::destroy(5);
+ Kamailio::AVP::destroy("foo");
=cut
Module: sip-router
Branch: master
Commit: 80dc9107c5cd47cab24786a12d2612c25f714ff3
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=80dc910…
Author: Olle E. Johansson <oej(a)edvina.net>
Committer: Olle E. Johansson <oej(a)edvina.net>
Date: Sat Jan 19 20:07:08 2013 +0100
sanity Sanitize XML file names and formats
---
modules/sanity/README | 80 +++++++++++++------
modules/sanity/doc/sanity.xml | 3 +-
.../doc/{sanity_params.xml => sanity_admin.xml} | 0
modules/sanity/doc/sanity_functions.xml | 81 --------------------
4 files changed, 55 insertions(+), 109 deletions(-)
diff --git a/modules/sanity/README b/modules/sanity/README
index 90e7ca3..d57b8c0 100644
--- a/modules/sanity/README
+++ b/modules/sanity/README
@@ -7,15 +7,30 @@ Nils Ohlmeier
Copyright � 2006 iptelorg GmbH
__________________________________________________________________
+ Table of Contents
+
+ 1.
+
+ 1. Parameters
+
+ 1.1. default_checks (integer)
+ 1.2. uri_checks (integer)
+ 1.3. proxy_require (string)
+ 1.4. autodrop (integer)
+
+ 2. Functions
+
+ 2.1. sanity_check([msg_checks [, uri_checks]])
+
List of Examples
- 1. Set default_checks parameter
- 2. Set uri_checks parameter
- 3. Set proxy_require parameter
- 4. Set autodrop parameter
- 5. sanity_check usage
- 6. sanity_check usage with parameter
- 7. sanity_check usage with two parameters
+ 1.1. Set default_checks parameter
+ 1.2. Set uri_checks parameter
+ 1.3. Set proxy_require parameter
+ 1.4. Set autodrop parameter
+ 1.5. sanity_check usage
+ 1.6. sanity_check usage with parameter
+ 1.7. sanity_check usage with two parameters
1. Overview
@@ -64,14 +79,27 @@ Nils Ohlmeier
The following modules must be loaded before this module:
* sl - Stateless replies.
-3. Parameters
+ Table of Contents
+
+ 1. Parameters
+
+ 1.1. default_checks (integer)
+ 1.2. uri_checks (integer)
+ 1.3. proxy_require (string)
+ 1.4. autodrop (integer)
+
+ 2. Functions
+
+ 2.1. sanity_check([msg_checks [, uri_checks]])
+
+1. Parameters
- 3.1. default_checks (integer)
- 3.2. uri_checks (integer)
- 3.3. proxy_require (string)
- 3.4. autodrop (integer)
+ 1.1. default_checks (integer)
+ 1.2. uri_checks (integer)
+ 1.3. proxy_require (string)
+ 1.4. autodrop (integer)
-3.1. default_checks (integer)
+1.1. default_checks (integer)
This parameter determines which of the checks from the sanity module
are executed if no parameter was given to the sanity_check function
@@ -84,12 +112,12 @@ Nils Ohlmeier
cseq_method (32), cseq_value (64), cotent_length (128), expires_value
(256), proxy_require (512).
- Example 1. Set default_checks parameter
+ Example 1.1. Set default_checks parameter
...
modparam("sanity", "default_checks", 1)
...
-3.2. uri_checks (integer)
+1.2. uri_checks (integer)
This parameter determines which URIs are going to be checked if the
'parse uri' will be executed.
@@ -97,24 +125,24 @@ modparam("sanity", "default_checks", 1)
Default value is 7. This resolves to the following list of parsed URIs:
Request RUI (1), From URI (2) and To URI (4).
- Example 2. Set uri_checks parameter
+ Example 1.2. Set uri_checks parameter
...
modparam("sanity", "uri_checks", 3)
...
-3.3. proxy_require (string)
+1.3. proxy_require (string)
This parameter sets the list of supported extensions for this Kamailio.
The value is expected as a comma separated list of extensions. This
list is separated into single tokens. Each token from a proxy require
header will be compared to the tokens from this list.
- Example 3. Set proxy_require parameter
+ Example 1.3. Set proxy_require parameter
...
modparam("sanity", "proxy_require", "foo, bar")
...
-3.4. autodrop (integer)
+1.4. autodrop (integer)
This parameter controls whether the module drops automatically or not
the SIP message if the sanity checks fail. Default value is 1 (auto
@@ -123,16 +151,16 @@ modparam("sanity", "proxy_require", "foo, bar")
sure you exit execution of config without sending a SIP reply because
it is sent by module itself.
- Example 4. Set autodrop parameter
+ Example 1.4. Set autodrop parameter
...
modparam("sanity", "autodrop", 1)
...
-4. Functions
+2. Functions
- 4.1. sanity_check([msg_checks [, uri_checks]])
+ 2.1. sanity_check([msg_checks [, uri_checks]])
-4.1. sanity_check([msg_checks [, uri_checks]])
+2.1. sanity_check([msg_checks [, uri_checks]])
This function makes a row of sanity checks over the given SIP request.
The behavior of the function is also controlled by 'autodrop'
@@ -142,7 +170,7 @@ modparam("sanity", "autodrop", 1)
module sends a precise error reply via SL send_reply(). Thus there is
no need to reply with a generic error message.
- Example 5. sanity_check usage
+ Example 1.5. sanity_check usage
...
if (!sanity_check()) {
exit;
@@ -155,7 +183,7 @@ if (!sanity_check()) {
checks (like for the module parameter) which should be executed at this
function call.
- Example 6. sanity_check usage with parameter
+ Example 1.6. sanity_check usage with parameter
...
if (method=="REGISTER" && !sanity_check("256")) {
/* the register contains an invalid expires value and is replied with a
@@ -168,7 +196,7 @@ if (method=="REGISTER" && !sanity_check("256")) {
overwrites the global module parameter uri_checks and thus determines
which URIs will be checked if the parse uri test will be executed.
- Example 7. sanity_check usage with two parameters
+ Example 1.7. sanity_check usage with two parameters
...
if (method=="INVITE" && !sanity_check("1024", "6")) {
/* the INVITE contains an invalid From or To header and is replied with
diff --git a/modules/sanity/doc/sanity.xml b/modules/sanity/doc/sanity.xml
index 8ba8e32..7415abd 100644
--- a/modules/sanity/doc/sanity.xml
+++ b/modules/sanity/doc/sanity.xml
@@ -139,6 +139,5 @@
</para>
</section>
- <xi:include href="sanity_params.xml"/>
- <xi:include href="sanity_functions.xml"/>
+ <xi:include href="sanity_admin.xml"/>
</book>
diff --git a/modules/sanity/doc/sanity_params.xml b/modules/sanity/doc/sanity_admin.xml
similarity index 100%
rename from modules/sanity/doc/sanity_params.xml
rename to modules/sanity/doc/sanity_admin.xml
diff --git a/modules/sanity/doc/sanity_functions.xml b/modules/sanity/doc/sanity_functions.xml
deleted file mode 100644
index 62d28e6..0000000
--- a/modules/sanity/doc/sanity_functions.xml
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
-"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
-
-<!-- Include general documentation entities -->
-<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
-%docentities;
-
-]>
-
-<section id="options.functions" xmlns:xi="http://www.w3.org/2001/XInclude">
- <sectioninfo>
- </sectioninfo>
-
- <title>Functions</title>
-
- <section id="sanity_check">
- <title>
- <function>sanity_check([msg_checks [, uri_checks]])</function>
- </title>
- <para>
- This function makes a row of sanity checks over the given SIP request. The
- behavior of the function is also controlled by 'autodrop' parameter.
- If autodrop=0, the function returns false (-1) if one of the checks failed.
- When autodrop=1, the function stops the execution of configuration file.
- In both cases, if one of the checks fails the module sends a precise error
- reply via SL send_reply(). Thus there is no need to reply with a generic
- error message.
- </para>
- <example>
- <title><function>sanity_check</function> usage</title>
- <programlisting>
-<![CDATA[
-...
-if (!sanity_check()) {
- exit;
-}
-...
-]]>
- </programlisting>
- </example>
- <para>
- Optionally the function takes an integer argument which overwrites
- the global module parameter default_checks. This allows to make
- certain test from script regions. The integer value is again the sum
- of the checks (like for the module parameter) which should be executed
- at this function call.
- </para>
- <example>
- <title><function>sanity_check</function> usage with parameter</title>
- <programlisting>
-<![CDATA[
-...
-if (method=="REGISTER" && !sanity_check("256")) {
- /* the register contains an invalid expires value and is replied with a 400 */
- exit;
-}
-...
-]]>
- </programlisting>
- </example>
- <para>
- Optionally the function takes a second integer argument which
- overwrites the global module parameter uri_checks and thus determines
- which URIs will be checked if the parse uri test will be executed.
- </para>
- <example>
- <title><function>sanity_check</function> usage with two parameters</title>
- <programlisting>
-<![CDATA[
-...
-if (method=="INVITE" && !sanity_check("1024", "6")) {
- /* the INVITE contains an invalid From or To header and is replied with a 400 */
- exit;
-}
-...
-]]>
- </programlisting>
- </example>
- </section>
-</section>