### Description
Right now, usrloc keepalive method use a somewhat static call-id, built with the prefix `ksrulka-` followed by the number of keepalives sent and the contact index of each AoR pinged.
This means that pings to different contacts from different processes (when using timer_procs in usrloc) or when you have multiple proxies each handling a subset of registrar requests, you can have duplicated call-ids.
Basically the following happens:
- user1 registers to proxy
- user2 registers to proxy
- different timer processes handles the keepalives
- call-ids are the same (it start always from `ksrulka-1.1`)
OR
- user1 registers to proxyA
- user2 registers to proxyB
- both proxies start sending keepalives
- call-ids are the same (it start always from `ksrulka-1.1`) from both proxies.
While this is not a routing problem, bug or whatever, it can be annoying if traffic is analyzed with tools like sngrep, which group messages by the Call-ID header, and if you run sngrep on the edge proxy you'll see both keepalive messages under the same call.
Can be also annoying if logs from all proxies are aggregated, making a bit problematic filtering by call-id.
### Expected behavior
Call-id should be somewhat random.
#### SIP Traffic
This is an example for same call-id used for pinging two different AoR on same proxy.
```
2022/08/23 08:53:35.717668 172.23.42.2:5060 -> 172.23.42.1:5060
OPTIONS sip:user1@192.168.10.123:23045;transport=udp SIP/2.0
Via: SIP/2.0/UDP 172.23.42.2:5060;branch=z9hG4bKx.323.1.0
Route: <sip:172.23.42.1;lr;received=sip:client.public.ip:23045;r2=on>,<sip:kamailio.public.ip;lr;received=sip:client.public.ip:23045;r2=on>
From: <sip:pinger@test.proxy>;tag=uloc-1-6304863f-61-2-8a27955a-6304958f-af2a3-143.1
To: <sip:user1@example.com>
Call-ID: ksrulka-323.1
CSeq: 80 OPTIONS
Content-Length: 0
```
and
```
2022/08/23 08:53:35.897076 172.23.42.2:5060 -> 172.23.42.1:5060
OPTIONS sip:user2@192.168.10.130:5060 SIP/2.0
Via: SIP/2.0/UDP 172.23.42.2:5060;branch=z9hG4bKx.323.1.0
Route: <sip:172.23.42.1;lr;received=sip:client.public.ip:60058;r2=on>,<sip:kamailio.public.ip;lr;received=sip:client.public.ip:60058;r2=on>
From: <sip:pinger@test.proxy>;tag=uloc-1-6304863f-61-1-86c70e53-6304958f-dafc7-143.1
To: <sip:user2@example.com>
Call-ID: ksrulka-323.1
CSeq: 80 OPTIONS
Content-Length: 0
```
### Possible Solutions
To be 100% honest I don't get why such method of generating call-ids has been chosen. The only useful thing I see is that you can have a clue of how many keepalives ping have been sent by each process / proxy while inspecting sip traces. I don't see any usage of the fixed call-id in handling responses. But I may be wrong, since I'm new to kamailio.
What could be done is to add a random string to the call-id, like nathelper does. If this is acceptable, I can try to create a PR for that.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.6.1 (x86_64/linux)
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: unknown
compiled with gcc 9.4.0
```
* **Operating System**:
Using official docker images of kamailio 5.6.1.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3225
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3225(a)github.com>
Module: kamailio
Branch: master
Commit: 03dffaad07952568bd40e22d5b23aaa4bcfe613a
URL: https://github.com/kamailio/kamailio/commit/03dffaad07952568bd40e22d5b23aaa…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2022-08-24T09:31:46+02:00
modules: readme files regenerated - pv ... [skip ci]
---
Modified: src/modules/pv/README
---
Diff: https://github.com/kamailio/kamailio/commit/03dffaad07952568bd40e22d5b23aaa…
Patch: https://github.com/kamailio/kamailio/commit/03dffaad07952568bd40e22d5b23aaa…
---
diff --git a/src/modules/pv/README b/src/modules/pv/README
index 28bc21c69a..4a1f805154 100644
--- a/src/modules/pv/README
+++ b/src/modules/pv/README
@@ -694,8 +694,11 @@ xavi_child_rm("WhatEver", "FoO");
at the index idx becomes the first and the ones before it are at the
end of the list.
- The first parameter has to be the name of XAVP in the root list. The
- second parameter is the index of the XAVP that becomes the first one.
+ The first parameter has to be the name of XAVP in the root list.
+
+ The second parameter is the index of the XAVP that becomes the first
+ one (if it is greater than the number of XAVPs, modulo operation is
+ done first; if it is negative, it counts from the end of the list).
The parameters can be with variables.
Module: kamailio
Branch: master
Commit: 1a33c8b7c70e7f629868d926965ec456bf2eecae
URL: https://github.com/kamailio/kamailio/commit/1a33c8b7c70e7f629868d926965ec45…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-08-24T09:18:08+02:00
pv: updated docs for xavp_lshift()
---
Modified: src/modules/pv/doc/pv_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/1a33c8b7c70e7f629868d926965ec45…
Patch: https://github.com/kamailio/kamailio/commit/1a33c8b7c70e7f629868d926965ec45…
---
diff --git a/src/modules/pv/doc/pv_admin.xml b/src/modules/pv/doc/pv_admin.xml
index 409ecaa4dac..30b09eab807 100644
--- a/src/modules/pv/doc/pv_admin.xml
+++ b/src/modules/pv/doc/pv_admin.xml
@@ -747,8 +747,12 @@ xavi_child_rm("WhatEver", "FoO");
</para>
<para>
The first parameter has to be the name of XAVP in the root list.
+ </para>
+ <para>
The second parameter is the index of the XAVP that becomes the
- first one.
+ first one (if it is greater than the number of XAVPs, modulo
+ operation is done first; if it is negative, it counts from the
+ end of the list).
</para>
<para>
The parameters can be with variables.
<!-- 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 -->
When I upgraded kamailio version to 5.6.1, some http requests hit msg headers control and failed.
I think ksr_sip_parser_mode check should be added here for backward compatibility.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3226
-- Commit Summary --
* core: added parser mode check
-- File Changes --
M src/core/parser/msg_parser.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3226.patchhttps://github.com/kamailio/kamailio/pull/3226.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3226
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3226(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 -->
- [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 -->
When I upgraded kamailio version to 5.6.1, some http requests hit msg headers control and failed.
I think ksr_sip_parser_mode check should be added here for backward compatibility.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3224
-- Commit Summary --
* Merge pull request #1 from kamailio/master
* Merge pull request #2 from kamailio/master
* Merge pull request #3 from kamailio/master
* Merge branch 'kamailio:master' into master
* core: added parser mode check
-- File Changes --
M src/core/parser/msg_parser.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3224.patchhttps://github.com/kamailio/kamailio/pull/3224.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3224
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3224(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 -->
- [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 -->
Sometime is helpful to have a monotonic timer to attach to events in order to discard out-of-order ones on receiving side. Current time values are not ideal since are subject to clock skews, adjustment and so on. Since we have system monotonic clock we can use that value to have a monotonic counter.
To be 100% fair CLOCK_MONOTONIC can still be skewed only by ntp adjustment, that's why we try to use CLOCK_MONOTONIC_RAW which is linux-only (afaik) that do not suffer from such adjustments.
The new pseudovariable is `$TV(Sm)`, which returns the monotonic counter as a string. Note that even if is based on clock, it starts from an unspecified point in time, so should really be treated as an always increasing counter.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3191
-- Commit Summary --
* pv: add monotonic clock to TimeVal pseudovariable
-- File Changes --
M src/modules/pv/pv_time.c (24)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3191.patchhttps://github.com/kamailio/kamailio/pull/3191.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3191
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3191(a)github.com>