whosgonna created an issue (kamailio/kamailio#4332)
<!--
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
We received a INVITE with non-ascii characters in the authentication username. The character set and collation of the subscriber table is `latin1` and `latin1_swedish_ci`. This generated the following failure (DB connection names are `primary` and `secondary`):
```
3(9) ERROR: db_mysql [km_dbase.c:127]: db_mysql_submit_query(): driver error on query: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '=' (1267)
3(9) ERROR: <core> [lib/srdb1/db_query.c:158]: db_do_query_internal(): error while submitting query
3(9) WARNING: db_cluster [dbcl_api.c:513]: db_cluster_query(): serial operation - failure on cluster [db] (9/0) [primary]
3(9) ERROR: db_mysql [km_dbase.c:127]: db_mysql_submit_query(): driver error on query: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb4_general_ci,COERCIBLE) for operation '=' (1267)
3(9) ERROR: <core> [lib/srdb1/db_query.c:158]: db_do_query_internal(): error while submitting query
3(9) WARNING: db_cluster [dbcl_api.c:513]: db_cluster_query(): serial operation - failure on cluster [db] (8/0) [secondary]
3(9) ERROR: db_cluster [dbcl_api.c:513]: db_cluster_query(): no successful read on cluster [db]
3(9) ERROR: auth_db [authorize.c:180]: get_ha1(): failed to query database
3(9) ERROR: [DIGEST_AUTH 60e4abd540674d4aa8961d380411585e(a)0.0.0.0 INVITE-124524] Generic failure in authentication. Send '503 Server Error' and exit.
```
While using the limited character set in the database (and it's associated collation) is questionable, and I don't expect the query to succeed, the issue is that this single query failure is causing the connections to be disabled in the db_cluster.
### Troubleshooting
#### Reproduction
I haven't tried to reproduce this, but I would assume it's easy to do. I can probably mock it up in docker fairly quickly. As a safety measure, I'll be validating the field with `is_alphanum()`
#### Log Messages
(as in description)
#### SIP Traffic
The `Username` in the `Proxy-Authorization` header as "\uFEFF1011". As hex it's:
```
22 ef bb bf 31 30 31 31 22
```
### 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`
```
version: kamailio 6.0.1 (aarch64/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-NOSMP, 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 on 18:45:18 Mar 14 2025 with gcc 14.2.0
```
* **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`)
-->
Container:
```
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.21.2
PRETTY_NAME="Alpine Linux v3.21"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
```
Host:
```
NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
```
Kernel (`uname -a)`:
```
Linux use2apocor01.n.fl.gg 6.1.56-82.125.amzn2023.aarch64 #1 SMP Tue Oct 10 17:03:29 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4332
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4332(a)github.com>
Module: kamailio
Branch: 5.8
Commit: 2e2045af9947802d03d7381a10ef3e1c4db8946e
URL: https://github.com/kamailio/kamailio/commit/2e2045af9947802d03d7381a10ef3e1…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2025-07-18T10:01:26+02:00
modules: readme files regenerated - modules ... [skip ci]
---
Modified: src/modules/ims_registrar_scscf/README
---
Diff: https://github.com/kamailio/kamailio/commit/2e2045af9947802d03d7381a10ef3e1…
Patch: https://github.com/kamailio/kamailio/commit/2e2045af9947802d03d7381a10ef3e1…
---
diff --git a/src/modules/ims_registrar_scscf/README b/src/modules/ims_registrar_scscf/README
index 100ea1e657c..5ef62cbb0e1 100644
--- a/src/modules/ims_registrar_scscf/README
+++ b/src/modules/ims_registrar_scscf/README
@@ -682,7 +682,7 @@ switch ($retcode) {
4.8. reg_fetch_contacts(domain, uri, profile)
The function fetches the contacts for 'uri' from table 'domain' to
- pseudo-variable $imssulc(profile) [imssulc = ims scscf ulc].
+ pseudo-variable $ulc(profile) [ulc = ims scscf ulc].
Meaning of the parameters is as follows:
* domain - Name of table that should be used for the lookup of
@@ -690,8 +690,8 @@ switch ($retcode) {
* uri - The SIP URI address of the user which to fetch the contact
addresses for. It can contain pseudo-variables that are evaluated
at runtime.
- * profile - Name of $imssulc pseudo-variable profile that will store
- the fetched contacts. It is a static string.
+ * profile - Name of $ulc pseudo-variable profile that will store the
+ fetched contacts. It is a static string.
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE
@@ -709,7 +709,7 @@ reg_fetch_contacts("location", "sip:user@kamailio.org", "caller");
data in that profile.
Meaning of the parameters is as follows:
- * profile - Name of $imssulc pseudo-variable profile that stores the
+ * profile - Name of $ulc pseudo-variable profile that stores the
contacts. It is a static string.
This function can be used in REQUEST_ROUTE, FAILURE_ROUTE
- len is first adjusted by the amount of chars consumed so far
- start pointer is then adjusted to begin new search
#### Pre-Submission Checklist
- [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 #4229
#### Description
Small logic tweak — we adjust `len` by the amount of chars consumed first, then adjust the `start` pointer to begin the new search.
Existing:
```
start = space + 1;
len = len - (space - start + 1); // this is a no-op
// as the pointer was adjusted first
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4230
-- Commit Summary --
* core: sdp - update start pointer only after len adjustment
-- File Changes --
M src/core/parser/sdp/sdp_helpr_funcs.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4230.patchhttps://github.com/kamailio/kamailio/pull/4230.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4230
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4230(a)github.com>
Module: kamailio
Branch: master
Commit: 283270128427ba8c5cfe34dc0af338d976a3a8b7
URL: https://github.com/kamailio/kamailio/commit/283270128427ba8c5cfe34dc0af338d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-07-18T09:42:13+02:00
tm: docs for t_relay_to_proxy(...)
---
Modified: src/modules/tm/doc/functions.xml
---
Diff: https://github.com/kamailio/kamailio/commit/283270128427ba8c5cfe34dc0af338d…
Patch: https://github.com/kamailio/kamailio/commit/283270128427ba8c5cfe34dc0af338d…
---
diff --git a/src/modules/tm/doc/functions.xml b/src/modules/tm/doc/functions.xml
index 4cd7f36ba2d..715e564e9ed 100644
--- a/src/modules/tm/doc/functions.xml
+++ b/src/modules/tm/doc/functions.xml
@@ -1739,6 +1739,30 @@ t_relay_to("0x01");
</example>
</section>
+ <section id="tm.f.t_relay_to_proxy">
+ <title>
+ <function>t_relay_to_proxy(proxy)</function>
+ </title>
+ <para>
+ Alternative function to relay the SIP request to a specific address,
+ with the parameter supporting variables inside it.
+ </para>
+ <para>
+ The format of the parameter is: "proto:host:port" - any of proto or port
+ can be omitted, along with the semicolon after or before.
+ </para>
+ <para>
+ The function can be used in REQUEST_ROUTE and FAILURE_ROUTE.
+ </para>
+ <example>
+ <title><function>t_relay_to_proxy</function> usage</title>
+ <programlisting>
+...
+t_relay_to_proxy("udp:$var(addr):5060");
+...
+ </programlisting>
+ </example>
+ </section>
<section id="tm.f.t_set_no_e2e_cancel_reason">
<title>