- format as well
<!-- 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 #4227
#### Description
<!-- Describe your changes in detail -->
There was missing information of type identifiers that can be used in [rpc tutorial docs](https://www.kamailio.org/docs/docbooks/5.7.x/rpc_api/rpc_api.html#rpc…. This is an update to those docs. The most recent I could find was for 5.7.
Maybe there is a need for manual updating the page?
Also during the relevant PR #4227 , we found the `t` identifier is never used in the code. since it can overflow on 64bit systems due to being a `long` and not `int` type when saved/load, maybe we can remove it completely?. One can just cast the `time_t` to the relevant type and use the correct identifier as done in https://github.com/kamailio/kamailio/blob/2081b3aac394223b68b849fbac2a9e5ac…
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4228
-- Commit Summary --
* Update type identifiers that can be used in the RPC API
-- File Changes --
M doc/tutorials/rpc/kamailio_rpc.xml (86)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4228.patchhttps://github.com/kamailio/kamailio/pull/4228.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4228
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4228(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 -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #4226
#### Description
<!-- Describe your changes in detail -->
- Improve and add missing function documentation `list_peers`.
- Use correct identifier in `struct_add` rpc function and cast `time_t` for time_t field.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4227
-- Commit Summary --
* cdp: Cast time_t and use 'L' (long long) identifier in rpc function.
* cdp/docs: Add missing list_peers function
-- File Changes --
M src/modules/cdp/cdp_rpc.c (4)
M src/modules/cdp/doc/cdp_admin.xml (29)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4227.patchhttps://github.com/kamailio/kamailio/pull/4227.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4227
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4227(a)github.com>
xadhoom created an issue (kamailio/kamailio#4203)
<!--
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
Enabled json logging engine, with the following setup:
- kam cmd line params: `--log-engine=json:Mp`
- prefix: `log_prefix=", \"callid\": \"$ci\",\"srcip\": \"$si\", \"ts\": $TV(Sn), \"method\": \"$rm\", \"mt\": $mt, \"ua\": \"$(ua{s.escape.common})\", \"cseq\": \"$hdr(CSeq)\", \"status\": $rs "`
- another prefix (same result): `log_prefix=", \"callid\": \"$ci\", \"ts\": $TV(Sn) "`
What I see that certain json lines are truncated, for example
- one line is interrupted by another json entry
- one line starts "truncated"
### Troubleshooting
What I can observe is that seems to happens always with same "kind" of line, usually internal logs, which don't have callid etc.
#### 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).
-->
The following first 3 lines are ok, then the latest is corrupted:
```
{ "time": "2025-04-04T15:51:44.448427533Z", "idx": 193, "pid": 200, "level": "DEBUG", "module": "core", "file": "core/receive.c", "line": 128, "function": "sip_check_fline", "message": "first line indicates a SIP reply" }
{ "time": "2025-04-04T15:51:44.448682606Z", "idx": 194, "pid": 201, "level": "DEBUG", "module": "core", "file": "core/receive.c", "line": 128, "function": "sip_check_fline", "message": "first line indicates a SIP reply" }
{ "time": "2025-04-04T15:52:14.448279053Z", "idx": 195, "pid": 202, "level": "DEBUG", "module": "core", "file": "core/receive.c", "line": 128, "function": "sip_check_fline", "message": "first line indicates a SIP reply" }
{ "time": "2025-04-04T15:52:14.448505797Z", "idx": 196, "pid": 203, "level": "DEBUG", "module": "core", "file": "core/receive.c"{ "time": "2025-04-04T15:52:14.448508084Z", "idx": 195, "pid": 202, "level": "DEBUG", "module": "core", "file": "core/parser/msg, "line": 128, "function": "sip_check_fline", "message": "first line indicates a SIP reply" }
```
or (notice 2nd line or 5th one)
```
{ "time": "2025-04-04T16:13:33.789641936Z", "idx": 221, "pid": 228, "level": "DEBUG", "module": "core", "file": "core/receive.c"{ "time": "2025-04-04T16:13:33.789642978Z", "idx": 222, "pid": 229, "level": "DEBUG", "module": "core", "file": "core/xavp.c", ", "line": 265, "function": "ksr_evrt_pre_routing", "callid": "5715efe40e9b7721-264(a)127.0.0.1", "ts": 1743783213.789640 , "message": "event route core:pre-routing not defined" }
line": 630, "function": "xavp_destroy_list", "callid": "5715efe40e9b7720-264(a)127.0.0.1", "ts": 1743783213.789527 , "message": "destroying xavp list (nil)" }
{ "time": "2025-04-04T16:13:33.789646470Z", "idx": 222, "pid": 229, "level": "DEBUG", "module": "core", "file": "core/xavp.c", "line": 630, "function": "xavp_destroy_list", "callid": "5715efe40e9b7720-264(a)127.0.0.1", "ts": 1743783213.789527 , "message": "destroying xavp list (nil)" }
{ "time": "2025-04-04T16:13:33.789648201Z", "idx": 221, "pid": 228, "level": "DEBUG", "module": "tm", "file": "t_lookup.c", "line": 1579, "function": "t_check_msg", "callid": "5715efe40e9b7721-264(a)127.0.0.1", "ts": 1743783213.789640 , "message": "msg (0x7f{ "time": "2025-04-04T16:13:33.789649346Z", "idx": 222, "pid": 229, "level": "DEBUG", "module": "core", "file": "core/receive.c"8f7a693c50) id=2/228 global id=1/228 T start=0xffffffffffffffff" }
, "line": 637, "function": "receive_msg", "callid": "5715efe40e9b7720-264(a)127.0.0.1", "ts": 1743783213.789527 , "message": "cleaning up" }
{ "time": "2025-04-04T16:13:33.789652839Z", "idx": 221, "pid": 228, "level": "DEBUG", "module": "tm", "file": "t_lookup.c", "line": 1424, "function": "t_reply_matching", "callid": "5715efe40e9b7721-264(a)127.0.0.1", "ts": 1743783213.789640 , "message": "t_reply_matching: hash 26404 label 0 branch 0" }
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
6.0.1
```
happens also with 5.8.x
* **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`)
-->
```
Debian noble, docker container
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4203
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4203(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 -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [x] Related to issue #4212
#### Description
<!-- Describe your changes in detail -->
Probing a host correctly needs the tm module to be loaded. This PR adds a check for when adding a target in dispatcher with probing enabled to verify whether tm is loaded. If it's not, it emmits a warning and disable the probing to the target.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4223
-- Commit Summary --
* dispatcher: Check if tm is enabled before probing
-- File Changes --
M src/modules/dispatcher/dispatch.c (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4223.patchhttps://github.com/kamailio/kamailio/pull/4223.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4223
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4223(a)github.com>
intliang created an issue (kamailio/kamailio#4214)
### Description
The **<bymonth>** comparison logic in **tmrec_match()** fails to properly evaluate equivalence conditions, as shown below:
```
int check_byxxx(tmrec_t *_trp, ac_tm_t *_atp)
{
...
if(_trp->bymonth) {
for(i = 0; i < _trp->bymonth->nr; i++) {
if(_atp->t.tm_mon
== (_trp->bymonth->xxx[i] * _trp->bymonth->req[i] + 12)
% 12)
break;
}
...
```
### Troubleshooting
#### Reproduction
Rule string: "20250403T100000|PT14H|weekly|20250425T000000|2|-1WE, -2WE|16|||4"
Date time: 20250416T190000
Expected output: MATCH
Actual output: NOT MATCH
<!--
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.
-->
```
((lldb) p _trp->bymonth->xxx[0]
(int) 4
(lldb) p _trp->bymonth->req[0]
(int) 1
(lldb) p _atp->t.tm_mon
(int) 3
(lldb) p _trp->bymonth->nr
(int) 1
```
#### 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
The **tm_mon** field in the tm struct uses a 0-11 range (January=0), while the **<bymonth>** parameter follows a 1-12 convention (January=1) as documented in the tmrec module's README. Therefore, we should first decrement the value of **_trp->bymonth->xxx[i]** by 1 for proper conversion.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 6.1.0-dev0 (x86_64/Darwin) 9f24f1-dirty
flags: , EXTRA_DEBUGUSE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, 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, select, kqueue.
id: 9f24f1 dirty
compiled on 11:59:55 Apr 16 2025 with AppleClang 17.0.0.17000013
```
* **Operating System**:
```
Darwin yintiliangdeMacBook-Pro19.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 18:41:43 PST 2024; root:xnu-11215.61.5~2/RELEASE_X86_64 x86_64
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4214
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4214(a)github.com>
sergey-safarov created an issue (kamailio/kamailio#4180)
### Description
I have installed two `rtpengine` instances and want to use them as an `active backup`. I want to use `backup` only when `active` is unavailable.
Closest settings for this rtpengine node `weight` and want to use settings like
```
MariaDB [kamailio]> select * from rtpengine;
+----+-------+---------------------------------+--------+----------+---------------------+
| id | setid | url | weight | disabled | stamp |
+----+-------+---------------------------------+--------+----------+---------------------+
| 1 | 0 | udp6:[2005:84c0:bf:11::20]:2223 | 1 | 0 | 1900-01-01 00:00:01 |
| 2 | 0 | udp6:[2005:84c0:bf:11::21]:2223 | 0 | 0 | 1900-01-01 00:00:01 |
+----+-------+---------------------------------+--------+----------+---------------------+
```
But in case `weight=0` node is not selected and handled as disabled.
It will be fine do not use rtpengine nodes with `weight=0` when other rtpengine with `weight!=0` are available. But if no other nodes are available, use `weight=0` nodes as last resort.
### Expected behavior
Do not use rtpengine nodes with `weight=0` when other rtpengine with `weight!=0` are available. But if no other nodes are available, use `weight=0` nodes as last resort.
#### Actual observed behavior
The node is not selected and handled as disabled when `weight=0`.
#### Log Messages
```
rtpengine [rtpengine.c:3430]: rtpp_test(): rtpengine instance <udp6:[2005:84c0:bf:11::21]:2223> found, support for it enabled
rtpengine [rtpengine.c:3883]: select_rtpp_node(): rtpengine failed to select new for calllen=27 callid=1-10824@2005:84c0:bf:11::22
rtpengine [rtpengine.c:3183]: rtpp_function_call(): no available proxies
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4180
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4180(a)github.com>