2
0
Эх сурвалжийг харах

perlvdb: module renamed to db_perlvdb

- it is a database driver module
Daniel-Constantin Mierla 12 жил өмнө
parent
commit
e5e821150f

+ 1 - 1
modules/perlvdb/Makefile → modules/db_perlvdb/Makefile

@@ -4,7 +4,7 @@
 
 include ../../Makefile.defs
 auto_gen=
-NAME=perlvdb.so
+NAME=db_perlvdb.so
 LIBS:=$(shell perl -MExtUtils::Embed -e ldopts)
 PERL_DEFS:=$(shell perl -MExtUtils::Embed -e ccopts)
 DEFS+=$(PERL_DEFS)

+ 46 - 46
modules/perlvdb/README → modules/db_perlvdb/README

@@ -27,14 +27,14 @@ Bastian Friedrich
    2. Developer Guide
 
         1. Introduction
-        2. Base class OpenSER::VDB
+        2. Base class Kamailio::VDB
         3. Data types
 
-              3.1. OpenSER::VDB::Value
-              3.2. OpenSER::VDB::Pair
-              3.3. OpenSER::VDB::ReqCond
-              3.4. OpenSER::VDB::Column
-              3.5. OpenSER::VDB::Result
+              3.1. Kamailio::VDB::Value
+              3.2. Kamailio::VDB::Pair
+              3.3. Kamailio::VDB::ReqCond
+              3.4. Kamailio::VDB::Column
+              3.5. Kamailio::VDB::Result
 
         4. Adapters
 
@@ -71,11 +71,11 @@ Chapter 1. Admin Guide
 
    Modules can be configured to use the perlvdb module as database backend
    using the db_url_parameter:
-modparam("acc", "db_url", "perlvdb:OpenSER::VDB::Adapter::AccountingSIPtrace")
+modparam("acc", "db_url", "perlvdb:Kamailio::VDB::Adapter::AccountingSIPtrace")
 
    This configuration options tells acc module that it should use the
    perlvdb module which will in turn use the Perl class
-   OpenSER::VDB::Adapter::AccountingSIPtrace to relay the database
+   Kamailio::VDB::Adapter::AccountingSIPtrace to relay the database
    requests.
 
 2. Dependencies
@@ -107,14 +107,14 @@ Chapter 2. Developer Guide
    Table of Contents
 
    1. Introduction
-   2. Base class OpenSER::VDB
+   2. Base class Kamailio::VDB
    3. Data types
 
-        3.1. OpenSER::VDB::Value
-        3.2. OpenSER::VDB::Pair
-        3.3. OpenSER::VDB::ReqCond
-        3.4. OpenSER::VDB::Column
-        3.5. OpenSER::VDB::Result
+        3.1. Kamailio::VDB::Value
+        3.2. Kamailio::VDB::Pair
+        3.3. Kamailio::VDB::ReqCond
+        3.4. Kamailio::VDB::Column
+        3.5. Kamailio::VDB::Result
 
    4. Adapters
 
@@ -124,8 +124,8 @@ Chapter 2. Developer Guide
 
 1. Introduction
 
-   OpenSER uses a database API for requests of numerous different types of
-   data. Four primary operations are supported:
+   Kamailio uses a database API for requests of numerous different types
+   of data. Four primary operations are supported:
      * query
      * insert
      * update
@@ -134,21 +134,21 @@ Chapter 2. Developer Guide
    This module relays these database requests to user implemented Perl
    functions.
 
-2. Base class OpenSER::VDB
+2. Base class Kamailio::VDB
 
    A client module has to be configured to use the perlvdb module in
    conjunction with a Perl class to provide the functions. The configured
-   class needs to inherit from the base class OpenSER::VDB.
+   class needs to inherit from the base class Kamailio::VDB.
 
    Derived classes have to implement the necessary functions "query",
    "insert", "update" and/or "delete". The client module specifies the
    necessary functions. To find out which functions are called from a
    module, its processes may be evaluated with the
-   OpenSER::VDB::Adapter::Describe class which will log incoming requests
+   Kamailio::VDB::Adapter::Describe class which will log incoming requests
    (without actually providing any real functionality).
 
    While users can directly implement their desired functionality in a
-   class derived from OpenSER::VDB, it is advisable to split the
+   class derived from Kamailio::VDB, it is advisable to split the
    implementation into an Adapter that transforms the relational
    structured parameters into pure Perl function arguments, and add a
    virtual table (VTab) to provide the relaying to an underlying
@@ -156,48 +156,48 @@ Chapter 2. Developer Guide
 
 3. Data types
 
-   3.1. OpenSER::VDB::Value
-   3.2. OpenSER::VDB::Pair
-   3.3. OpenSER::VDB::ReqCond
-   3.4. OpenSER::VDB::Column
-   3.5. OpenSER::VDB::Result
+   3.1. Kamailio::VDB::Value
+   3.2. Kamailio::VDB::Pair
+   3.3. Kamailio::VDB::ReqCond
+   3.4. Kamailio::VDB::Column
+   3.5. Kamailio::VDB::Result
 
    Before introducing the higher level concepts of this module, the used
-   datatypes will briefly be explained. The OpenSER Perl library includes
+   datatypes will briefly be explained. The Kamailio Perl library includes
    some data types that have to be used in this module:
 
-3.1. OpenSER::VDB::Value
+3.1. Kamailio::VDB::Value
 
    A value includes a data type flag and a value. Valid data types are
    DB_INT, DB_DOUBLE, DB_STRING, DB_STR, DB_DATETIME, DB_BLOB, DB_BITMAP.
    A new variable may be created with
-my $val = new OpenSER::VDB::Value(DB_STRING, "foobar");
+my $val = new Kamailio::VDB::Value(DB_STRING, "foobar");
 
    Value objects contain the type() and data() methods to get or set the
    type and data attributes.
 
-3.2. OpenSER::VDB::Pair
+3.2. Kamailio::VDB::Pair
 
    The Pair class is derived from the Value class and additionally
    contains a column name (key). A new variable may be created with
-my $pair = new OpenSER::VDB::Pair("foo", DB_STRING, "bar");
+my $pair = new Kamailio::VDB::Pair("foo", DB_STRING, "bar");
 
    where foo is the key and bar is the value. Additonally to the methods
    of the Value class, it contains a key() method to get or set the key
    attribute.
 
-3.3. OpenSER::VDB::ReqCond
+3.3. Kamailio::VDB::ReqCond
 
    The ReqCond class is used for select condition and is derived from the
    Pair class. It contains an addtional operator attribute. A new variable
    may be created with
-my $cond = new OpenSER::VDB::ReqCond("foo", ">", DB_INT, 5);
+my $cond = new Kamailio::VDB::ReqCond("foo", ">", DB_INT, 5);
 
    where foo is the key, "greater" is the operator and 5 is the value to
    compare. Additonally to the methods of the Pair class, it contains an
    op() method to get or set the operator attribute.
 
-3.4. OpenSER::VDB::Column
+3.4. Kamailio::VDB::Column
 
    This class represents a column definition or database schema. It
    contains an array for the column names and an array for the column
@@ -205,12 +205,12 @@ my $cond = new OpenSER::VDB::ReqCond("foo", ">", DB_INT, 5);
    created with
 my @types = { DB_INT, DB_STRING };
 my @names = { "id", "vals" };
-my $cols = new OpenSER::VDB::Column(\@types, \@names);
+my $cols = new Kamailio::VDB::Column(\@types, \@names);
 
    The class contains the methods type() and name() to get or set the type
    and name arrays.
 
-3.5. OpenSER::VDB::Result
+3.5. Kamailio::VDB::Result
 
    The Result class represents a query result. It contains a schema (class
    Column) and an array of rows, where each row is an array of Values. The
@@ -227,7 +227,7 @@ my $cols = new OpenSER::VDB::Column(\@types, \@names);
    another user/host pair. The Alias adapter turns the ReqCond array into
    two separate scalars that are used as parameters for a VTab call.
 
-   Adapter classes have to inherit from the OpenSER::VDB base class and
+   Adapter classes have to inherit from the Kamailio::VDB base class and
    may provide one or more functions with the names insert, update,
    replace, query and/or delete, depending on the module which is to be
    used with the adapter. While modules such as alias_db only require a
@@ -238,24 +238,24 @@ my $cols = new OpenSER::VDB::Column(\@types, \@names);
    The implemented functions need to deal with the correct data types. The
    parameter and return types are listed in this section.
 
-   insert() is passed an array of OpenSER::VDB::Pair objects. It should
+   insert() is passed an array of Kamailio::VDB::Pair objects. It should
    return an integer value.
 
-   replace() is passed an array of OpenSER::VDB::Pair objects. This
+   replace() is passed an array of Kamailio::VDB::Pair objects. This
    function is currently not used by any publicly available modules. It
    should return an integer value.
 
-   delete() is passed an array of OpenSER::VDB::ReqCond objects. It should
-   return an integer value.
+   delete() is passed an array of Kamailio::VDB::ReqCond objects. It
+   should return an integer value.
 
-   update() is passed an array of OpenSER::VDB::ReqCond objects (which
-   rows to update) and an array of OpenSER::VDB::Pair objects (new data).
+   update() is passed an array of Kamailio::VDB::ReqCond objects (which
+   rows to update) and an array of Kamailio::VDB::Pair objects (new data).
    It should return an integer value.
 
-   query() is passed an array of OpenSER::VDB::ReqCond objects (which rows
-   to select), an array of strings (which column names to return) and a
-   single string by which column to sort. It should return an object of
-   type OpenSER::VDB::Result.
+   query() is passed an array of Kamailio::VDB::ReqCond objects (which
+   rows to select), an array of strings (which column names to return) and
+   a single string by which column to sort. It should return an object of
+   type Kamailio::VDB::Result.
 
 5. VTabs
 

+ 2 - 2
modules/perlvdb/perlvdb.c → modules/db_perlvdb/db_perlvdb.c

@@ -24,7 +24,7 @@
  *
  */
 
-#include "perlvdb.h"
+#include "db_perlvdb.h"
 
 MODULE_VERSION
 
@@ -58,7 +58,7 @@ static param_export_t params[] = {
 
 
 struct module_exports exports = {
-	"perlvdb",
+	"db_perlvdb",
 	RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */
 	cmds,
 	params,      /*  module parameters */

+ 0 - 0
modules/perlvdb/perlvdb.h → modules/db_perlvdb/db_perlvdb.h


+ 1 - 1
modules/perlvdb/doc/Makefile → modules/db_perlvdb/doc/Makefile

@@ -1,4 +1,4 @@
-docs = perlvdb.xml
+docs = db_perlvdb.xml
 
 docbook_dir = ../../../docbook
 include $(docbook_dir)/Makefile.module

+ 2 - 2
modules/perlvdb/doc/perlvdb.xml → modules/db_perlvdb/doc/db_perlvdb.xml

@@ -36,8 +36,8 @@
 	</bookinfo>
 	<toc></toc>
 	
-	<xi:include href="perlvdb_admin.xml"/>
-	<xi:include href="perlvdb_devel.xml"/>
+	<xi:include href="db_perlvdb_admin.xml"/>
+	<xi:include href="db_perlvdb_devel.xml"/>
 	
 	
 </book>

+ 2 - 2
modules/perlvdb/doc/perlvdb_admin.xml → modules/db_perlvdb/doc/db_perlvdb_admin.xml

@@ -35,12 +35,12 @@
 		database backend using the db_url_parameter:
 	</para>
 	<programlisting>
-modparam("acc", "db_url", "perlvdb:OpenSER::VDB::Adapter::AccountingSIPtrace")
+modparam("acc", "db_url", "perlvdb:Kamailio::VDB::Adapter::AccountingSIPtrace")
 </programlisting>
 	<para>
 		This configuration options tells acc module that it should use the
 		perlvdb module which will in turn use the Perl class
-		OpenSER::VDB::Adapter::AccountingSIPtrace
+		Kamailio::VDB::Adapter::AccountingSIPtrace
 		to relay the database requests.
 	</para>
 	</section>

+ 23 - 23
modules/perlvdb/doc/perlvdb_devel.xml → modules/db_perlvdb/doc/db_perlvdb_devel.xml

@@ -14,7 +14,7 @@
 	<title>&develguide;</title>
 	<section><title>Introduction</title>
 		<para>
-		OpenSER uses a database API for requests of numerous different
+		Kamailio uses a database API for requests of numerous different
 		types of data. Four primary operations are supported:
 			<itemizedlist>
 				<listitem><para>query</para></listitem>
@@ -28,23 +28,23 @@
 			Perl functions.
 		</para>
 	</section>
-	<section><title>Base class OpenSER::VDB</title>
+	<section><title>Base class Kamailio::VDB</title>
 		<para>
 			A client module has to be configured to use the perlvdb module in conjunction
 			with a Perl class to provide the functions. The configured class needs to
-			inherit from the base class <literal role="code">OpenSER::VDB</literal>.
+			inherit from the base class <literal role="code">Kamailio::VDB</literal>.
 		</para>
 		<para>
 			Derived classes have to implement the necessary
 			functions "query", "insert", "update" and/or "delete". The client module
 			specifies the necessary functions.
 			To find out which functions are called from a module, its processes may
-			be evaluated with the <literal role="code">OpenSER::VDB::Adapter::Describe</literal> class which will
+			be evaluated with the <literal role="code">Kamailio::VDB::Adapter::Describe</literal> class which will
 			log incoming requests (without actually providing any real functionality).
 		</para>
 		<para>
 			While users can directly implement their desired functionality in a class
-			derived from OpenSER::VDB, it is advisable to split the implementation into
+			derived from Kamailio::VDB, it is advisable to split the implementation into
 			an Adapter that transforms the relational structured parameters into pure
 			Perl function arguments, and add a virtual table (VTab) to provide the
 			relaying to an underlying technology.
@@ -54,45 +54,45 @@
 		<para>
 			Before introducing the higher level concepts of this module, the used
 			datatypes will briefly be explained.
-			The OpenSER Perl library includes some data types that have to be used
+			The Kamailio Perl library includes some data types that have to be used
 			in this module:
 		</para>
-		<section><title>OpenSER::VDB::Value</title>
+		<section><title>Kamailio::VDB::Value</title>
 		<para>
 			A value includes a data type flag and a value. Valid data types are
 			DB_INT, DB_DOUBLE, DB_STRING, DB_STR, DB_DATETIME, DB_BLOB, DB_BITMAP.
 			A new variable may be created with <programlisting>
-my $val = new OpenSER::VDB::Value(DB_STRING, "foobar");
+my $val = new Kamailio::VDB::Value(DB_STRING, "foobar");
 </programlisting>
 			Value objects contain the type() and data() methods to get or set the type
 			and data attributes.
 		</para>
 		</section>
-		<section><title>OpenSER::VDB::Pair</title>
+		<section><title>Kamailio::VDB::Pair</title>
 		<para>
 			The Pair class is derived from the Value class and additionally contains a
 			column name (key).
 			A new variable may be created with <programlisting>
-my $pair = new OpenSER::VDB::Pair("foo", DB_STRING, "bar");
+my $pair = new Kamailio::VDB::Pair("foo", DB_STRING, "bar");
 </programlisting>
 			where foo is the key and bar is the value.
 			Additonally to the methods of the Value class, it contains a key() method to
 			get or set the key attribute.
 		</para>
 		</section>
-		<section><title>OpenSER::VDB::ReqCond</title>
+		<section><title>Kamailio::VDB::ReqCond</title>
 		<para>
 			The ReqCond class is used for select condition and is derived from the Pair
 			class. It contains an addtional operator attribute.
 			A new variable may be created with <programlisting>
-my $cond = new OpenSER::VDB::ReqCond("foo", ">", DB_INT, 5);
+my $cond = new Kamailio::VDB::ReqCond("foo", ">", DB_INT, 5);
 </programlisting>
 			where foo is the key, "greater" is the operator and 5 is the value to compare.
 			Additonally to the methods of the Pair class, it contains an op() method to
 			get or set the operator attribute.
 		</para>
 		</section>
-		<section><title>OpenSER::VDB::Column</title>
+		<section><title>Kamailio::VDB::Column</title>
 		<para>
 			This class represents a column definition or database schema. It contains an
 			array for the column names and an array for the column types. Both arrays need
@@ -100,13 +100,13 @@ my $cond = new OpenSER::VDB::ReqCond("foo", ">", DB_INT, 5);
 			A new variable may be created with <programlisting>
 my @types = { DB_INT, DB_STRING };
 my @names = { "id", "vals" };
-my $cols = new OpenSER::VDB::Column(\@types, \@names);
+my $cols = new Kamailio::VDB::Column(\@types, \@names);
 </programlisting>
 			The class contains the methods type() and name() to get or set the type and name
 			arrays.
 		</para>
 		</section>
-		<section><title>OpenSER::VDB::Result</title>
+		<section><title>Kamailio::VDB::Result</title>
 		<para>
 			The Result class represents a query result. It contains a schema (class Column)
 			and an array of rows, where each row is an array of Values. The object methods
@@ -123,7 +123,7 @@ my $cols = new OpenSER::VDB::Column(\@types, \@names);
 			for a VTab call.
 		</para>
 		<para>
-			Adapter classes have to inherit from the OpenSER::VDB base class and may provide
+			Adapter classes have to inherit from the Kamailio::VDB base class and may provide
 			one or more functions with the names insert, update, replace, query and/or delete,
 			depending on the module which is to be used with the adapter. While modules such as
 			alias_db only require a query function, others -- such as siptrace -- depend
@@ -135,29 +135,29 @@ my $cols = new OpenSER::VDB::Column(\@types, \@names);
 				parameter and return types are listed in this section.
 			</para>
 			<para>
-				<emphasis>insert()</emphasis> is passed an array of OpenSER::VDB::Pair objects.
+				<emphasis>insert()</emphasis> is passed an array of Kamailio::VDB::Pair objects.
 				It should return an integer value.
 			</para>
 			<para>
-				<emphasis>replace()</emphasis> is passed an array of OpenSER::VDB::Pair objects.
+				<emphasis>replace()</emphasis> is passed an array of Kamailio::VDB::Pair objects.
 				This function is currently not used by any publicly available modules.
 				It should return an integer value.
 			</para>
 			<para>
-				<emphasis>delete()</emphasis> is passed an array of OpenSER::VDB::ReqCond objects.
+				<emphasis>delete()</emphasis> is passed an array of Kamailio::VDB::ReqCond objects.
 				It should return an integer value.
 			</para>
 			<para>
-				<emphasis>update()</emphasis> is passed an array of OpenSER::VDB::ReqCond objects
-				(which rows to update) and an array of OpenSER::VDB::Pair objects
+				<emphasis>update()</emphasis> is passed an array of Kamailio::VDB::ReqCond objects
+				(which rows to update) and an array of Kamailio::VDB::Pair objects
 				(new data).
 				It should return an integer value.
 			</para>
 			<para>
-				<emphasis>query()</emphasis> is passed an array of OpenSER::VDB::ReqCond objects
+				<emphasis>query()</emphasis> is passed an array of Kamailio::VDB::ReqCond objects
 				(which rows to select), an array of strings (which column names to return)
 				and a single string by which column to sort.
-				It should return an object of type OpenSER::VDB::Result.
+				It should return an object of type Kamailio::VDB::Result.
 			</para>
 		</section>
 	</section>

+ 6 - 6
modules/perlvdb/doc/samples/alias_ldap.pm → modules/db_perlvdb/doc/samples/alias_ldap.pm

@@ -1,9 +1,9 @@
 package alias_ldap;
 
-use OpenSER::LDAPUtils::LDAPConf;
-use OpenSER::LDAPUtils::LDAPConnection;
+use Kamailio::LDAPUtils::LDAPConf;
+use Kamailio::LDAPUtils::LDAPConnection;
 
-use OpenSER::Constants;
+use Kamailio::Constants;
 
 sub init {}
 
@@ -13,13 +13,13 @@ sub query {
 	my $alias_domain = shift;
 
 	my $uri = "$alias_username\@$alias_domain";
-	my $ldap = new OpenSER::LDAPUtils::LDAPConnection();
+	my $ldap = new Kamailio::LDAPUtils::LDAPConnection();
 
-	OpenSER::log(L_INFO, "Trying LDAP request with $uri\n");
+	Kamailio::log(L_INFO, "Trying LDAP request with $uri\n");
 	my @ldaprows = $ldap->search("(&(ObjectClass=inetOrgPerson)(mail=$uri))", "ou=people,dc=example,dc=com", "uid");
 
 	if (@ldaprows[0]) {
-		OpenSER::log(L_INFO, "Got a row: ".@ldaprows[0]."\n");
+		Kamailio::log(L_INFO, "Got a row: ".@ldaprows[0]."\n");
 		my $ret;
 		$ret->{username} = @ldaprows[0];
 		$ret->{domain} = "voip";

+ 0 - 0
modules/perlvdb/doc/samples/flatstoresimulator.pm → modules/db_perlvdb/doc/samples/flatstoresimulator.pm


+ 0 - 0
modules/perlvdb/doc/samples/simplealias.pm → modules/db_perlvdb/doc/samples/simplealias.pm


+ 0 - 0
modules/perlvdb/doc/samples/simpleauth.pm → modules/db_perlvdb/doc/samples/simpleauth.pm


+ 0 - 0
modules/perlvdb/doc/samples/simplespeeddial.pm → modules/db_perlvdb/doc/samples/simplespeeddial.pm


+ 0 - 0
modules/perlvdb/perlvdb_conv.c → modules/db_perlvdb/perlvdb_conv.c


+ 1 - 1
modules/perlvdb/perlvdb_conv.h → modules/db_perlvdb/perlvdb_conv.h

@@ -31,7 +31,7 @@
 #include "../../lib/srdb1/db_val.h"
 #include "../../lib/srdb1/db_key.h"
 
-#include "perlvdb.h"
+#include "db_perlvdb.h"
 
 #include <XSUB.h>
 

+ 0 - 0
modules/perlvdb/perlvdb_oohelpers.c → modules/db_perlvdb/perlvdb_oohelpers.c


+ 1 - 1
modules/perlvdb/perlvdb_oohelpers.h → modules/db_perlvdb/perlvdb_oohelpers.h

@@ -27,7 +27,7 @@
 #ifndef _PERLVDB_OOHELPERS_H
 #define _PERLVDB_OOHELPERS_H 
 
-#include "perlvdb.h"
+#include "db_perlvdb.h"
 
 SV *perlvdb_perlmethod(SV *ref,
 		       const char* method,

+ 1 - 1
modules/perlvdb/perlvdbfunc.c → modules/db_perlvdb/perlvdbfunc.c

@@ -28,7 +28,7 @@
 #include <ctype.h>
 #include <stdio.h>
 
-#include "perlvdb.h"
+#include "db_perlvdb.h"
 #include "perlvdbfunc.h"
 #include "../../str.h"
 

+ 0 - 0
modules/perlvdb/perlvdbfunc.h → modules/db_perlvdb/perlvdbfunc.h