<!--
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…
[View More]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.
-->
Other modules use ims_usrloc_pcscf's callback calls for following operations:
#define PCSCF_CONTACT_INSERT (1<<0)
#define PCSCF_CONTACT_UPDATE (1<<1)
#define PCSCF_CONTACT_DELETE (1<<2)
#define PCSCF_CONTACT_EXPIRE (1<<3)
### 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
<!--
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`
```
(paste your output here)
```
* **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`)
-->
```
(paste your output here)
```
--
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/2882
[View Less]
### Description
I noticed an issue regarding loose_route() when using Topos module.
My architecture is the following:
```
Client (behind NAT or not) ------> Kamailio (Access SBC) -----------> Kamailio (Interconnect SBC) -----------> Carrier
```
Kamailio Access SBC is listening on 2 interfaces:
```
Public interface : udp:A.A.A.A:5060
Core interface : udp:B.B.B.B:5060
```
Kamailio Interconnect SBC is listening on 2 interfaces:
```
Core interface : udp:C.C.C.C:5060
…
[View More]Carrier-side interface : udp:D.D.D.D:5060
```
TOPOS is configured only on second kamailio box (Interconnect SBC).
Record routing is used on both kamailios.
TOPOS module is configured as follows:
```
modparam("ndb_redis", "server", "name=srv1;addr=127.0.0.1;port=6379")
modparam("topos_redis", "serverid", "srv1")
modparam("topos", "storage", "redis")
modparam("topos", "contact_mode", 1)
modparam("topos", "cparam_name", "id")
modparam("topos", "rr_update", 1)
```
RR module is configured as follows:
```
modparam("rr", "enable_full_lr", 1)
modparam("rr", "append_fromtag", 1)
modparam("rr", "enable_double_rr", 1)
```
For an incomoing INVITE (direction: client to carrier) all is fine and topos can strip headers on bleg and insert the cookie on bleg contact as a param.
When Callee sends a BYE or re-INVITE, topos inserts route headers in aleg as shown in the next trace: (BYE as received from the carrier on the carrier-side interface D.D.D.D)
```
BYE sip:D.D.D.D:5060 SIP/2.0
Via: SIP/2.0/UDP x.x.x.x:5060;branch=z9hG4bKrdhsvc001omkvssqvfk0sd0185mt1.1
From: <sip:+33123456789@my-carrier-domain;transport=UDP;user=phone>;tag=SD69ao497-1472568650-1635329820043
To: <sip:+33987654321@my-own-domain;transport=UDP;user=phone>;tag=3ab10616
Call-ID: NjZjMDgyMGMxNzdkN2FhYmJlYzQyYjA5YWIzZThmZmI.
CSeq: 547381883 BYE
Max-Forwards: 64
Content-Length: 0
Route: <sip:D.D.D.D;r2=on;lr=on;ftag=3ab10616>,<sip:C.C.C.C;r2=on;lr=on;ftag=3ab10616>
Route: <sip:B.B.B.B;r2=on;lr=on;ftag=3ab10616;dlg_id=426.26c2>,<sip:A.A.A.A;r2=on;lr=on;ftag=3ab10616;dlg_id=426.26c2>
P-SR-XUID: atpsh-617925e5-82a5-1
```
Topos on the kamailio interconnect handles the BYE/re-INVITE and forward it to the second interface C.C.C.C as shown in the following trace:
```
BYE sip:A.A.A.A;r2=on;lr=on;ftag=3ab10616;dlg_id=426.26c2 SIP/2.0
Via: SIP/2.0/UDP 185.164.213.110;branch=z9hG4bKbd7.ab692eeb60369aa3a5e07f6b63cc9dd7.0
From: <sip:+33123456789@my-carrier-domain;transport=UDP;user=phone>;tag=SD69ao497-1472568650-1635329820043
To: <sip:+33987654321@my-own-domain;transport=UDP;user=phone>;tag=3ab10616
Call-ID: NjZjMDgyMGMxNzdkN2FhYmJlYzQyYjA5YWIzZThmZmI.
CSeq: 547381883 BYE
Max-Forwards: 63
Content-Length: 0
Route: <sip:C.C.C.C;r2=on;lr=on;ftag=3ab10616>
Route: <sip:B.B.B.B;r2=on;lr=on;ftag=3ab10616;dlg_id=426.26c2>
Contact: <sip:+33123456789@10.3.60.45;id=atpsh-617925e5-82a5-1>
```
When the BYE/re-INVITE request reaches the C.C.C.C interface, it is then forwarded directly to the ruri sip:A.A.A.A.
Or what I expect to receive in C.C.C.C interface is the following :
```
BYE <HERE SHOULD BE THE CALLER CONTACT URI> SIP/2.0
Via: SIP/2.0/UDP 80.10.231.173:5060;branch=z9hG4bKrdhsvc001omkvssqvfk0sd0185mt1.1
From: <sip:+33123456789@my-carrier-domain;transport=UDP;user=phone>;tag=SD69ao497-1472568650-1635329820043
To: <sip:+33987654321@my-own-domain;transport=UDP;user=phone>;tag=3ab10616
Call-ID: NjZjMDgyMGMxNzdkN2FhYmJlYzQyYjA5YWIzZThmZmI.
CSeq: 547381883 BYE
Max-Forwards: 64
Content-Length: 0
Route: <sip:D.D.D.D;r2=on;lr=on;ftag=3ab10616>
Route: <sip:C.C.C.C;r2=on;lr=on;ftag=3ab10616>
Route: <sip:B.B.B.B;r2=on;lr=on;ftag=3ab10616;dlg_id=426.26c2>
Route: <sip:A.A.A.A;r2=on;lr=on;ftag=3ab10616;dlg_id=426.26c2>
Contact: <sip:+33123456789@10.3.60.45;id=atpsh-617925e5-82a5-1>
```
I could work around this issue by doing the following :
1. When receiving the BYE/re-INVITE on interface D.D.D.D, I explode the Route headers, delete old route headers and create new ones in order from the result of explode
2. I update the ru with the contact uri which I stored in a htable when the initial INVITE was received
```
# Manage outgoing branches
branch_route[MANAGE_BRANCH] {
xdbg("new branch [$T_branch_idx] to $ru\n");
# TOPOS FIX
if (is_method("INVITE")) {
$sht(tpsindlg=>$ci) = $ci;
$sht(tpsindlg=>$ci:ft) = $ft;
$sht(tpsindlg=>$ci:ct) = $ct;
}
}
route[WITHINDLG] {
if (!has_totag()) return;
# Fix bad Route Headers caused by TOPOS module
if ($Ri == "D.D.D.D") {
$var(rh0) = $(hdr(Route)[0]{s.select,0,,});
$var(rh1) = $(hdr(Route)[0]{s.select,1,,});
$var(rh2) = $(hdr(Route)[1]{s.select,0,,});
$var(rh3) = $(hdr(Route)[1]{s.select,1,,});
remove_hf_re("^Route$");
append_hf("Route: $var(rh0)\r\n");
append_hf("Route: $var(rh1)\r\n");
append_hf("Route: $var(rh2)\r\n");
append_hf("Route: $var(rh3)\r\n");
}
# sequential request within a dialog should
# take the path determined by record-routing
if (loose_route()) {
# Fix R-URI caused by TOPOS module
if ($Ri == "D.D.D.D") {
if ($ci == $sht(tpsindlg=>$ci) && $tt == $sht(tpsindlg=>$ci:ft)) {
$ru = $(sht(tpsindlg=>$ci:ct){s.strip,1}{s.striptail,1});
if (is_method("BYE")) {
$sht(tpsindlg=>$ci) = $null;
$sht(tpsindlg=>$ci:ft) = $null;
$sht(tpsindlg=>$ci:ct) = $null;
}
}
}
route(RELAY);
exit;
}
if (is_method("ACK")) {
if ( t_check_trans() ) {
# no loose-route, but stateful ACK;
# must be an ACK after a 487
# or e.g. 404 from upstream server
route(RELAY);
exit;
} else {
# ACK without matching transaction ... ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
exit;
}
```
Could you please tell if this is a normal behavior by TOPOS module or is it a bug?
Thank you.
--
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/2905
[View Less]
### Description
I have compiled Kamailio with google ASAN module and faced issue where the string PV with NULL value cannot be copied.
Using GDB I found this function call triggers error when Google ASAN is used, `value->s.s = NULL`, `value->s.len = 0`
```
memcpy(var->v.value.s.s, value->s.s, value->s.len);
```
[Link](https://github.com/kamailio/kamailio/blob/caccb13e29ee12166c8101efa0d…
This happens only when ASAN is used.
Without ASAN same function call with the same values …
[View More]does not trigger an error.
In my test case this function called from [`lost/functions.c:1285`](https://github.com/kamailio/kamailio/blob/caccb13e29ee12166c8101efa0d5ab2745876413/src/modules/lost/functions.c#L1285)
To compile with asan used extra flags
```
-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment
```
### Troubleshooting
#### Log Messages
```
0(913407) INFO: {1 1 INVITE 1-455779(a)172.21.0.84} lost [functions.c:891]: lost_function(): ### LOST urn [urn:sip:911@3.236.25.254:5060]
0(913407) INFO: {1 1 INVITE 1-455779(a)172.21.0.84} lost [functions.c:983]: lost_function(): ### LOST loc [<112233445566(a)jim.com>]
0(913407) ERROR: {1 1 INVITE 1-455779(a)172.21.0.84} lost [utilities.c:336]: lost_get_content(): could not get XML node content
pv_svar.c:137:3: runtime error: null pointer passed as argument 2, which is declared to never be null
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
current master, test 375f86b69e11cf835ae919873d3cd56f32d589c8
* **Operating System**:
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/2913
[View Less]
Module: kamailio
Branch: master
Commit: 6857234c321faf33573e1a034ab666dc158eb549
URL: https://github.com/kamailio/kamailio/commit/6857234c321faf33573e1a034ab666d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-11-04T17:15:49+01:00
core: reorder fields of struct _cfg_group for better alignment
---
Modified: src/core/cfg/cfg_struct.h
---
Diff: https://github.com/kamailio/kamailio/commit/…
[View More]6857234c321faf33573e1a034ab666d…
Patch: https://github.com/kamailio/kamailio/commit/6857234c321faf33573e1a034ab666d…
---
diff --git a/src/core/cfg/cfg_struct.h b/src/core/cfg/cfg_struct.h
index e03024e700..03f38f322d 100644
--- a/src/core/cfg/cfg_struct.h
+++ b/src/core/cfg/cfg_struct.h
@@ -76,7 +76,6 @@ enum { CFG_GROUP_UNKNOWN = 0, CFG_GROUP_DYNAMIC, CFG_GROUP_STATIC };
/*! \brief linked list of registered groups */
#pragma pack(push, 1)
typedef struct _cfg_group {
- int num; /*!< number of variables within the group */
cfg_mapping_t *mapping; /*!< describes the mapping betweeen
the cfg variable definition and the memory block */
char *vars; /*!< pointer to the memory block where the values
@@ -85,6 +84,7 @@ typedef struct _cfg_group {
cfg_add_var_t *add_var; /*!< Additional instances of the variables.
This linked list is used only before the config is
shmized. */
+ int num; /*!< number of variables within the group */
int size; /*!< size of the memory block that has to be
allocated to store the values */
int meta_offset; /*!< offset of the group within the
@@ -100,9 +100,9 @@ typedef struct _cfg_group {
to temporary set the handle in the main process and
restore it later to its original value. */
- unsigned char dynamic; /*!< indicates whether the variables within the group
- are dynamically allocated or not */
struct _cfg_group *next;
+ unsigned int dynamic; /*!< indicates whether the variables within the group
+ are dynamically allocated or not */
int name_len;
char name[1];
} cfg_group_t;
[View Less]
Add mqueue_name and mqueue_size to define queues.
Updated doc.
<!-- 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 …
[View More]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 -->
Add 2 new mqueue module parameters to simplify config queue definition.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2825
-- Commit Summary --
* mqueue: add two new module parameters
-- File Changes --
M src/modules/mqueue/doc/mqueue_admin.xml (58)
M src/modules/mqueue/mqueue_mod.c (38)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2825.patchhttps://github.com/kamailio/kamailio/pull/2825.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/2825
[View Less]
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 …
[View More]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
[View Less]
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 …
[View More]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",
[View Less]
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/…
[View More]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;
[View Less]
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/…
[View More]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));
[View Less]
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 …
[View More]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__ */
[View Less]