libcs are implementing changes to fix the year 2038 issue on 32 bit
platforms (see [1]). musl libc already went ahead and implemented it,
starting with musl-1.2.0 (see [2]).
This commit adds a new definition to src/core/dprint.h:
TIME_T_INT_FMT
If __USE_TIME_BITS64 is defined (by a time64 libc, see [1]), it is set
to the proper conversion for type int64_t, PRId64. If __USE_TIME_BITS64
is not defined, the status quo remains unchanged ("%ld" is used).
Note: In some places kamailio uses "%li" instead of "%ld". But in the
context of printf etc. there is no difference, so this commit replaces
"%li" with "%ld".
The new definition is used in the different parts of kamailio, where
appropriate.
These changes get rid of the new warnings that appeared with musl-1.2.0.
Below an example warning:
In file included from auth_identity.c:50:
auth_identity.c: In function 'check_date':
../../core/dprint.h:316:73: warning: format '%ld' expects argument of type 'long int', but argument 11 has type 'time_t' {aka 'long long int'} [-Wformat=]
316 | fprintf(stderr, "%2d(%d) %s: %.*s%s%s%s" fmt, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
../../core/dprint.h:340:25: note: in expansion of macro 'LOG_FX'
340 | LOG_FX(facility, level, lname, prefix, _FUNC_NAME_, fmt, ## args)
| ^~~~~~
../../core/dprint.h:346:25: note: in expansion of macro 'LOG_FL'
346 | LOG_FL(facility, level, NULL, prefix, fmt, ## args)
| ^~~~~~
../../core/dprint.h:349:25: note: in expansion of macro 'LOG_FP'
349 | LOG_FP(DEFAULT_FACILITY, (level), LOC_INFO, fmt, ## args)
| ^~~~~~
auth_identity.c:594:17: note: in expansion of macro 'LOG'
594 | LOG(L_INFO, "AUTH_IDENTITY VERIFIER: Outdated date header value (%ld sec)\n", tnow - tmsg + glb_iauthval);
| ^~~
[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
[2] https://musl.libc.org/time64.html
Signed-off-by: Sebastian Kemper <sebastian_ml(a)gmx.net>
<!-- 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
- [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
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Hi all,
This adds time64 libc support. Should be non-breaking, status quo remains. I hope you don't mind a made up a new patch category, "time".
I did not run-test this (pretty busy right now). But the warnings go away.
If absolutely run-testing is needed for this, let me know.
Kind regards,
Seb
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2894
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2894/commits/27175614787f6b05795f…">time: add support for time64 libc</a>
-- File Changes --
M src/core/dprint.h (8)
M src/modules/auth_identity/auth_identity.c (2)
M src/modules/cdp/routing.c (4)
M src/modules/db_redis/redis_dbase.c (2)
M src/modules/ims_charging/ims_ro.c (2)
M src/modules/ims_dialog/dlg_handlers.c (2)
M src/modules/ims_icscf/scscf_list.c (4)
M src/modules/ims_registrar_pcscf/notify.c (2)
M src/modules/ims_registrar_pcscf/save.c (2)
M src/modules/ims_registrar_scscf/registrar_notify.c (3)
M src/modules/ims_registrar_scscf/save.c (2)
M src/modules/ims_usrloc_scscf/impurecord.c (4)
M src/modules/nat_traversal/nat_traversal.c (2)
M src/modules/xhttp_pi/xhttp_pi_fnc.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2894.patchhttps://github.com/kamailio/kamailio/pull/2894.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/2894
Module: kamailio
Branch: master
Commit: fe68c9aeb06f114afdc6c0b076b5163e34deeea5
URL: https://github.com/kamailio/kamailio/commit/fe68c9aeb06f114afdc6c0b076b5163…
Author: Sebastian Kemper <sebastian_ml(a)gmx.net>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-11-03T13:03:34+01:00
nat_traversal: use TIME_T_FMT
The size of the time_t destination is unknown as it is depending on the
platform. So we "read into a known-size integer (either int or long
long) and then assign the value to a time_t as a second step" (quote
from [1]).
[1] https://stackoverflow.com/questions/4171478/how-to-read-data-into-a-time-t-…
Signed-off-by: Sebastian Kemper <sebastian_ml(a)gmx.net>
---
Modified: src/modules/nat_traversal/nat_traversal.c
---
Diff: https://github.com/kamailio/kamailio/commit/fe68c9aeb06f114afdc6c0b076b5163…
Patch: https://github.com/kamailio/kamailio/commit/fe68c9aeb06f114afdc6c0b076b5163…
---
diff --git a/src/modules/nat_traversal/nat_traversal.c b/src/modules/nat_traversal/nat_traversal.c
index 4cfe8d4018..edaa6dfe3d 100644
--- a/src/modules/nat_traversal/nat_traversal.c
+++ b/src/modules/nat_traversal/nat_traversal.c
@@ -1707,6 +1707,7 @@ static void restore_keepalive_state(void)
unsigned h;
str host;
FILE *f;
+ long long ll_1, ll_2;
if(!keepalive_state_file)
return;
@@ -1724,7 +1725,9 @@ static void restore_keepalive_state(void)
res = fscanf(f, STATE_FILE_HEADER); // skip header
while(true) {
- res = fscanf(f, "%63s %63s %ld %ld", uri, socket, &rtime, &stime);
+ res = fscanf(f, "%63s %63s %" TIME_T_FMT " %" TIME_T_FMT, uri, socket, &ll_1, &ll_2);
+ rtime = ll_1;
+ stime = ll_2;
if(res == EOF) {
if(ferror(f))
LM_ERR("error while reading keepalive state file: %s\n",
Module: kamailio
Branch: master
Commit: 5d17337af532a03d3a36751c5d085dd542478e41
URL: https://github.com/kamailio/kamailio/commit/5d17337af532a03d3a36751c5d085dd…
Author: Sebastian Kemper <sebastian_ml(a)gmx.net>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-11-03T13:03:34+01:00
ims_registrar_pcscf: use TIME_T_FMT
Signed-off-by: Sebastian Kemper <sebastian_ml(a)gmx.net>
---
Modified: src/modules/ims_registrar_pcscf/notify.c
Modified: src/modules/ims_registrar_pcscf/save.c
---
Diff: https://github.com/kamailio/kamailio/commit/5d17337af532a03d3a36751c5d085dd…
Patch: https://github.com/kamailio/kamailio/commit/5d17337af532a03d3a36751c5d085dd…
---
diff --git a/src/modules/ims_registrar_pcscf/notify.c b/src/modules/ims_registrar_pcscf/notify.c
index 83c7a5c377..d8830fd2d5 100644
--- a/src/modules/ims_registrar_pcscf/notify.c
+++ b/src/modules/ims_registrar_pcscf/notify.c
@@ -209,8 +209,8 @@ int process_contact(udomain_t * _d, int expires, str contact_uri, int contact_st
/*TODO_LATEST - put this back */
} else {//state is active
//update this contact
- LM_DBG("This contact: <%.*s> is in state active and is in usrloc so just updating - old expires: %li, new expires: %i which is in %i seconds\n", contact_uri.len, contact_uri.s,
- pcontact->expires,
+ LM_DBG("This contact: <%.*s> is in state active and is in usrloc so just updating - old expires: %" TIME_T_FMT ", new expires: %i which is in %i seconds\n", contact_uri.len, contact_uri.s,
+ TIME_T_CAST(pcontact->expires),
expires,
expires - local_time_now);
if (ul.update_pcontact(_d, &ci, pcontact) != 0) {
diff --git a/src/modules/ims_registrar_pcscf/save.c b/src/modules/ims_registrar_pcscf/save.c
index 9432574005..b33a596cd2 100644
--- a/src/modules/ims_registrar_pcscf/save.c
+++ b/src/modules/ims_registrar_pcscf/save.c
@@ -223,8 +223,9 @@ static inline int update_contacts(struct sip_msg *req,struct sip_msg *rpl, udoma
}
//TODO_LATEST replace above
} else { //update contact
- LM_DBG("Updating contact: <%.*s>, old expires: %li, new expires: %i which is in %i seconds\n", c->uri.len, c->uri.s,
- pcontact->expires-local_time_now,
+ LM_DBG("Updating contact: <%.*s>, old expires: %" TIME_T_FMT ", new expires: %i which is in %i seconds\n",
+ c->uri.len, c->uri.s,
+ TIME_T_CAST(pcontact->expires-local_time_now),
expires,
expires-local_time_now);
ci.reg_state = PCONTACT_REGISTERED;
Module: kamailio
Branch: master
Commit: 71d92b26105a4e88f4fba3986a0ba306e89adc4f
URL: https://github.com/kamailio/kamailio/commit/71d92b26105a4e88f4fba3986a0ba30…
Author: Sebastian Kemper <sebastian_ml(a)gmx.net>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-11-03T13:03:34+01:00
ims_charging: use TIME_T_FMT
Signed-off-by: Sebastian Kemper <sebastian_ml(a)gmx.net>
---
Modified: src/modules/ims_charging/ims_ro.c
---
Diff: https://github.com/kamailio/kamailio/commit/71d92b26105a4e88f4fba3986a0ba30…
Patch: https://github.com/kamailio/kamailio/commit/71d92b26105a4e88f4fba3986a0ba30…
---
diff --git a/src/modules/ims_charging/ims_ro.c b/src/modules/ims_charging/ims_ro.c
index 0a8c53f9d9..d93d565a65 100644
--- a/src/modules/ims_charging/ims_ro.c
+++ b/src/modules/ims_charging/ims_ro.c
@@ -858,7 +858,8 @@ void send_ccr_stop_with_param(struct ro_session *ro_session, unsigned int code,
LM_DBG("Final used number of seconds for session is %ld\n", used);
}
- LM_DBG("Call started at %ld and ended at %ld and lasted %d seconds and so far we have billed for %ld seconds\n", ro_session->start_time, stop_time,
+ LM_DBG("Call started at %" TIME_T_FMT " and ended at %" TIME_T_FMT " and lasted %d seconds and so far we have billed for %ld seconds\n",
+ TIME_T_CAST(ro_session->start_time), TIME_T_CAST(stop_time),
actual_time_seconds, ro_session->billed + used);
if (ro_session->billed + used < actual_time_seconds) {
LM_DBG("Making adjustment by adding %ld seconds\n", actual_time_seconds - (ro_session->billed + used));
Module: kamailio
Branch: master
Commit: bfe95c90e91a0bc33a769967a5841a4ab43a6553
URL: https://github.com/kamailio/kamailio/commit/bfe95c90e91a0bc33a769967a5841a4…
Author: Sebastian Kemper <sebastian_ml(a)gmx.net>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-11-03T13:03:34+01:00
core: add support for time64 libcs
libcs are implementing changes to fix the year 2038 issue on 32 bit
platforms (see [1]). musl libc already went ahead and implemented it,
starting with musl-1.2.0 (see [2]).
This commit adds the groundwork for always using the "lld" format when
dealing with time_t and casting the values to be formatted to (long
long). The aim is to be future proof and portable.
Example warning when not using TIME_T_FMT while compiling for a 32 bit
target using a time64 libc:
In file included from auth_identity.c:50:
auth_identity.c: In function 'check_date':
../../core/dprint.h:316:73: warning: format '%ld' expects argument of type 'long int', but argument 11 has type 'time_t' {aka 'long long int'} [-Wformat=]
316 | fprintf(stderr, "%2d(%d) %s: %.*s%s%s%s" fmt, \
| ^~~~~~~~~~~~~~~~~~~~~~~~
../../core/dprint.h:340:25: note: in expansion of macro 'LOG_FX'
340 | LOG_FX(facility, level, lname, prefix, _FUNC_NAME_, fmt, ## args)
| ^~~~~~
../../core/dprint.h:346:25: note: in expansion of macro 'LOG_FL'
346 | LOG_FL(facility, level, NULL, prefix, fmt, ## args)
| ^~~~~~
../../core/dprint.h:349:25: note: in expansion of macro 'LOG_FP'
349 | LOG_FP(DEFAULT_FACILITY, (level), LOC_INFO, fmt, ## args)
| ^~~~~~
auth_identity.c:594:17: note: in expansion of macro 'LOG'
594 | LOG(L_INFO, "AUTH_IDENTITY VERIFIER: Outdated date header value (%ld sec)\n", tnow - tmsg + glb_iauthval);
| ^~~
[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
[2] https://musl.libc.org/time64.html
Signed-off-by: Sebastian Kemper <sebastian_ml(a)gmx.net>
---
Modified: src/core/dprint.h
---
Diff: https://github.com/kamailio/kamailio/commit/bfe95c90e91a0bc33a769967a5841a4…
Patch: https://github.com/kamailio/kamailio/commit/bfe95c90e91a0bc33a769967a5841a4…
---
diff --git a/src/core/dprint.h b/src/core/dprint.h
index 65fcc6fc3c..fbdd349acb 100644
--- a/src/core/dprint.h
+++ b/src/core/dprint.h
@@ -35,6 +35,8 @@
#include "compiler_opt.h"
#include "cfg_core.h"
+#define TIME_T_FMT "lld"
+#define TIME_T_CAST(x) ((long long)(x))
/** dicover the function name */
/* C >= 99 has __func__, older gcc versions have __FUNCTION__ */
<!-- 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
- [ ] 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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Hello. I want to ask if increasing this #define(s) are feasible to commit upstream? We've come to the case where need at least +16 more for acc module and at least +8 more for core branches. Not sure if other people would need this.
1. If yes, let me know if i should split it in 2 commits, one for core and one for acc module
2. If no, please close this PR
Thank you,
Stefan
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2891
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2891/commits/378cfd7d02243544807a…">core, acc: increase define values</a>
-- File Changes --
M src/core/config.h (2)
M src/modules/acc/acc_api.h (2)
M src/modules/acc/acc_cdr.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2891.patchhttps://github.com/kamailio/kamailio/pull/2891.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/2891
#### Pre-Submission Checklist
- [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:
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #2892
#### Description
When Kamailio goes to shutdown then routing hash table cleaned properly.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2896
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2896/commits/ce6453920f4a28d79e0d…">core: fixed route hash table cleanup</a>
-- File Changes --
M src/core/route.c (7)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2896.patchhttps://github.com/kamailio/kamailio/pull/2896.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/2896
<!-- 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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
If this param is enabled, will log SIP headers with comma instead of \r\n, when some error happens. Default is disabled.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2904
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2904/commits/901ddcf7c1eef3e7e2eb…">core: add new param sip_parser_oneline</a>
-- File Changes --
M src/core/cfg.lex (2)
M src/core/cfg.y (3)
M src/core/cfg_core.c (3)
M src/core/cfg_core.h (1)
M src/core/parser/msg_parser.c (28)
M src/core/parser/msg_parser.h (5)
M src/core/parser/parse_via.c (5)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2904.patchhttps://github.com/kamailio/kamailio/pull/2904.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/2904
Add a new flag as optional parameter for save() method.
The flag contains one value: DO_NOT_USE_REALM_FOR_PRIVATE_IDENTITY
0x01. No changes save() when parameter is not present.
<!-- 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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2907
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2907/commits/85f4de73ff4dcbbe8d13…">ims_registrar_scscf: Extend save() with optional flag</a>
-- File Changes --
M src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c (72)
M src/modules/ims_registrar_scscf/save.c (21)
M src/modules/ims_registrar_scscf/save.h (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2907.patchhttps://github.com/kamailio/kamailio/pull/2907.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/2907
Module: kamailio
Branch: master
Commit: a627c9a04a74b48760441be3411f75325f1cb2f2
URL: https://github.com/kamailio/kamailio/commit/a627c9a04a74b48760441be3411f753…
Author: Aleksandar Yosifov <alexyosifov(a)gmail.com>
Committer: Aleksandar Yosifov <alexyosifov(a)gmail.com>
Date: 2021-11-01T10:07:10+02:00
ims_registrar_scscf: Extend save() with optional flag
Add a new flag as optional parameter for save() method.
The flag contains one value: DO_NOT_USE_REALM_FOR_PRIVATE_IDENTITY
0x01. No changes save() when parameter is not present.
---
Modified: src/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml
Modified: src/modules/ims_registrar_scscf/ims_registrar_scscf_mod.c
Modified: src/modules/ims_registrar_scscf/save.c
Modified: src/modules/ims_registrar_scscf/save.h
---
Diff: https://github.com/kamailio/kamailio/commit/a627c9a04a74b48760441be3411f753…
Patch: https://github.com/kamailio/kamailio/commit/a627c9a04a74b48760441be3411f753…
#### 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
- [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
#### Description
When the module is loaded the messages have '\r\n'
> INFO: statsd [statsd.c:87]: mod_init(): Statsd init ip value 127.0.0.1 #015
> INFO: statsd [statsd.c:93]: mod_init(): Statsd init port value 8125#015
> INFO: statsd [statsd.c:101]: mod_init(): Statsd: success connection to statsd server
while at it, format the code with our clang-format definition
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2911
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2911/commits/fd9409e70401d31b16af…">statsd: clang-format</a>
* <a href="https://github.com/kamailio/kamailio/pull/2911/commits/8fca0fb9bf4f83ba67fc…">statsd: remove '\r\n' from xlog messages</a>
-- File Changes --
M src/modules/statsd/lib_statsd.c (209)
M src/modules/statsd/lib_statsd.h (9)
M src/modules/statsd/statsd.c (217)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2911.patchhttps://github.com/kamailio/kamailio/pull/2911.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/2911
Module: kamailio
Branch: master
Commit: 6cd61dfa949ae6288f480efcb72fdb8bb344d93f
URL: https://github.com/kamailio/kamailio/commit/6cd61dfa949ae6288f480efcb72fdb8…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2021-10-29T12:46:23+02:00
modules: readme files regenerated - rtpengine ... [skip ci]
---
Modified: src/modules/rtpengine/README
---
Diff: https://github.com/kamailio/kamailio/commit/6cd61dfa949ae6288f480efcb72fdb8…
Patch: https://github.com/kamailio/kamailio/commit/6cd61dfa949ae6288f480efcb72fdb8…
---
diff --git a/src/modules/rtpengine/README b/src/modules/rtpengine/README
index a9caf8951f..4944f8abaa 100644
--- a/src/modules/rtpengine/README
+++ b/src/modules/rtpengine/README
@@ -489,6 +489,7 @@ Chapter 1. Admin Guide
The following modules must be loaded before this module:
* tm module - (optional) if you want to have rtpengine_manage() fully
functional
+ lwsc module - (optional) if you plan to use “wsapi” parameter
3.2. External Libraries or Applications
Module: kamailio
Branch: master
Commit: a602c26fe3c83a0f1b825927be145459a08730e2
URL: https://github.com/kamailio/kamailio/commit/a602c26fe3c83a0f1b825927be14545…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2021-10-29T12:35:25+02:00
rtpengine: update dependencies
lwsc module is needed if wsapi parameter is set
https://lists.kamailio.org/pipermail/sr-users/2021-October/113494.html
---
Modified: src/modules/rtpengine/doc/rtpengine_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/a602c26fe3c83a0f1b825927be14545…
Patch: https://github.com/kamailio/kamailio/commit/a602c26fe3c83a0f1b825927be14545…
---
diff --git a/src/modules/rtpengine/doc/rtpengine_admin.xml b/src/modules/rtpengine/doc/rtpengine_admin.xml
index c3201bbf37..234fd1fa21 100644
--- a/src/modules/rtpengine/doc/rtpengine_admin.xml
+++ b/src/modules/rtpengine/doc/rtpengine_admin.xml
@@ -120,6 +120,10 @@
<emphasis>tm module</emphasis> - (optional) if you want to
have rtpengine_manage() fully functional
</para>
+ <para>
+ <emphasis>lwsc module</emphasis> - (optional) if you plan to use
+ <quote>wsapi</quote> parameter
+ </para>
</listitem>
</itemizedlist>
</para>
<!--
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
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
I found a memory leak which is causing some issues for us in our production. I think I was able to reproduce it and determine that this is happening when we set up an MSRP connection, and that connection is closed due to inactivity (for example when `tcp_connection_lifetime` is triggered).
This issue is the same one than #2875 but with latest supported Kamailio version.
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
In this environment we have a WebRTC SIP client, connected to Kamailio and a second party using SIP, both sending messages each via MSRP protocol. Web Client and SIP client establish a session normally, all fine here, they can communicate. At this point we have this status:
```
TESTER|centos8.4|tester21 [2021-10-11][12:49:24] [/home/vagrant]$ sudo netstat -natp | grep 10.22.22
tcp 0 0 10.22.22.21:5060 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:10000 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:8080 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:10001 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:10002 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:8080 10.22.22.1:58530 ESTABLISHED 14653/kamailio
tcp 0 0 10.22.22.21:10000 10.22.22.190:42530 ESTABLISHED 14714/kamailio
tcp 0 0 10.22.22.21:8080 10.22.22.1:58532 ESTABLISHED 14704/kamailio
TESTER|centos8.4|tester21 [2021-10-11][12:49:39] [/home/vagrant]$ kamcmd -s udp:127.0.0.1:2046 mod.stats core all | grep tcp
tcpconn_new(1134): 199392
init_tcp(4962): 8192
init_tcp(4956): 32768
init_tcp(4947): 8
init_tcp(4940): 8
init_tcp(4933): 8
init_tcp(4927): 8
init_tcp(4915): 8
```
In order to trigger this failure much faster, I set `tcp_connection_lifetime=60`. Then we just wait 60 seconds to let the TCP connections closed. Then we finish the session, and stop our WebClient registering, so all connections are cleaned up.
```
TESTER|centos8.4|tester21 [2021-10-11][12:50:33] [/home/vagrant]$ sudo netstat -natp | grep 10.22.22
tcp 0 0 10.22.22.21:5060 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:10000 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:8080 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:10001 0.0.0.0:* LISTEN 14714/kamailio
tcp 0 0 10.22.22.21:10002 0.0.0.0:* LISTEN 14714/kamailio
TESTER|centos8.4|tester21 [2021-10-11][12:51:34] [/home/vagrant]$ kamcmd -s udp:127.0.0.1:2046 mod.stats core all | grep tcp
tcpconn_new(1134): 66464
init_tcp(4962): 8192
init_tcp(4956): 32768
init_tcp(4947): 8
init_tcp(4940): 8
init_tcp(4933): 8
init_tcp(4927): 8
init_tcp(4915): 8
```
As you can see there are no connections but there is memory allocated by `tcpconn_new`. I know this is related to the MSRP because we noticed our SIP Web Client is not closing the socket, so we just wait for Kamailio to close it.
#### 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).
-->
```
2021-07-25T23:54:41Z ERROR ERROR: <core> [mem/f_malloc.c:415]: fm_search_defrag(): fm_search_defrag(0x7f39a284c000, 66288); Free fragment not found!
2021-07-25T23:54:41Z ERROR ERROR: <core> [mem/f_malloc.c:498]: fm_malloc(): fm_malloc(0x7f39a284c000, 66288) called from core: tcp_main.c: tcpconn_new(957), module: core; Free fragment not found!
2021-07-25T23:54:41Z ERROR ERROR: <core> [tcp_main.c:959]: tcpconn_new(): mem. allocation failure
2021-07-25T23:54:41Z ERROR ERROR: <core> [tcp_main.c:3985]: handle_new_connect(): tcpconn_new failed, closing socket
```
#### 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
<!--
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`
```
version: intcc 5.5.2 (x86_64/linux) 55e232
flags: , EXTRA_DEBUGUSE_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, DBG_QM_MALLOC, 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: 55e232
compiled on 12:15:14 Oct 11 2021 with gcc 8.4.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`)
-->
```
TESTER|centos8.4|tester21 [2021-10-11][13:52:47] [/home/vagrant]$ uname -a
Linux tester21 4.18.0-305.19.1.el8_4.x86_64 #1 SMP Wed Sep 15 15:39:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
centos 8
```
--
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/issues/2880
### Description
I have a problem with publish/notify messages generated from Kamailio towards a monitoring device after multiple branches has been created.
When the call is forked by kamailio, invites are generated towards each callee user agent depending on how many branches we have in the call.
When one of the callee user agents sends back 200 ok to enter the conversation, kamailio automatically sends a CANCEL towards the user agents that lost the race condition and didnt take the call.
When this happens, a notify is set to the monitoring user agent with the state "terminated" but this is wrong since the call is up and we are in conversation.
#### Reproduction
1. set up a monitoring device that subscribes to B events.
2. Register more than one device to B to make kamailio behave like a forking proxy
3. Call B and observe the notify message sent to the monitoring device, in particular the <dialog id="xxx" value
### Possible Solutions
I think this can be solved just adding some random uuid inside the xml field sent inside the xml of the NOTIFY message:
The random uuid must be different for each branch.
### Additional Information
version: kamailio 5.5.1 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, NO_SIG_DEBUG, 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: unknown
compiled with gcc 10.2.1
* **Operating System**:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Linux sp1 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux
--
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/issues/2906
#### 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
- [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
- [x] Tested changes locally
- [x] Related to issue #2906
#### Description
This change solves the issue of parallel forking, subscriber
was receiving NOTIFY messages with the same id for different branches
fixes #2906
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2908
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2908/commits/8a924ee177b4764cd5da…">pua_dialoginfo: generate uuid as id instead of use callid value</a>
-- File Changes --
M src/modules/pua_dialoginfo/Makefile (11)
M src/modules/pua_dialoginfo/dialog_publish.c (18)
M src/modules/pua_dialoginfo/pua_dialoginfo.c (47)
M src/modules/pua_dialoginfo/pua_dialoginfo.h (9)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2908.patchhttps://github.com/kamailio/kamailio/pull/2908.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/2908
### Description
I have compiled Kamailio on aarch64 hosts with Google ASAN. Also used system memory manager ("make MEMPKG=sys cfg").
During compilation used flags
```
-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment
```
When Kamailio is started with the default config file I get an error
```
core/script_cb.c:85:31: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
```
As used 64 bit CPU, looks like a strange this error
### Additional Information
compiled commit 102d5dab4f45cab238ffeb72e7ddf378c8daa17d
* **Operating System**:
```
[root@logger-west kamailio]# uname -a
Linux example.com 4.18.0-305.7.1.el8_4.aarch64 #1 SMP Tue Jun 29 21:32:00 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
[root@logger-west kamailio]# lsb_release -a
LSB Version: :core-4.1-aarch64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.4.2105
Release: 8.4.2105
Codename: n/a
```
--
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/issues/2897