Module: kamailio
Branch: master
Commit: 2664a51c35a1e8b5adc4c7e6cedde60bc01f0b28
URL: https://github.com/kamailio/kamailio/commit/2664a51c35a1e8b5adc4c7e6cedde60…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: 2021-02-11T17:27:44+02:00
Fixed typo.
---
Modified: src/modules/rr/doc/rr_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/2664a51c35a1e8b5adc4c7e6cedde60…
Patch: https://github.com/kamailio/kamailio/commit/2664a51c35a1e8b5adc4c7e6cedde60…
---
diff --git a/src/modules/rr/doc/rr_admin.xml b/src/modules/rr/doc/rr_admin.xml
index a925014715..7dc08b7b5c 100644
--- a/src/modules/rr/doc/rr_admin.xml
+++ b/src/modules/rr/doc/rr_admin.xml
@@ -560,7 +560,7 @@ remove_record_route();
scheme (sip: or sips:), one is added based on routing requirements. Thus
the value has to be like "address:port;parameters", the port and
parameters are optional. If the second parameter is provided, do not
- forget to add the parameter "r2=0" so the proxy processes both
+ forget to add the parameter "r2=on" so the proxy processes both
corresponding Route headers at once.</para>
<para>When the <quote>outbound</quote> module was loaded before this
Module: kamailio
Branch: master
Commit: 5064ffc6490ed9db3f92a171e6b950fd0e8056e6
URL: https://github.com/kamailio/kamailio/commit/5064ffc6490ed9db3f92a171e6b950f…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2021-02-15T08:46:22+01:00
modules: readme files regenerated - secsipid ... [skip ci]
---
Modified: src/modules/secsipid/README
---
Diff: https://github.com/kamailio/kamailio/commit/5064ffc6490ed9db3f92a171e6b950f…
Patch: https://github.com/kamailio/kamailio/commit/5064ffc6490ed9db3f92a171e6b950f…
---
diff --git a/src/modules/secsipid/README b/src/modules/secsipid/README
index c125b689d6..87ed1f9287 100644
--- a/src/modules/secsipid/README
+++ b/src/modules/secsipid/README
@@ -30,6 +30,7 @@ Daniel-Constantin Mierla
3.2. timeout (int)
3.3. cache_dir (str)
3.4. cache_expire (int)
+ 3.5. modproc (str)
4. Functions
@@ -47,11 +48,12 @@ Daniel-Constantin Mierla
1.2. Set timeout parameter
1.3. Set cache_dir parameter
1.4. Set cache_expire parameter
- 1.5. secsipid_check_identity usage
- 1.6. secsipid_check_identity_pubkey usage
- 1.7. secsipid_get_url usage
- 1.8. secsipid_add_identity usage
- 1.9. Libsecsipid usage
+ 1.5. Set modproc parameter
+ 1.6. secsipid_check_identity usage
+ 1.7. secsipid_check_identity_pubkey usage
+ 1.8. secsipid_get_url usage
+ 1.9. secsipid_add_identity usage
+ 1.10. Libsecsipid usage
Chapter 1. Admin Guide
@@ -69,6 +71,7 @@ Chapter 1. Admin Guide
3.2. timeout (int)
3.3. cache_dir (str)
3.4. cache_expire (int)
+ 3.5. modproc (str)
4. Functions
@@ -89,6 +92,11 @@ Chapter 1. Admin Guide
It exports the functions to check and generate SIP Identity header.
+ Note that this module needs "secsipid_proc.so" module to be installed,
+ but without loading the "secsipid_proc.so" via "loadmodule". This
+ module loads "secsipid_proc.so" in child init callback in order to
+ initialize the "libsecsipid" per child process.
+
2. Dependencies
2.1. Kamailio Modules
@@ -96,14 +104,15 @@ Chapter 1. Admin Guide
2.1. Kamailio Modules
- The following modules must be loaded before this module:
- * No dependencies on other Kamailio modules.
+ The following modules must be installed (but not loaded) to use this
+ module:
+ * secsipid_proc.
2.2. External Libraries or Applications
The following libraries or applications must be installed before
running Kamailio with this module loaded:
- * libsecsipid - https://github.com/asipto/secsipidx/.
+ * none.
3. Parameters
@@ -111,6 +120,7 @@ Chapter 1. Admin Guide
3.2. timeout (int)
3.3. cache_dir (str)
3.4. cache_expire (int)
+ 3.5. modproc (str)
3.1. expire (int)
@@ -160,6 +170,17 @@ modparam("secsipid", "cache_dir", "/tmp/kamailio/secsipid")
modparam("secsipid", "cache_expire", 7200)
...
+3.5. modproc (str)
+
+ The name of or the path to the required per-process API module.
+
+ Default value is "secsipid_proc.so".
+
+ Example 1.5. Set modproc parameter
+...
+modparam("secsipid", "modproc", "secsipid_proc2.so")
+...
+
4. Functions
4.1. secsipid_check_identity(keyPath)
@@ -181,7 +202,7 @@ modparam("secsipid", "cache_expire", 7200)
This function can be used from ANY_ROUTE.
- Example 1.5. secsipid_check_identity usage
+ Example 1.6. secsipid_check_identity usage
...
request_route {
...
@@ -205,7 +226,7 @@ request_route {
This function can be used from ANY_ROUTE.
- Example 1.6. secsipid_check_identity_pubkey usage
+ Example 1.7. secsipid_check_identity_pubkey usage
...
request_route {
...
@@ -226,7 +247,7 @@ request_route {
This function can be used from ANY_ROUTE.
- Example 1.7. secsipid_get_url usage
+ Example 1.8. secsipid_get_url usage
...
request_route {
...
@@ -250,7 +271,7 @@ request_route {
This function can be used from ANY_ROUTE.
- Example 1.8. secsipid_add_identity usage
+ Example 1.9. secsipid_add_identity usage
...
request_route {
...
@@ -274,7 +295,7 @@ request_route {
installed and its environment configured, then run the following
commands:
- Example 1.9. Libsecsipid usage
+ Example 1.10. Libsecsipid usage
...
go get https://github.com/asipto/secsipidx
cd $GOPATH/src/github.com/asipto/secsipidx/csecsipid/
Module: kamailio
Branch: master
Commit: 25b1a51806dfa661f987958c8e84a16e60e37a4f
URL: https://github.com/kamailio/kamailio/commit/25b1a51806dfa661f987958c8e84a16…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-02-15T08:33:07+01:00
core: split function that locates a module file
---
Modified: src/core/sr_module.c
Modified: src/core/sr_module.h
---
Diff: https://github.com/kamailio/kamailio/commit/25b1a51806dfa661f987958c8e84a16…
Patch: https://github.com/kamailio/kamailio/commit/25b1a51806dfa661f987958c8e84a16…
---
diff --git a/src/core/sr_module.c b/src/core/sr_module.c
index a021cb92c3..0a7ba37848 100644
--- a/src/core/sr_module.c
+++ b/src/core/sr_module.c
@@ -376,44 +376,24 @@ static inline int version_control(void *handle, char *path)
}
/**
- * \brief load a sr module
+ * \brief lookup a module and fill the new path
*
- * tries to load the module specified by mod_path.
- * If mod_path is 'modname' or 'modname.so' then
- * \<MODS_DIR\>/\<modname\>.so will be tried and if this fails
- * \<MODS_DIR\>/\<modname\>/\<modname\>.so
- * If mod_path contain a '/' it is assumed to be the
- * path to the module and tried first. If fails and mod_path is not
- * absolute path (not starting with '/') then will try:
- * \<MODS_DIR\>/mod_path
* @param mod_path path or module name
+ * @param new_path resolved path to the module, must be pkg_free() if != mod_path
* @return 0 on success , <0 on error
*/
-int load_module(char* mod_path)
+int ksr_locate_module(char *mod_path, char **new_path)
{
- void* handle;
- char* error;
- mod_register_function mr;
- module_exports_t* exp;
- struct sr_module* t;
struct stat stat_buf;
str modname;
char* mdir;
char* nxt_mdir;
char* path;
int mdir_len;
- int len;
- int dlflags;
- int new_dlflags;
- int retries;
int path_type;
- str expref;
- char exbuf[64];
+ int len;
-#ifndef RTLD_NOW
-/* for openbsd */
-#define RTLD_NOW DL_LAZY
-#endif
+ *new_path = NULL;
path=mod_path;
path_type = 0;
modname.s = path;
@@ -523,6 +503,57 @@ int load_module(char* mod_path)
goto error;
}
}
+
+ LM_DBG("found module to load <%s>\n", path);
+ *new_path = path;
+ return 0;
+
+error:
+ if(path!=mod_path) {
+ pkg_free(path);
+ }
+
+ return -1;
+}
+
+/**
+ * \brief load a sr module
+ *
+ * tries to load the module specified by mod_path.
+ * If mod_path is 'modname' or 'modname.so' then
+ * \<MODS_DIR\>/\<modname\>.so will be tried and if this fails
+ * \<MODS_DIR\>/\<modname\>/\<modname\>.so
+ * If mod_path contain a '/' it is assumed to be the
+ * path to the module and tried first. If fails and mod_path is not
+ * absolute path (not starting with '/') then will try:
+ * \<MODS_DIR\>/mod_path
+ * @param mod_path path or module name
+ * @return 0 on success , <0 on error
+ */
+int load_module(char* mod_path)
+{
+ void* handle;
+ char* error;
+ mod_register_function mr;
+ module_exports_t* exp;
+ struct sr_module* t;
+ int dlflags;
+ int new_dlflags;
+ int retries;
+ char* path = NULL;
+ str expref;
+ char exbuf[64];
+ char* mdir;
+
+#ifndef RTLD_NOW
+/* for openbsd */
+#define RTLD_NOW DL_LAZY
+#endif
+
+ if(ksr_locate_module(mod_path, &path)<0) {
+ return -1;
+ }
+
LM_DBG("trying to load <%s>\n", path);
retries=2;
diff --git a/src/core/sr_module.h b/src/core/sr_module.h
index 1d3150b326..8de9026c2a 100644
--- a/src/core/sr_module.h
+++ b/src/core/sr_module.h
@@ -549,4 +549,6 @@ int destroy_modules_phase(void);
int ksr_shutdown_phase_init(void);
int ksr_shutdown_phase(void);
+int ksr_locate_module(char *mod_path, char **new_path);
+
#endif /* sr_module_h */