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>
<!--
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>
```
C (gcc) [M db_sqlite.so] db_sqlite.o
CC (gcc) [M db_sqlite.so] dbase.o
dbase.c: In function ‘db_sqlite_close’:
dbase.c:141:25: error: passing argument 2 of ‘db_do_close’ from incompatible pointer type [-Wincompatible-pointer-types]
141 | db_do_close(_h, db_sqlite_free_connection);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void (*)(struct sqlite_connection *)
In file included from ../../lib/srdb1/db_ut.h:37,
from dbase.c:28:
../../lib/srdb1/db.h:495:40: note: expected ‘void (*)(struct pool_con *)’ but argument is of type ‘void (*)(struct sqlite_connection *)’
495 | void db_do_close(db1_con_t *_h, void (*free_connection)(struct pool_con *));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [../../Makefile.rules:100: dbase.o] Error 1
make[1]: *** [Makefile:508: modules] Error 1
make[1]: Leaving directory '/root/rpmbuild/BUILD/kamailio-5.8.5/src'
make: *** [Makefile:34: every-module] Error 2
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4119
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4119(a)github.com>
Hello,
Kamailio SIP Server v5.8.5 stable release is out.
This is a maintenance release of the latest stable branch, 5.8, that
includes fixes since the release of v5.8.4. There is no change to
database schema or configuration language structure that you have to do
on previous installations of v5.8.x. Deployments running previous v5.8.x
versions are strongly recommended to be upgraded to v5.8.5.
For more details about version 5.8.5 (including links and guidelines to
download the tarball or from GIT repository), visit:
 * https://www.kamailio.org/w/2025/01/kamailio-v5-8-5-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Many thanks to all contributing and using Kamailio!
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Kamailio World Conference, May 12-13, 2025, Berlin -- kamailioworld.com
Hello,
the branch 6.0 was created, therefore the master branch is open for
adding new features, to be part of future release series v6.1.x.
Any bug fix committed to master that applies to 6.0.x or older stable
branches should be backported as usual with "git cherry-pick -x ..." to
appropriate branches like 6.0 or 5.8.
Expect that v6.0.0 will be released in a few weeks from now.
Based on the workflow used during the past years, the next future
release v6.1.0 should be out after another 8-10 months of development,
plus 1-2 months of testing, so sometime during the last part of 2025 or
the beginning of 2026.
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com
Kamailio World Conference, May 12-13, 2025, Berlin -- kamailioworld.com
Hello,
the branch 6.0 has been created, to be used for releasing v6.0.x series.
To check out this branch, the following commands can be used:
  git clone https://github.com/kamailio/kamailio kamailio-6.0
  cd kamailio-6.0
  git checkout -b 6.0 origin/6.0
Pushing commits in this branch:
 git push origin 6.0:6.0
Note that 6.0 is an official stable branch, so only bug fixes, missing
kemi exports (discuss on sr-dev if not sure) or improvements to
documentation or helper tools can be pushed to this branch.
As usual, if there is a bug fixed, commit and push first to master
branch and then cherry pick to 6.0 branch:
 git cherry-pick -x COMMITID
In few weeks, the first release from branch 6.0 will be out,
respectively Kamailio v6.0.0.
Cheers,
Daniel
--
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com