<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [X] Tested changes locally
- [X] Related to issue #2285
#### Description
This PR provides a hook to all into modules when all `fork_process()` is completed.
This is to that the module in the main process can perform post-fork cleanup.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2919
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2919/commits/cfc8f6373d3dd4cdb09f…">core: add a module hook for post-fork cleanup</a>
-- File Changes --
M src/core/sr_module.h (1)
M src/main.c (7)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2919.patchhttps://github.com/kamailio/kamailio/pull/2919.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2919
Module: kamailio
Branch: master
Commit: d2c22d2b72d7ffd616a6aaacbabc6184a8da56e7
URL: https://github.com/kamailio/kamailio/commit/d2c22d2b72d7ffd616a6aaacbabc618…
Author: Anthony Alba <ascanio.alba7(a)gmail.com>
Committer: Anthony Alba <ascanio.alba7(a)gmail.com>
Date: 2021-11-22T11:46:25+08:00
app_python3: Python >= 3.7 call PyOS_AfterFork_Parent in main context after all forks
---
Modified: src/modules/app_python3/app_python3_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/d2c22d2b72d7ffd616a6aaacbabc618…
Patch: https://github.com/kamailio/kamailio/commit/d2c22d2b72d7ffd616a6aaacbabc618…
---
diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c
index 8ec252039c..f710694d75 100644
--- a/src/modules/app_python3/app_python3_mod.c
+++ b/src/modules/app_python3/app_python3_mod.c
@@ -104,7 +104,13 @@ static int mod_init(void)
char *dname_src, *bname_src;
int i;
- if(apy_sr_init_mod()<0) {
+ /*
+ * register the need to be called post-fork of all children
+ * with the special rank PROC_POSTCHILDINIT
+ */
+ ksr_module_set_flag(KSRMOD_FLAG_POSTCHILDINIT);
+
+ if (apy_sr_init_mod()<0) {
LM_ERR("failed to init the sr mod\n");
return -1;
}
@@ -185,6 +191,16 @@ static int child_init(int rank)
*/
#if PY_VERSION_HEX >= 0x03070000
PyOS_BeforeFork() ;
+#endif
+ return 0;
+ }
+ if(rank==PROC_POSTCHILDINIT) {
+ /*
+ * this is called after forking of all child
+ * processes
+ */
+#if PY_VERSION_HEX >= 0x03070000
+ PyOS_AfterFork_Parent() ;
#endif
return 0;
}
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [*] Commit message has the format required by CONTRIBUTING guide
- [*] Commits are split per component (core, individual modules, libs, utils, ...)
- [*] Each component has a single commit (if not, squash them into one commit)
- [*] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [*] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [*] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Protocol information of pcontact was not written to mysql database
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2879
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2879/commits/c7cf1937bfc9a36e7086…">Fix on saving protocol info for ims_usrloc_pcscf</a>
-- File Changes --
M src/modules/ims_usrloc_pcscf/usrloc_db.c (2)
M utils/kamctl/mysql/ims_usrloc_pcscf-create.sql (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2879.patchhttps://github.com/kamailio/kamailio/pull/2879.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2879
Module: kamailio
Branch: master
Commit: 5e617b5e2130ed96f624e027023329433f8814ee
URL: https://github.com/kamailio/kamailio/commit/5e617b5e2130ed96f624e0270233294…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2021-11-19T12:46:21+01:00
modules: readme files regenerated - kazoo ... [skip ci]
---
Modified: src/modules/kazoo/README
---
Diff: https://github.com/kamailio/kamailio/commit/5e617b5e2130ed96f624e0270233294…
Patch: https://github.com/kamailio/kamailio/commit/5e617b5e2130ed96f624e0270233294…
---
diff --git a/src/modules/kazoo/README b/src/modules/kazoo/README
index 7497dd20e8..572774ff2c 100644
--- a/src/modules/kazoo/README
+++ b/src/modules/kazoo/README
@@ -67,10 +67,10 @@ Luis Azedo
5.1. amqp related
5.1.1. kazoo_publish(exchange, routing_key,
- json_payload)
+ json_payload [, amqp_headers])
5.1.2. kazoo_query(exchange, routing_key, json_payload
- [, target_var])
+ [, target_var] [, amqp_headers])
5.1.3. kazoo_subscribe(exchange, exchange_type, queue,
routing_key)
@@ -175,9 +175,11 @@ Chapter 1. Admin Guide
5.1. amqp related
- 5.1.1. kazoo_publish(exchange, routing_key, json_payload)
+ 5.1.1. kazoo_publish(exchange, routing_key, json_payload [,
+ amqp_headers])
+
5.1.2. kazoo_query(exchange, routing_key, json_payload [,
- target_var])
+ target_var] [, amqp_headers])
5.1.3. kazoo_subscribe(exchange, exchange_type, queue,
routing_key)
@@ -623,9 +625,11 @@ modparam("kazoo", "pua_mode", 0)
5.1. amqp related
- 5.1.1. kazoo_publish(exchange, routing_key, json_payload)
+ 5.1.1. kazoo_publish(exchange, routing_key, json_payload [,
+ amqp_headers])
+
5.1.2. kazoo_query(exchange, routing_key, json_payload [,
- target_var])
+ target_var] [, amqp_headers])
5.1.3. kazoo_subscribe(exchange, exchange_type, queue,
routing_key)
@@ -643,10 +647,11 @@ modparam("kazoo", "pua_mode", 0)
5.1. amqp related
-5.1.1. kazoo_publish(exchange, routing_key, json_payload)
+5.1.1. kazoo_publish(exchange, routing_key, json_payload [, amqp_headers])
The function publishes a json payload to rabbitmq. The routing_key
- parameter should be encoded.
+ parameter should be encoded. Optional AMQP-Headers are specified in the
+ format key1=value1;key2=value2
This function can be used from ANY ROUTE.
@@ -661,12 +666,14 @@ $var(amqp_routing_key) = "registration.success." + $(fd{kz.encode}) + "." + $fU;
kazoo_publish("callmgr", $var(amqp_routing_key), $var(amqp_payload_request));
...
-5.1.2. kazoo_query(exchange, routing_key, json_payload [, target_var])
+5.1.2. kazoo_query(exchange, routing_key, json_payload [, target_var] [,
+amqp_headers])
The function publishes a json payload to rabbitmq, waits for a
correlated messageand puts the result in target_var. The routing_key
parameter should be encoded. target_var is optional as the function
- also puts the result in pseudo-variable $kzR.
+ also puts the result in pseudo-variable $kzR. Optional AMQP-Headers are
+ specified in the format key1=value1;key2=value2
This function can be used from ANY ROUTE.
- implements GH #2895
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #2895
#### Description
Allows adding additional AMQP-headers in the format header1=value1;header2=value2;...
Remark:
I decided to re-use the definition
`{"kazoo_publish", (cmd_function) kz_amqp_publish_ex, 4, fixup_kz_amqp, fixup_kz_amqp_free, ANY_ROUTE},`
resp. to modify the existing method signature
`int kz_amqp_publish_ex(struct sip_msg* msg, char* exchange, char* routing_key, char* payload, char* _pub_flags)`
to
`int kz_amqp_publish_ex(struct sip_msg* msg, char* exchange, char* routing_key, char* payload, char* _pub_flags)`
as the param _pub_flags is neither described in the docs, nor it was evaluated/used, and thus was useless anyhow.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2925
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2925/commits/0aee8fc2c486f19a20c9…">kazoo: Allow optional AMQP-headers in kazoo_query and kazoo_publish</a>
-- File Changes --
M src/modules/kazoo/doc/kazoo_admin.xml (8)
M src/modules/kazoo/kazoo.c (1)
M src/modules/kazoo/kz_amqp.c (117)
M src/modules/kazoo/kz_amqp.h (11)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2925.patchhttps://github.com/kamailio/kamailio/pull/2925.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2925