Update cell expiry on assignment for htables w/o updateexpiry (analogue to #4079).
<!-- 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)
- [ ] 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 -->
Currently Kamailio does not update expiry when assigning a value to an expired cell if htable's `updateexpire` equals `0`. So expired cells aren't usable as long htable timer cleans up these cells.
Reproduction 1:
```
#!KAMAILIO
listen=udp:127.0.0.1:9999
log_stderror=yes
loadmodule "xlog.so"
loadmodule "pv.so"
loadmodule "sl.so"
loadmodule "htable.so"
modparam("htable", "htable", "foo=>autoexpire=1;updateexpire=0;initval=0")
request_route {
if ($sht(foo=>bar) == $null) {
xlog("it's null, init it\n");
}
$sht(foo=>bar) = $sht(foo=>bar) + 1;
xlog("$Ts value $sht(foo=>bar)\texpire $shtex(foo=>bar)\n");
sl_send_reply("200", "Hello");
}
```
output:
```
0(787651) ERROR: <script>: 1736855046 value 1 expire 1
0(787651) ERROR: <script>: 1736855046 value 2 expire 1
0(787651) ERROR: <script>: 1736855047 value 3 expire 0
0(787651) ERROR: <script>: 1736855048 value 0 expire 4294967295
0(787651) ERROR: <script>: 1736855048 value 0 expire 4294967295
0(787651) ERROR: <script>: 1736855049 value 0 expire 4294967294
0(787651) ERROR: <script>: 1736855050 value 0 expire 4294967293
SNIP expire decreases while value stays 0
0(787651) ERROR: <script>: 1736855066 value 1 expire 1
0(787651) ERROR: <script>: 1736855066 value 2 expire 1
0(787651) ERROR: <script>: 1736855067 value 3 expire 0
```
Reproduction 2:
```
#!KAMAILIO
listen=udp:127.0.0.1:9999
log_stderror=yes
loadmodule "xlog.so"
loadmodule "pv.so"
loadmodule "sl.so"
loadmodule "htable.so"
modparam("htable", "htable", "baz=>")
modparam("htable", "htable", "foo=>autoexpire=1;updateexpire=0")
request_route {
if ($sht(foo=>bar) == $null) {
xlog("it's null, init it\n");
}
$sht(foo=>bar) = $_s($shtinc(baz=>cnt));
xlog("$Ts value $sht(foo=>bar)\texpire $shtex(foo=>bar)\n");
sl_send_reply("200", "Hello");
}
event_route[htable:mod-init] {
xlog("htable:mod-init\n");
# $sht(foo=>bar) = 0;
$sht(baz=>cnt) = 0;
}
```
output:
```
0(789709) ERROR: <script>: it's null, init it
0(789709) ERROR: <script>: 1736855379 value 1 expire 1
0(789709) ERROR: <script>: 1736855379 value 2 expire 1
0(789709) ERROR: <script>: 1736855380 value 3 expire 0
0(789709) ERROR: <script>: 1736855380 value 4 expire 0
0(789709) ERROR: <script>: it's null, init it
0(789709) ERROR: <script>: 1736855381 value <null> expire 4294967295
0(789709) ERROR: <script>: it's null, init it
0(789709) ERROR: <script>: 1736855382 value <null> expire 4294967294
SNIP expire decreases value stays null
0(789709) ERROR: <script>: it's null, init it
0(789709) ERROR: <script>: 1736855399 value 33 expire 1
0(789709) ERROR: <script>: 1736855399 value 34 expire 1
0(789709) ERROR: <script>: 1736855400 value 35 expire 0
0(789709) ERROR: <script>: 1736855400 value 36 expire 0
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4103
-- Commit Summary --
* htable: Fix expiry on assignment
-- File Changes --
M src/modules/htable/ht_api.c (24)
M src/modules/htable/ht_api.h (9)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4103.patchhttps://github.com/kamailio/kamailio/pull/4103.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4103
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4103(a)github.com>
Considering that it hasn't been much activity around the internal libraries for long time, I was wondering if it still makes sense to keep them like they are or merge them in the core.
Recently, during the devel meeting, I relocated a couple of them to the archive. The `lib/binrpc` (and `print`) can have the same fate, being not actually used.
The srdb1 is very common and I guess it is very rare the case when a deployment is used without a module not depending on it (e.g., even if dispatcher is used with a list file, the code is still linked to this library).
The `trie` library is small and `ims` is actually a set of getter functions for message attribtues/headers.
The `srdb2` is not used much, but I think the right approach for it is to change the modules using it to `libsrdb1` and get rid of it completely sometime in the future. Till then the code is not big and can reside as part of the core.
The benefits I see are in simplifying the build system (current makefiles and hopefully soon-to-be-merged the one based on cmake), reducing also the time to compute compile and link dependencies; getting rid of packaging complexity (same library may be needed by different modules, which, when packaged separately, the library has to be in a 3rd package, or have dependency of the other module's package -- probably now the libs are shipped with the core package).
The code for libs can stay at the same location, so source code for modules doesn't need to be updated, just that they are compiled with the core, removing internal libs from makefiles.
Thinking that we go for 6.0.x, clarifying the plans for this component and cleaning it, if decided so, should fit well in such version number jump.
Opinions?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4041
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4041(a)github.com>
### RTPEngine + RTIMER + SEGFAULT + unable to ping
When unable to ping RTPEngine instances kamailio crashes.
### Troubleshooting
Determined issue was related to the ping failures, resolved AWS SG issue, allowing successful pings. Issue subsequently went away.
#### Reproduction
Use rtpengine with RDS backend
Load rtpengine with ~ 20 destinations you do not expect a response from on
Use rtimer to call rtpengine.reload via jsonrpcs:
```
modparam("rtimer", "timer", "name=rtpengine;interval=60;mode=0;")
modparam("rtimer", "exec", "timer=rtpengine;route=RELOAD_RTPENGINE")
route[RELOAD_RTPENGINE] {
xinfo("RTPEngine database reloading");
jsonrpc_exec('{"jsonrpc": "2.0", "method": "rtpengine.reload", "id": 1}');
}
```
#### Debugging Data
Got a core dump -- although I deleted quickly (not thinking) as they were running instances out of disk quickly. bt full did not show much to step through all though clearly pointed to rtpengine.
#### Log Messages
```
send_rtpp_command(): timeout waiting reply for command "ping" from RTPEngine <udp:10.0.X.X>
```
### Possible Solutions
TBD / do not have ping failures under heavy load.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.8.2 (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, MEM_JOIN_FREE, 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_SEND_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**:
```
uname -a
Linux 5.10.0-27-cloud-amd64 #1 SMP Debian 5.10.205-2 (2023-12-31) x86_64 GNU/Linux
cat /proc/version
Linux version 5.10.0-27-cloud-amd64 (debian-kernel(a)lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.205-2 (2023-12-31)
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4122
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4122(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
- [ ] 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/4123
-- Commit Summary --
* ims_registrar_scscf: send NOTIFY in case of subsequent SUBSCRIBE as per RFC 3265
* ims_registrar_scscf: set contact to presentity URI in 200OK for SUBSCRIBE to reg events
-- File Changes --
M src/modules/ims_registrar_scscf/registrar_notify.c (12)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4123.patchhttps://github.com/kamailio/kamailio/pull/4123.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4123
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4123(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
- [ ] Tested changes locally
- [x] Related to issue #4100
#### Description
add ims_usrloc_scscf definitions
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4110
-- Commit Summary --
* lib/srdb1/schema: ims_usrloc_scscf definitions
-- File Changes --
A src/lib/srdb1/schema/contact.xml (100)
A src/lib/srdb1/schema/impu.xml (99)
A src/lib/srdb1/schema/impu_contact.xml (52)
A src/lib/srdb1/schema/impu_subscriber.xml (52)
A src/lib/srdb1/schema/kamailio-ims_usrloc_scscf.xml (16)
A src/lib/srdb1/schema/subscriber_scscf.xml (123)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4110.patchhttps://github.com/kamailio/kamailio/pull/4110.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4110
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4110(a)github.com>
<!--
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:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing 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 see unexpected return code from route if there is no explicit `return` and switch-case block.
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
#### Reproduction
Here is simple configuration part:
```
route(TEST_ROUTE_WITH_SWITCH);
xlog("L_WARN", "TEST_ROUTE_WITH_SWITCH result $rc\n");
...
route[TEST_ROUTE_WITH_SWITCH] {
$var(a) = "a";
switch ($var(a)) {
case "a":
case "b":
$var(b) = $var(a);
break;
default:
$var(c) = $var(a);
}
# must be optional according to documentation:
# https://www.kamailio.org/wiki/cookbooks/5.3.x/core#return
# > If no value is specified, or a route reaches its end without executing a return statement, it returns 1.
#
# return 1;
}
```
Log:
```
WARNING: <script>: TEST_ROUTE_WITH_SWITCH result 0
```
At the same time if there is no switch-block, return code is 1 as expected:
```
route[TEST_ROUTE_WITH_SWITCH] {
$var(a) = "a";
}
```
Log:
```
WARNING: <script>: TEST_ROUTE_WITH_SWITCH w/o switch-case result 1
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
$ ./build/sbin/kamailio -v
version: kamailio 5.7.5 (x86_64/linux) b47500-dirty
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, 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: b47500 -dirty
compiled on 22:02:13 Nov 9 2024 with /usr/bin/gcc 11.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`)
-->
```
Oracle Linux 9
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4088
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4088(a)github.com>
#### Kamailo 5.8
### Description
I use ```ds_is_active function()``` in ```dispatcher``` module.
```
$var(sip_url) = $sht(conf_fs=>$var(conf_id)); # sip:192.168.1.44:5060
if(ds_is_active("1", "$var(sip_url)")){
#### is allways run
}
```
or
```ds_is_active("1", $var(sip_url))```
#### Debugging Data
When I check dispatcher:
```
"DEST": {
"URI": "sip:192.168.1.44:5060",
"FLAGS": "IP",
"PRIORITY": 0,
"ATTRS": {
"BODY": "rweight=50;weight=50;cc=1",
"DUID": null,
"MAXLOAD": 0,
"WEIGHT": 50,
"RWEIGHT": 50,
"SOCKET": null,
"SOCKNAME": null,
"OBPROXY": null
}
}
```
Why is the flag set to ```IP```, but ```ds_is_active()``` returns true?
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4001
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4001(a)github.com>