|
@@ -8,7 +8,7 @@ Edited by
|
|
|
|
|
|
Bogdan-Andrei Iancu
|
|
|
|
|
|
- Copyright © 2003 FhG FOKUS
|
|
|
+ Copyright © 2003 FhG FOKUS
|
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
@@ -42,7 +42,7 @@ Bogdan-Andrei Iancu
|
|
|
|
|
|
4. Functions
|
|
|
|
|
|
- 4.1. cpl_run_script(type,mode)
|
|
|
+ 4.1. cpl_run_script(type,mode, [uri])
|
|
|
4.2. cpl_process_register()
|
|
|
4.3. cpl_process_register_norpl()
|
|
|
|
|
@@ -109,7 +109,7 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
4. Functions
|
|
|
|
|
|
- 4.1. cpl_run_script(type,mode)
|
|
|
+ 4.1. cpl_run_script(type,mode, [uri])
|
|
|
4.2. cpl_process_register()
|
|
|
4.3. cpl_process_register_norpl()
|
|
|
|
|
@@ -180,7 +180,7 @@ Chapter 1. Admin Guide
|
|
|
name and password can be specified for allowing the module to connect
|
|
|
to the database server.
|
|
|
|
|
|
- Default value is “mysql://openser:openserrw@localhost/openser�.
|
|
|
+ Default value is "mysql://kamailio:kamailiorw@localhost/kamailio".
|
|
|
|
|
|
Example 1.1. Set db_url parameter
|
|
|
...
|
|
@@ -190,11 +190,11 @@ modparam("cpl-c","db_url","dbdriver://username:password@dbhost/dbname")
|
|
|
3.2. db_table (string)
|
|
|
|
|
|
Indicates the name of the table that store the CPL scripts. This table
|
|
|
- must be locate into the database specified by “db_url� parameter. For
|
|
|
+ must be locate into the database specified by "db_url" parameter. For
|
|
|
more about the format of the CPL table please see the
|
|
|
modules/cpl-c/init.mysql file.
|
|
|
|
|
|
- Default value is “cpl�.
|
|
|
+ Default value is "cpl".
|
|
|
|
|
|
Example 1.2. Set db_table parameter
|
|
|
...
|
|
@@ -205,7 +205,7 @@ modparam("cpl-c","cpl_table","cpl")
|
|
|
|
|
|
Indicates the name of the column used for storing the username.
|
|
|
|
|
|
- Default value is “username�.
|
|
|
+ Default value is "username".
|
|
|
|
|
|
Example 1.3. Set username_column parameter
|
|
|
...
|
|
@@ -216,7 +216,7 @@ modparam("cpl-c","username_column","username")
|
|
|
|
|
|
Indicates the name of the column used for storing the domain.
|
|
|
|
|
|
- Default value is “domain�.
|
|
|
+ Default value is "domain".
|
|
|
|
|
|
Example 1.4. Set domain_column parameter
|
|
|
...
|
|
@@ -228,7 +228,7 @@ modparam("cpl-c","domain_column","domain")
|
|
|
Indicates the name of the column used for storing the the XML version
|
|
|
of the cpl script.
|
|
|
|
|
|
- Default value is “cpl_xml�.
|
|
|
+ Default value is "cpl_xml".
|
|
|
|
|
|
Example 1.5. Set cpl_xml_column parameter
|
|
|
...
|
|
@@ -240,7 +240,7 @@ modparam("cpl-c","cpl_xml_column","cpl_xml")
|
|
|
Indicates the name of the column used for storing the the binary
|
|
|
version of the cpl script (compiled version).
|
|
|
|
|
|
- Default value is “cpl_bin�.
|
|
|
+ Default value is "cpl_bin".
|
|
|
|
|
|
Example 1.6. Set cpl_bin_column parameter
|
|
|
...
|
|
@@ -378,7 +378,7 @@ modparam("cpl-c","lookup_append_branches",1)
|
|
|
Indicates if the domain part of the URI should be used in user
|
|
|
identification (otherwise only username part will be used).
|
|
|
|
|
|
- Default value is “0 (disabled)�.
|
|
|
+ Default value is "0 (disabled)".
|
|
|
|
|
|
Example 1.16. Set use_domain parameter
|
|
|
...
|
|
@@ -387,11 +387,11 @@ modparam("cpl-c","use_domain",1)
|
|
|
|
|
|
4. Functions
|
|
|
|
|
|
- 4.1. cpl_run_script(type,mode)
|
|
|
+ 4.1. cpl_run_script(type,mode, [uri])
|
|
|
4.2. cpl_process_register()
|
|
|
4.3. cpl_process_register_norpl()
|
|
|
|
|
|
-4.1. cpl_run_script(type,mode)
|
|
|
+4.1. cpl_run_script(type,mode, [uri])
|
|
|
|
|
|
Starts the execution of the CPL script. The user name is fetched from
|
|
|
new_uri or requested uri or from To header -in this order- (for
|
|
@@ -438,6 +438,8 @@ modparam("cpl-c","use_domain",1)
|
|
|
done stateful (retransmission protection) and in the same time, if
|
|
|
returning to script, it will be in stateless mode (easy to continue
|
|
|
the routing script execution)
|
|
|
+ * uri - optional - provide the SIP URI to be used for loading the CPL
|
|
|
+ script, instead of taking it from R-URI or headers.
|
|
|
|
|
|
This function can be used from REQUEST_ROUTE.
|
|
|
|
|
@@ -446,7 +448,7 @@ modparam("cpl-c","use_domain",1)
|
|
|
cpl_run_script("incoming","force_stateful");
|
|
|
...
|
|
|
|
|
|
-4.2. cpl_process_register()
|
|
|
+4.2. cpl_process_register()
|
|
|
|
|
|
This function MUST be called only for REGISTER requests. It checks if
|
|
|
the current REGISTER request is related or not with CPL script
|
|
@@ -474,9 +476,9 @@ if (method=="REGISTER") {
|
|
|
}
|
|
|
...
|
|
|
|
|
|
-4.3. cpl_process_register_norpl()
|
|
|
+4.3. cpl_process_register_norpl()
|
|
|
|
|
|
- Same as “cpl_process_register� without internally generating the reply.
|
|
|
+ Same as "cpl_process_register" without internally generating the reply.
|
|
|
All information (script) is appended to the reply but without sending
|
|
|
it out.
|
|
|
|
|
@@ -500,7 +502,7 @@ if (method=="REGISTER") {
|
|
|
5.2. REMOVE_CPL
|
|
|
5.3. GET_CPL
|
|
|
|
|
|
-5.1. LOAD_CPL
|
|
|
+5.1. LOAD_CPL
|
|
|
|
|
|
For the given user, loads the XML cpl file, compiles it into binary
|
|
|
format and stores both format into database.
|
|
@@ -517,7 +519,7 @@ if (method=="REGISTER") {
|
|
|
cpl_filename
|
|
|
_empty_line_
|
|
|
|
|
|
-5.2. REMOVE_CPL
|
|
|
+5.2. REMOVE_CPL
|
|
|
|
|
|
For the given user, removes the entire database record (XML cpl and
|
|
|
binary cpl); user with empty cpl scripts are not accepted.
|
|
@@ -532,7 +534,7 @@ if (method=="REGISTER") {
|
|
|
username
|
|
|
_empty_line_
|
|
|
|
|
|
-5.3. GET_CPL
|
|
|
+5.3. GET_CPL
|
|
|
|
|
|
For the given user, returns the CPL script in XML format.
|
|
|
|