Module: kamailio
Branch: master
Commit: a82e5657b66272c0833c1d1d6a55ee29acc315a5
URL: https://github.com/kamailio/kamailio/commit/a82e5657b66272c0833c1d1d6a55ee2…
Author: Jon Bergli Heier <jon.bergli.heier(a)zisson.com>
Committer: Jon Bergli Heier <jon.bergli.heier(a)zisson.com>
Date: 2022-06-03T16:30:53+02:00
auth: Add flag for not invalidating nc on auth failure
If flag 32 is set then we skip updating nc in pre_auth. On success we
call check_nonce once more to do the update. This can be used to chain
calls to eg. pv_auth_check to authenticate against multiple passwords.
---
Modified: src/modules/auth/api.c
Modified: src/modules/auth/api.h
Modified: src/modules/auth/auth_mod.c
Modified: src/modules/auth/doc/auth_functions.xml
Modified: src/modules/auth/nc.c
Modified: src/modules/auth/nc.h
Modified: src/modules/auth/nonce.c
Modified: src/modules/auth/nonce.h
---
Diff: https://github.com/kamailio/kamailio/commit/a82e5657b66272c0833c1d1d6a55ee2…
Patch: https://github.com/kamailio/kamailio/commit/a82e5657b66272c0833c1d1d6a55ee2…
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
I want to get the CDR of the whole call. For this I use the following configuration.
I don't use any sql database. I want to get CDR in syslog
...
loadmodule "db_text.so"
loadmodule "dialog.so"
loadmodule "acc.so"
...
#----Dialog--------------------------
modparam("dialog", "db_mode", 0)
#-----ACCounting module -----
modparam("acc", "early_media", 0)
modparam("acc", "report_cancels", 1)
modparam("acc", "log_facility", "LOG_LOCAL1")
modparam("acc", "detect_direction", 0)
modparam("acc", "log_level", ACC_LOG_LEVEL)
modparam("acc", "log_flag", FLAG_ACC_LOG)
modparam("acc", "log_missed_flag", FLAG_ACC_LOG_MISSED)
modparam("acc", "failed_transaction_flag", FLAG_ACC_LOG_FAILED)
modparam("acc", "log_extra", "ip_src=$si;ip_dst=$avp(ip_dst);sip_from=$fU;sip_to=$tU;ruri_user=$rU;spx_rs=$avp(spx_http_rs)") ## TODO
modparam("acc", "cdr_enable", 1)
modparam("acc", "cdr_facility", "LOG_LOCAL1")
modparam("acc", "cdr_log_enable", 1)
...
request_route {
setflag(FLAG_ACC_LOG);
setflag(FLAG_ACC_LOG_MISSED);
setflag(FLAG_ACC_LOG_FAILED);
...
...
...
}
...
#___handle requests within SIP dialogs
route[HANDLE_IN_DIALOG_REQUESTS] {
if (has_totag()) {
if (loose_route()) {
xlog("L_INFO", "route[WITHINDLG]|$rm with to-tag and loose route|\n");
if (is_method("BYE")) {
setflag(FLAG_ACC_LOG);
}
}
}
As a result, I get two separate records for INVITE and BYE transactions. But I'm expecting one CDR for the entire call.
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
#### Debugging Data
<!--
If you got a core dump, use gdb to extract troubleshooting data - full backtrace,
local variables and the list of the code at the issue location.
gdb /path/to/kamailio /path/to/corefile
bt full
info locals
list
If you are familiar with gdb, feel free to attach more of what you consider to
be relevant.
-->
```
(paste your debugging data here)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your log messages here)
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
I tried to find a solution on the internet, and found this message
https://www.mail-archive.com/sr-users@lists.kamailio.org/msg13617.html
The author talks about an additional flag in the dialog module. And also asks to add this to the documentation of the ACC module
I tried adding a flag but didn't get the desired result. Probably something else needs to be done. There is nothing in the documentation about this. Maybe it makes sense to write a similar article for kamailio?
https://www.opensips.org/Documentation/Tutorials-Advanced-Accounting
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
[opodguyko@vms-vms-spx-1 ~]$ kamailio -v
version: kamailio 5.5.3 (x86_64/linux) b02728-dirty
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: b02728 -dirty
compiled on 15:35:46 Dec 15 2021 with gcc 8.3.1
```
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
```
[opodguyko@vms-vms-spx-1 ~]$ cat /etc/redhat-release
AlmaLinux release 8.5 (Arctic Sphynx)
[opodguyko@vms-vms-spx-1 ~]$
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3142
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3142(a)github.com>
<!-- 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)
- [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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
On EL8 package with Python 3.9; that is EoL in 2025; Python 3.6 was EoL end 2021.
Python 3.9 lifecycle matches the remaining Full Support cycle of EL8.
Although 5.6 packages were released with Python 3.6; this PR could be backported to 5.6 as 5.6 still has a lot of runway.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3140
-- Commit Summary --
* packaging: on EL8 package with Python 3.9
-- File Changes --
M pkg/kamailio/obs/kamailio.spec (10)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3140.patchhttps://github.com/kamailio/kamailio/pull/3140.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3140
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3140(a)github.com>
app_python3 needs to call `PyOS_AfterFork_Child()`/`PyOS_AfterFork()`
in real child processes.
We need a test for this: rank > 0 may not be sufficient due to
non-forking mode. This POC uses getpid().
- [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
- [X] 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 -->
@miconda @henningw : this PR is for discussion only: in KEMI Python there is an interpreter function that needs to be called after `fork()` in real child processes. I realise that `rank > 0` may not be a completely correct test as kamailio has a non-forking mode. Your comments would be appreciated.
This POC uses `getpid()` to detect a &ldquo;real&rdquo; child process.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3139
-- Commit Summary --
* WIP app_python3: need a test for a real child process
-- File Changes --
M src/modules/app_python3/app_python3_mod.c (10)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3139.patchhttps://github.com/kamailio/kamailio/pull/3139.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3139
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3139(a)github.com>
Module: kamailio
Branch: 5.6
Commit: 824867fd1f81c78cc0fd8c688aa4032c24e49781
URL: https://github.com/kamailio/kamailio/commit/824867fd1f81c78cc0fd8c688aa4032…
Author: Anthony Alba <ascanio.alba7(a)gmail.com>
Committer: Anthony Alba <ascanio.alba7(a)gmail.com>
Date: 2022-06-10T22:20:06+08:00
app_python3: use _ksr_is_main to detect child process
(cherry picked from commit 8683deb20a)
---
Modified: src/modules/app_python3/app_python3_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/824867fd1f81c78cc0fd8c688aa4032…
Patch: https://github.com/kamailio/kamailio/commit/824867fd1f81c78cc0fd8c688aa4032…
---
diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c
index d250640e0c..376d1c1312 100644
--- a/src/modules/app_python3/app_python3_mod.c
+++ b/src/modules/app_python3/app_python3_mod.c
@@ -185,9 +185,6 @@ static int child_init(int rank)
* this is called before any process is forked
* so the Python internal state handler
* should be called now.
- *
- * TODO: is PyOS_AfterFork_Parent() necesary
- * in the main process?
*/
#if PY_VERSION_HEX >= 0x03070000
PyOS_BeforeFork() ;
@@ -206,7 +203,7 @@ static int child_init(int rank)
}
_apy_process_rank = rank;
- if (rank > 0) {
+ if (!_ksr_is_main) {
#if PY_VERSION_HEX >= 0x03070000
PyOS_AfterFork_Child();
#else
Module: kamailio
Branch: master
Commit: 8683deb20a3f69c3b6d2c8370d23d1451f823a6b
URL: https://github.com/kamailio/kamailio/commit/8683deb20a3f69c3b6d2c8370d23d14…
Author: Anthony Alba <ascanio.alba7(a)gmail.com>
Committer: Anthony Alba <ascanio.alba7(a)gmail.com>
Date: 2022-06-10T22:13:39+08:00
app_python3: use _ksr_is_main to detect child process
---
Modified: src/modules/app_python3/app_python3_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/8683deb20a3f69c3b6d2c8370d23d14…
Patch: https://github.com/kamailio/kamailio/commit/8683deb20a3f69c3b6d2c8370d23d14…
---
diff --git a/src/modules/app_python3/app_python3_mod.c b/src/modules/app_python3/app_python3_mod.c
index d250640e0c..376d1c1312 100644
--- a/src/modules/app_python3/app_python3_mod.c
+++ b/src/modules/app_python3/app_python3_mod.c
@@ -185,9 +185,6 @@ static int child_init(int rank)
* this is called before any process is forked
* so the Python internal state handler
* should be called now.
- *
- * TODO: is PyOS_AfterFork_Parent() necesary
- * in the main process?
*/
#if PY_VERSION_HEX >= 0x03070000
PyOS_BeforeFork() ;
@@ -206,7 +203,7 @@ static int child_init(int rank)
}
_apy_process_rank = rank;
- if (rank > 0) {
+ if (!_ksr_is_main) {
#if PY_VERSION_HEX >= 0x03070000
PyOS_AfterFork_Child();
#else