|
@@ -36,13 +36,13 @@ Bastian Friedrich
|
|
|
1.6.1. perl_exec_simple(func, [param])
|
|
|
1.6.2. perl_exec(func, [param])
|
|
|
|
|
|
- 2. OpenSER Perl API
|
|
|
+ 2. Kamailio Perl API
|
|
|
|
|
|
- 2.1. OpenSER
|
|
|
+ 2.1. Kamailio
|
|
|
|
|
|
2.1.1. log(level,message)
|
|
|
|
|
|
- 2.2. OpenSER::Message
|
|
|
+ 2.2. Kamailio::Message
|
|
|
|
|
|
2.2.1. getType()
|
|
|
2.2.2. getStatus()
|
|
@@ -67,7 +67,7 @@ Bastian Friedrich
|
|
|
2.2.21. next_branches()
|
|
|
2.2.22. getParsedRURI()
|
|
|
|
|
|
- 2.3. OpenSER::URI
|
|
|
+ 2.3. Kamailio::URI
|
|
|
|
|
|
2.3.1. user()
|
|
|
2.3.2. host()
|
|
@@ -90,13 +90,13 @@ Bastian Friedrich
|
|
|
2.3.19. lr_val()
|
|
|
2.3.20. r2_val()
|
|
|
|
|
|
- 2.4. OpenSER::AVP
|
|
|
+ 2.4. Kamailio::AVP
|
|
|
|
|
|
2.4.1. add(name,val)
|
|
|
2.4.2. get(name)
|
|
|
2.4.3. destroy(name)
|
|
|
|
|
|
- 2.5. OpenSER::Utils::PhoneNumbers
|
|
|
+ 2.5. Kamailio::Utils::PhoneNumbers
|
|
|
|
|
|
2.5.1.
|
|
|
new(publicAccessPrefix,internationalPrefix,lon
|
|
@@ -106,7 +106,7 @@ Bastian Friedrich
|
|
|
2.5.2. canonicalForm( number [, context] )
|
|
|
2.5.3. dialNumber( number [, context] )
|
|
|
|
|
|
- 2.6. OpenSER::LDAPUtils::LDAPConf
|
|
|
+ 2.6. Kamailio::LDAPUtils::LDAPConf
|
|
|
|
|
|
2.6.1. Constructor new()
|
|
|
2.6.2. Method base()
|
|
@@ -118,51 +118,51 @@ Bastian Friedrich
|
|
|
2.6.8. Method binddn()
|
|
|
2.6.9. Method bindpw()
|
|
|
|
|
|
- 2.7. OpenSER::LDAPUtils::LDAPConnection
|
|
|
+ 2.7. Kamailio::LDAPUtils::LDAPConnection
|
|
|
|
|
|
2.7.1. Constructor new( [config, [authenticated]] )
|
|
|
2.7.2. Function/Method search( conf, filter, base,
|
|
|
[requested_attributes ...])
|
|
|
|
|
|
- 2.8. OpenSER::VDB
|
|
|
- 2.9. OpenSER::Constants
|
|
|
- 2.10. OpenSER::VDB::Adapter::Speeddial
|
|
|
- 2.11. OpenSER::VDB::Adapter::Alias
|
|
|
+ 2.8. Kamailio::VDB
|
|
|
+ 2.9. Kamailio::Constants
|
|
|
+ 2.10. Kamailio::VDB::Adapter::Speeddial
|
|
|
+ 2.11. Kamailio::VDB::Adapter::Alias
|
|
|
|
|
|
2.11.1. query(conds,retkeys,order)
|
|
|
|
|
|
- 2.12. OpenSER::VDB::Adapter::AccountingSIPtrace
|
|
|
- 2.13. OpenSER::VDB::Adapter::Describe
|
|
|
- 2.14. OpenSER::VDB::Adapter::Auth
|
|
|
- 2.15. OpenSER::VDB::ReqCond
|
|
|
+ 2.12. Kamailio::VDB::Adapter::AccountingSIPtrace
|
|
|
+ 2.13. Kamailio::VDB::Adapter::Describe
|
|
|
+ 2.14. Kamailio::VDB::Adapter::Auth
|
|
|
+ 2.15. Kamailio::VDB::ReqCond
|
|
|
|
|
|
2.15.1. new(key,op,type,name)
|
|
|
2.15.2. op()
|
|
|
|
|
|
- 2.16. OpenSER::VDB::Pair
|
|
|
+ 2.16. Kamailio::VDB::Pair
|
|
|
|
|
|
2.16.1. new(key,type,name)
|
|
|
2.16.2. key()
|
|
|
|
|
|
- 2.17. OpenSER::VDB::VTab
|
|
|
+ 2.17. Kamailio::VDB::VTab
|
|
|
|
|
|
2.17.1. new()
|
|
|
2.17.2. call(op,[args])
|
|
|
|
|
|
- 2.18. OpenSER::VDB::Value
|
|
|
+ 2.18. Kamailio::VDB::Value
|
|
|
|
|
|
2.18.1. stringification
|
|
|
2.18.2. new(type,data)
|
|
|
2.18.3. type()
|
|
|
2.18.4. data()
|
|
|
|
|
|
- 2.19. OpenSER::VDB::Column
|
|
|
+ 2.19. Kamailio::VDB::Column
|
|
|
|
|
|
2.19.1. Stringification
|
|
|
2.19.2. new(type,name)
|
|
|
2.19.3. type( )
|
|
|
2.19.4. name()
|
|
|
- 2.19.5. OpenSER::VDB::Result
|
|
|
+ 2.19.5. Kamailio::VDB::Result
|
|
|
2.19.6. new(coldefs,[row, row, ...])
|
|
|
2.19.7. coldefs()
|
|
|
2.19.8. rows()
|
|
@@ -186,12 +186,12 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
1.1. Overview
|
|
|
|
|
|
- The time needed when writing a new OpenSER module unfortunately
|
|
|
+ The time needed when writing a new Kamailio module unfortunately
|
|
|
is quite high, while the options provided by the configuration
|
|
|
file are limited to the features implemented in the modules.
|
|
|
|
|
|
With this Perl module, you can easily implement your own
|
|
|
- OpenSER extensions in Perl. This allows for simple access to
|
|
|
+ Kamailio extensions in Perl. This allows for simple access to
|
|
|
the full world of CPAN modules. SIP URI rewriting could be
|
|
|
implemented based on regular expressions; accessing arbitrary
|
|
|
data backends, e.g. LDAP or Berkeley DB files, is now extremely
|
|
@@ -199,7 +199,7 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
1.2. Installing the module
|
|
|
|
|
|
- This Perl module is loaded in openser.cfg (just like all the
|
|
|
+ This Perl module is loaded in kamailio.cfg (just like all the
|
|
|
other modules) with loadmodule("/path/to/perl.so");.
|
|
|
|
|
|
For the Perl module to compile, you need a reasonably recent
|
|
@@ -222,9 +222,9 @@ Utils/typemap"
|
|
|
1.3. Using the module
|
|
|
|
|
|
The Perl module has two interfaces: The perl side, and the
|
|
|
- OpenSER side. Once a Perl function is defined and loaded via
|
|
|
+ Kamailio side. Once a Perl function is defined and loaded via
|
|
|
the module parameters (see below), it may be called in
|
|
|
- OpenSER's configuration at an arbitary point. E.g., you could
|
|
|
+ Kamailio's configuration at an arbitary point. E.g., you could
|
|
|
write a function "ldap_alias" in Perl, and then execute
|
|
|
...
|
|
|
if (perl_exec("ldap_alias")) {
|
|
@@ -258,7 +258,7 @@ if (perl_exec("ldap_alias")) {
|
|
|
* Perl 5.8.x or later
|
|
|
|
|
|
Additionally, a number of perl modules should be installed. The
|
|
|
- OpenSER::LDAPUtils package relies on Net::LDAP to be installed.
|
|
|
+ Kamailio::LDAPUtils package relies on Net::LDAP to be installed.
|
|
|
One of the sample scripts needs IPC::Shareable
|
|
|
|
|
|
This module has been developed and tested with Perl 5.8.8, but
|
|
@@ -307,7 +307,7 @@ modparam("perl", "filename", "/home/john/openser/myperl.pl")
|
|
|
|
|
|
1.5.2. modpath (string)
|
|
|
|
|
|
- The path to the Perl modules included (OpenSER.pm et.al). It is
|
|
|
+ The path to the Perl modules included (Kamailio.pm et.al). It is
|
|
|
not absolutely crucial to set this path, as you may install the
|
|
|
Modules in Perl's standard path, or update the "%INC" variable
|
|
|
from within your script. Using this module parameter is the
|
|
@@ -345,7 +345,7 @@ if (method=="INVITE") {
|
|
|
Calls a perl function with passing it the current SIP message.
|
|
|
The SIP message is reflected by a Perl module that gives you
|
|
|
access to the information in the current SIP message
|
|
|
- (OpenSER::Message).
|
|
|
+ (Kamailio::Message).
|
|
|
|
|
|
The first parameter is the function to be called. An arbitrary
|
|
|
string may be passed as a parameter.
|
|
@@ -360,17 +360,17 @@ if (perl_exec("ldapalias")) {
|
|
|
};
|
|
|
...
|
|
|
|
|
|
-Chapter 2. OpenSER Perl API
|
|
|
+Chapter 2. Kamailio Perl API
|
|
|
|
|
|
-2.1. OpenSER
|
|
|
+2.1. Kamailio
|
|
|
|
|
|
- This module provides access to a limited number of OpenSER core
|
|
|
+ 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.
|
|
|
+ messages, they are located in the Kamailio::Message class below.
|
|
|
|
|
|
2.1.1. log(level,message)
|
|
|
|
|
|
- Logs the message with OpenSER's logging facility. The logging
|
|
|
+ Logs the message with Kamailio's logging facility. The logging
|
|
|
level is one of the following:
|
|
|
* L_ALERT
|
|
|
* L_CRIT
|
|
@@ -383,12 +383,12 @@ Chapter 2. OpenSER Perl API
|
|
|
Please note that this method is NOT automatically exported, as
|
|
|
it collides with the perl function log (which calculates the
|
|
|
logarithm). Either explicitly import the function (via use
|
|
|
- OpenSER qw ( log );), or call it with its full name:
|
|
|
-OpenSER::log(L_INFO, "foobar");
|
|
|
+ Kamailio qw ( log );), or call it with its full name:
|
|
|
+Kamailio::log(L_INFO, "foobar");
|
|
|
|
|
|
-2.2. OpenSER::Message
|
|
|
+2.2. Kamailio::Message
|
|
|
|
|
|
- This package provides access functions for an OpenSER sip_msg
|
|
|
+ This package provides access functions for an Kamailio sip_msg
|
|
|
structure and its sub-components. Through its means it is
|
|
|
possible to fully configure alternative routing decisions.
|
|
|
|
|
@@ -468,7 +468,7 @@ OpenSER::log(L_INFO, "foobar");
|
|
|
string1 and/or string2 may be omitted.
|
|
|
|
|
|
As this function provides access to the functions that are
|
|
|
- exported to the OpenSER configuration file, it is autoloaded
|
|
|
+ exported to the Kamailio configuration file, it is autoloaded
|
|
|
for unknown functions. Instead of writing
|
|
|
$m->moduleFunction("sl_send_reply", "500", "Internal Error");
|
|
|
$m->moduleFunction("xlog", "L_INFO", "foo");
|
|
@@ -479,7 +479,7 @@ $m->xlog("L_INFO", "foo");
|
|
|
|
|
|
WARNING
|
|
|
|
|
|
- In OpenSER 1.2, only a limited subset of module functions is
|
|
|
+ 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
|
|
@@ -581,7 +581,7 @@ $m->xlog("L_INFO", "foo");
|
|
|
|
|
|
2.2.13. log(level,message) (deprecated type)
|
|
|
|
|
|
- Logs the message with OpenSER's logging facility. The logging
|
|
|
+ Logs the message with Kamailio's logging facility. The logging
|
|
|
level is one of the following:
|
|
|
* L_ALERT
|
|
|
* L_CRIT
|
|
@@ -591,8 +591,8 @@ $m->xlog("L_INFO", "foo");
|
|
|
* 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.
|
|
|
|
|
|
2.2.14. rewrite_ruri(newruri)
|
|
|
|
|
@@ -638,9 +638,9 @@ if ($m->getRURI() =~ m/\@somedomain.net/) {
|
|
|
|
|
|
2.2.22. getParsedRURI()
|
|
|
|
|
|
- Returns the current destination URI as an OpenSER::URI object.
|
|
|
+ Returns the current destination URI as an Kamailio::URI object.
|
|
|
|
|
|
-2.3. OpenSER::URI
|
|
|
+2.3. Kamailio::URI
|
|
|
|
|
|
This package provides functions for access to sip_uri
|
|
|
structures.
|
|
@@ -725,9 +725,9 @@ if ($m->getRURI() =~ m/\@somedomain.net/) {
|
|
|
|
|
|
Returns the r2_val part of this URI.
|
|
|
|
|
|
-2.4. OpenSER::AVP
|
|
|
+2.4. 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.
|
|
|
|
|
@@ -739,13 +739,13 @@ if ($m->getRURI() =~ m/\@somedomain.net/) {
|
|
|
|
|
|
Add an AVP.
|
|
|
|
|
|
- Add an OpenSER AVP to its environment. name and val may both be
|
|
|
+ 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.
|
|
@@ -754,23 +754,23 @@ OpenSER::AVP::add(10, 10)
|
|
|
|
|
|
2.4.2. get(name)
|
|
|
|
|
|
- get an OpenSER AVP:
|
|
|
-my $numavp = OpenSER::AVP::get(5);
|
|
|
-my $stravp = OpenSER::AVP::get("foo");
|
|
|
+ get an Kamailio AVP:
|
|
|
+my $numavp = Kamailio::AVP::get(5);
|
|
|
+my $stravp = Kamailio::AVP::get("foo");
|
|
|
|
|
|
2.4.3. destroy(name)
|
|
|
|
|
|
Destroy an AVP.
|
|
|
-OpenSER::AVP::destroy(5);
|
|
|
-OpenSER::AVP::destroy("foo");
|
|
|
+Kamailio::AVP::destroy(5);
|
|
|
+Kamailio::AVP::destroy("foo");
|
|
|
|
|
|
-2.5. OpenSER::Utils::PhoneNumbers
|
|
|
+2.5. Kamailio::Utils::PhoneNumbers
|
|
|
|
|
|
- OpenSER::Utils::PhoneNumbers - Functions for canonical forms of
|
|
|
+ Kamailio::Utils::PhoneNumbers - Functions for canonical forms of
|
|
|
phone numbers.
|
|
|
-use OpenSER::Utils::PhoneNumbers;
|
|
|
+use Kamailio::Utils::PhoneNumbers;
|
|
|
|
|
|
-my $phonenumbers = new OpenSER::Utils::PhoneNumbers(
|
|
|
+my $phonenumbers = new Kamailio::Utils::PhoneNumbers(
|
|
|
publicAccessPrefix => "0",
|
|
|
internationalPrefix => "+",
|
|
|
longDistancePrefix => "0",
|
|
@@ -823,7 +823,7 @@ countryCode,areaCode,pbxCode)
|
|
|
|
|
|
The new operator returns an object of this type and sets its
|
|
|
locational context according to the passed parameters. See
|
|
|
- OpenSER::Utils::PhoneNumbers above.
|
|
|
+ Kamailio::Utils::PhoneNumbers above.
|
|
|
|
|
|
2.5.2. canonicalForm( number [, context] )
|
|
|
|
|
@@ -839,12 +839,12 @@ countryCode,areaCode,pbxCode)
|
|
|
second argument, a default context from the systems
|
|
|
configuration is used.
|
|
|
|
|
|
-2.6. OpenSER::LDAPUtils::LDAPConf
|
|
|
+2.6. Kamailio::LDAPUtils::LDAPConf
|
|
|
|
|
|
- OpenSER::LDAPUtils::LDAPConf - Read openldap config from
|
|
|
+ Kamailio::LDAPUtils::LDAPConf - Read openldap config from
|
|
|
standard config files.
|
|
|
-use OpenSER::LDAPUtils::LDAPConf;
|
|
|
-my $conf = new OpenSER::LDAPUtils::LDAPConf();
|
|
|
+use Kamailio::LDAPUtils::LDAPConf;
|
|
|
+my $conf = new Kamailio::LDAPUtils::LDAPConf();
|
|
|
|
|
|
This module may be used to retrieve the global LDAP
|
|
|
configuration as used by other LDAP software, such as
|
|
@@ -856,7 +856,7 @@ my $conf = new OpenSER::LDAPUtils::LDAPConf();
|
|
|
|
|
|
2.6.1. Constructor new()
|
|
|
|
|
|
- Returns a new, initialized OpenSER::LDAPUtils::LDAPConf object.
|
|
|
+ Returns a new, initialized Kamailio::LDAPUtils::LDAPConf object.
|
|
|
|
|
|
2.6.2. Method base()
|
|
|
|
|
@@ -900,20 +900,20 @@ my $conf = new OpenSER::LDAPUtils::LDAPConf();
|
|
|
server. When no bind password has been specified, returns the
|
|
|
rootbindpw if any.
|
|
|
|
|
|
-2.7. OpenSER::LDAPUtils::LDAPConnection
|
|
|
+2.7. Kamailio::LDAPUtils::LDAPConnection
|
|
|
|
|
|
- OpenSER::LDAPUtils::LDAPConnection - Perl module to perform
|
|
|
+ Kamailio::LDAPUtils::LDAPConnection - Perl module to perform
|
|
|
simple LDAP queries.
|
|
|
|
|
|
OO-Style interface:
|
|
|
-use OpenSER::LDAPUtils::LDAPConnection;
|
|
|
-my $ldap = new OpenSER::LDAPUtils::LDAPConnection;
|
|
|
+use Kamailio::LDAPUtils::LDAPConnection;
|
|
|
+my $ldap = new Kamailio::LDAPUtils::LDAPConnection;
|
|
|
my @rows = $ldap-search("uid=andi","ou=people,ou=coreworks,ou=de");
|
|
|
|
|
|
Procedural interface:
|
|
|
-use OpenSER::LDAPUtils::LDAPConnection;
|
|
|
+use Kamailio::LDAPUtils::LDAPConnection;
|
|
|
my @rows = $ldap->search(
|
|
|
- new OpenSER::LDAPUtils::LDAPConfig(), "uid=andi","ou=people,ou=cor
|
|
|
+ new Kamailio::LDAPUtils::LDAPConfig(), "uid=andi","ou=people,ou=cor
|
|
|
eworks,ou=de");
|
|
|
|
|
|
This perl module offers a somewhat simplified interface to the
|
|
@@ -927,9 +927,9 @@ eworks,ou=de");
|
|
|
|
|
|
The first argument, when given, should be a hash reference
|
|
|
pointing to to the connection parameters, possibly an
|
|
|
- OpenSER::LDAPUtils::LDAPConfig object. This argument may be
|
|
|
+ Kamailio::LDAPUtils::LDAPConfig object. This argument may be
|
|
|
undef in which case a new (default)
|
|
|
- OpenSER::LDAPUtils::LDAPConfig object is used.
|
|
|
+ Kamailio::LDAPUtils::LDAPConfig object is used.
|
|
|
|
|
|
When the optional second argument is a true value, the
|
|
|
connection will be authenticated. Otherwise an anonymous bind
|
|
@@ -947,14 +947,14 @@ eworks,ou=de");
|
|
|
returned.
|
|
|
|
|
|
When the first argument (conf) is a
|
|
|
- OpenSER::LDAPUtils::LDAPConnection, it will be used to perform
|
|
|
+ Kamailio::LDAPUtils::LDAPConnection, it will be used to perform
|
|
|
the queries. You can pass the first argument implicitly by
|
|
|
using the "method" syntax.
|
|
|
|
|
|
Otherwise the conf argument should be a reference to a hash
|
|
|
containing the connection setup parameters as contained in a
|
|
|
- OpenSER::LDAPUtils::LDAPConf object. In this mode, the
|
|
|
- OpenSER::LDAPUtils::LDAPConnection from previous queries will
|
|
|
+ Kamailio::LDAPUtils::LDAPConf object. In this mode, the
|
|
|
+ Kamailio::LDAPUtils::LDAPConnection from previous queries will
|
|
|
be reused.
|
|
|
|
|
|
2.7.2.1. Arguments:
|
|
@@ -984,27 +984,27 @@ eworks,ou=de");
|
|
|
those attibutes. When multiple entries match the query, the
|
|
|
attribute lists are concatenated.
|
|
|
|
|
|
-2.8. OpenSER::VDB
|
|
|
+2.8. Kamailio::VDB
|
|
|
|
|
|
This package is an (abstract) base class for all virtual
|
|
|
databases. Derived packages can be configured to be used by
|
|
|
- OpenSER as a database.
|
|
|
+ Kamailio as a database.
|
|
|
|
|
|
The base class itself should NOT be used in this context, as it
|
|
|
does not provide any functionality.
|
|
|
|
|
|
-2.9. OpenSER::Constants
|
|
|
+2.9. Kamailio::Constants
|
|
|
|
|
|
This package provides a number of constants taken from enums
|
|
|
- and defines of OpenSER header files. Unfortunately, there is no
|
|
|
+ and defines of Kamailio header files. Unfortunately, there is no
|
|
|
mechanism for updating the constants automatically, so check
|
|
|
the values if you are in doubt.
|
|
|
|
|
|
-2.10. OpenSER::VDB::Adapter::Speeddial
|
|
|
+2.10. Kamailio::VDB::Adapter::Speeddial
|
|
|
|
|
|
This adapter can be used with the speeddial module.
|
|
|
|
|
|
-2.11. OpenSER::VDB::Adapter::Alias
|
|
|
+2.11. Kamailio::VDB::Adapter::Alias
|
|
|
|
|
|
This package is intended for usage with the alias_db module.
|
|
|
The query VTab has to take two arguments and return an array of
|
|
@@ -1015,12 +1015,12 @@ eworks,ou=de");
|
|
|
Queries the vtab with the given arguments for request
|
|
|
conditions, keys to return and sort order column name.
|
|
|
|
|
|
-2.12. OpenSER::VDB::Adapter::AccountingSIPtrace
|
|
|
+2.12. Kamailio::VDB::Adapter::AccountingSIPtrace
|
|
|
|
|
|
This package is an Adapter for the acc and siptrace modules,
|
|
|
featuring only an insert operation.
|
|
|
|
|
|
-2.13. OpenSER::VDB::Adapter::Describe
|
|
|
+2.13. Kamailio::VDB::Adapter::Describe
|
|
|
|
|
|
This package is intended for debug usage. It will print
|
|
|
information about requested functions and operations of a
|
|
@@ -1029,19 +1029,19 @@ eworks,ou=de");
|
|
|
Use this module to request schema information when creating new
|
|
|
adapters.
|
|
|
|
|
|
-2.14. OpenSER::VDB::Adapter::Auth
|
|
|
+2.14. Kamailio::VDB::Adapter::Auth
|
|
|
|
|
|
This adapter is intended for usage with the auth_db module. The
|
|
|
VTab should take a username as an argument and return a (plain
|
|
|
text!) password.
|
|
|
|
|
|
-2.15. OpenSER::VDB::ReqCond
|
|
|
+2.15. Kamailio::VDB::ReqCond
|
|
|
|
|
|
This package represents a request condition for database
|
|
|
access, consisting of a column name, an operator (=, <, >,
|
|
|
...), a data type and a value.
|
|
|
|
|
|
- This package inherits from OpenSER::VDB::Pair and thus includes
|
|
|
+ This package inherits from Kamailio::VDB::Pair and thus includes
|
|
|
its methods.
|
|
|
|
|
|
2.15.1. new(key,op,type,name)
|
|
@@ -1052,12 +1052,12 @@ eworks,ou=de");
|
|
|
|
|
|
Returns or sets the current operator.
|
|
|
|
|
|
-2.16. OpenSER::VDB::Pair
|
|
|
+2.16. Kamailio::VDB::Pair
|
|
|
|
|
|
This package represents database key/value pairs, consisting of
|
|
|
a key, a value type, and the value.
|
|
|
|
|
|
- This package inherits from OpenSER::VDB::Value and thus has the
|
|
|
+ This package inherits from Kamailio::VDB::Value and thus has the
|
|
|
same methods.
|
|
|
|
|
|
2.16.1. new(key,type,name)
|
|
@@ -1068,10 +1068,10 @@ eworks,ou=de");
|
|
|
|
|
|
Returns or sets the current key.
|
|
|
|
|
|
-2.17. OpenSER::VDB::VTab
|
|
|
+2.17. Kamailio::VDB::VTab
|
|
|
|
|
|
This package handles virtual tables and is used by the
|
|
|
- OpenSER::VDB class to store information about valid tables. The
|
|
|
+ Kamailio::VDB class to store information about valid tables. The
|
|
|
package is not inteded for end user access.
|
|
|
|
|
|
2.17.1. new()
|
|
@@ -1083,27 +1083,27 @@ Constructs a new VTab object
|
|
|
Invokes an operation on the table (insert, update, ...) with
|
|
|
the given arguments.
|
|
|
|
|
|
-2.18. OpenSER::VDB::Value
|
|
|
+2.18. Kamailio::VDB::Value
|
|
|
|
|
|
This package represents a database value. Additional to the
|
|
|
data itself, information about its type is stored.
|
|
|
|
|
|
2.18.1. stringification
|
|
|
|
|
|
- When accessing a OpenSER::VDB::Value object as a string, it
|
|
|
+ When accessing a Kamailio::VDB::Value object as a string, it
|
|
|
simply returns its data regardless of its type. =cut
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
- package OpenSER::VDB::Value;
|
|
|
+ package Kamailio::VDB::Value;
|
|
|
|
|
|
use overload '""' => \&stringify;
|
|
|
|
|
|
sub stringify { shift->{data} }
|
|
|
|
|
|
- use OpenSER; use OpenSER::Constants;
|
|
|
+ use Kamailio; use Kamailio::Constants;
|
|
|
|
|
|
- our @ISA = qw ( OpenSER::Utils::Debug );
|
|
|
+ our @ISA = qw ( Kamailio::Utils::Debug );
|
|
|
|
|
|
2.18.2. new(type,data)
|
|
|
|
|
@@ -1113,31 +1113,31 @@ Constructs a new VTab object
|
|
|
2.18.3. type()
|
|
|
|
|
|
Returns or sets the current data type. Please consider using
|
|
|
- the constants from OpenSER::Constants
|
|
|
+ the constants from Kamailio::Constants
|
|
|
|
|
|
2.18.4. data()
|
|
|
|
|
|
Returns or sets the current data.
|
|
|
|
|
|
-2.19. OpenSER::VDB::Column
|
|
|
+2.19. Kamailio::VDB::Column
|
|
|
|
|
|
This package represents database column definition, consisting
|
|
|
of a column name and its data type.
|
|
|
|
|
|
2.19.1. Stringification
|
|
|
|
|
|
- When accessing a OpenSER::VDB::Column object as a string, it
|
|
|
+ When accessing a Kamailio::VDB::Column object as a string, it
|
|
|
simply returns its column name regardless of its type. =cut
|
|
|
|
|
|
- package OpenSER::VDB::Column;
|
|
|
+ package Kamailio::VDB::Column;
|
|
|
|
|
|
use overload '""' => \&stringify;
|
|
|
|
|
|
sub stringify { shift->{name} }
|
|
|
|
|
|
- use OpenSER; use OpenSER::Constants;
|
|
|
+ use Kamailio; use Kamailio::Constants;
|
|
|
|
|
|
- our @ISA = qw ( OpenSER::Utils::Debug );
|
|
|
+ our @ISA = qw ( Kamailio::Utils::Debug );
|
|
|
|
|
|
2.19.2. new(type,name)
|
|
|
|
|
@@ -1147,13 +1147,13 @@ Constructs a new VTab object
|
|
|
2.19.3. type( )
|
|
|
|
|
|
Returns or sets the current type. Please consider using the
|
|
|
- constants from OpenSER::Constants
|
|
|
+ constants from Kamailio::Constants
|
|
|
|
|
|
2.19.4. name()
|
|
|
|
|
|
Returns or sets the current column name.
|
|
|
|
|
|
-2.19.5. OpenSER::VDB::Result
|
|
|
+2.19.5. Kamailio::VDB::Result
|
|
|
|
|
|
This class represents a VDB result set. It contains a column
|
|
|
definition, plus an array of rows. Rows themselves are simply
|
|
@@ -1162,7 +1162,7 @@ Constructs a new VTab object
|
|
|
2.19.6. new(coldefs,[row, row, ...])
|
|
|
|
|
|
The constructor creates a new Result object. Its first
|
|
|
- parameter is a reference to an array of OpenSER::VDB::Column
|
|
|
+ parameter is a reference to an array of Kamailio::VDB::Column
|
|
|
objects. Additional parameters may be passed to provide initial
|
|
|
rows, which are references to arrays of scalars.
|
|
|
|
|
@@ -1199,7 +1199,7 @@ Chapter 3. Perl samples
|
|
|
The minimal function in branches.pl demonstrates that you can
|
|
|
access the "append_branch" function from within perl, just as
|
|
|
you would have done from your normal configuration file. You'll
|
|
|
- find documentation on the concepts of branching in the OpenSER
|
|
|
+ find documentation on the concepts of branching in the Kamailio
|
|
|
documentation.
|
|
|
|
|
|
3.1.1.2. firstline.pl
|
|
@@ -1211,9 +1211,9 @@ Chapter 3. Perl samples
|
|
|
|
|
|
3.1.1.3. flags.pl
|
|
|
|
|
|
- The perl module provides access to OpenSER's flagging
|
|
|
- mechanism. The flag names available for OpenSER modules are
|
|
|
- made available through the OpenSER::Constants package, so you
|
|
|
+ The perl module provides access to Kamailio's flagging
|
|
|
+ mechanism. The flag names available for Kamailio modules are
|
|
|
+ made available through the Kamailio::Constants package, so you
|
|
|
can flag messages as "green", "magenta" etc.
|
|
|
|
|
|
The first function, setflag, demonstrates how the "green" flag
|
|
@@ -1224,7 +1224,7 @@ Chapter 3. Perl samples
|
|
|
|
|
|
This sample script demonstrates different things related to
|
|
|
calling functions from within perl, and the different types of
|
|
|
- functions you can offer for OpenSER access.
|
|
|
+ functions you can offer for Kamailio access.
|
|
|
|
|
|
"exportedfuncs" simply demonstrates that you can use the
|
|
|
moduleFunction method to call functions offered by other
|
|
@@ -1235,19 +1235,19 @@ Chapter 3. Perl samples
|
|
|
addresses are passed to the alias_db module.
|
|
|
|
|
|
Please note that the moduleFunction method is not fully
|
|
|
- available in OpenSER 1.2. See the method's documentation for
|
|
|
+ available in Kamailio 1.2. See the method's documentation for
|
|
|
details.
|
|
|
|
|
|
"paramfunc" shows that you can pass arbitrary strings to perl
|
|
|
functions. Do with them whatever you want :)
|
|
|
|
|
|
"autotest" demonstrates that unknown functions in
|
|
|
- OpenSER::Message objects are automatically transformed into
|
|
|
+ Kamailio::Message objects are automatically transformed into
|
|
|
calls to module functions.
|
|
|
|
|
|
The "diefunc"s show that dying perl scripts - by "manual"
|
|
|
- dying, or because of script errors - are handled by the OpenSER
|
|
|
- package. The error message is logged through OpenSER's logging
|
|
|
+ dying, or because of script errors - are handled by the Kamailio
|
|
|
+ package. The error message is logged through Kamailio's logging
|
|
|
mechanism. Please note that this only works correctly if you do
|
|
|
NOT overwrite the default die handler. Oh, yes, that works for
|
|
|
warnings, too.
|
|
@@ -1269,15 +1269,15 @@ Chapter 3. Perl samples
|
|
|
|
|
|
For debugging purposes, you probably want to write messages to
|
|
|
the syslog. The "logdemo" shows three ways to access the
|
|
|
- OpenSER log function: it is available through the OpenSER class
|
|
|
- as well as through the OpenSER::Message class.
|
|
|
+ Kamailio log function: it is available through the Kamailio class
|
|
|
+ as well as through the Kamailio::Message class.
|
|
|
|
|
|
Remember that you can use exported functions from other
|
|
|
modules. You may thus as well use the "xlog" module and it's
|
|
|
xlog function.
|
|
|
|
|
|
The L_INFO, L_DBG, L_ERR, L_CRIT... constants are available
|
|
|
- through the OpenSER::Constants package.
|
|
|
+ through the Kamailio::Constants package.
|
|
|
|
|
|
3.1.1.7. messagedump.pl
|
|
|
|
|
@@ -1292,13 +1292,13 @@ Chapter 3. Perl samples
|
|
|
data across multiple calls to your Perl functions. Your first
|
|
|
option is to use global variables in your script.
|
|
|
Unfortunately, these globals are not visible from the mulitple
|
|
|
- instances of OpenSER. You may want to use a mechanism such as
|
|
|
+ instances of Kamailio. You may want to use a mechanism such as
|
|
|
the IPC::Shareable shared memory access package to correct
|
|
|
this.
|
|
|
|
|
|
3.1.1.9. phonenumbers.pl
|
|
|
|
|
|
- The OpenSER::Utils::PhoneNumbers package provides two methods
|
|
|
+ The Kamailio::Utils::PhoneNumbers package provides two methods
|
|
|
for the transformation of local to canonical telephone numbers,
|
|
|
and vice versa. This script demonstrates it's use.
|
|
|
|
|
@@ -1322,14 +1322,14 @@ Chapter 4. Frequently Asked Questions
|
|
|
regarded as bugs.
|
|
|
* Missing module functions. Not all functions of other
|
|
|
modules are available for Perl access. The reason for this
|
|
|
- is a design property of OpenSER. Making available more
|
|
|
+ is a design property of Kamailio. Making available more
|
|
|
functions is work in progress.
|
|
|
* Perl and threads. Perl itself is, when compiled with the
|
|
|
correct parameters, thread safe; unfortunately, not all
|
|
|
Perl modules are. The DBI modules, especially (but not
|
|
|
restricted to) DBI::ODBC are known NOT to be thread safe.
|
|
|
Using DBI::ODBC -- and possibly other non-thread-safe Perl
|
|
|
- extensions -- may result in erroneous behavior of OpenSER,
|
|
|
+ extensions -- may result in erroneous behavior of Kamailio,
|
|
|
including (but not restricted to) server crashes and wrong
|
|
|
routing.
|
|
|
|