<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
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.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
Note that a feature request may be closed automatically after about 2 months
if there is no interest from developers or community users to implement it, being
considered expired. In such case can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the item 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 the proposed feature request.
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
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Expected behavior
large "key_value" can store to db_sql。
#### Actual observed behavior
the key_value = "{\"id\":1,\"in_port\":\"5263\",\"in_ptl\":\"udp\",\"rate_limit\":\"\",\"out_port\":\"5262\",\"out_ptl\":\"udp\",\"mode\":2,\"proxied_ip\":\"172.16.4.114\",\"proxied_port\":\"5080\",\"in_gateway_ip\":\"116.198.229.196\",\"in_gateway_port\":\"5080\",\"black_list\":{\"ip\":[\"127.0.0.1\"],\"user\":[]},\"white_list\":{\"ip\":[\"127.0.0.1\"],\"user\":[]},\"called_prefix\":[{\"match_num\":\"\",\"caller_rule\":{\"start_pos\":0,\"length\":2,\"new_num\":\"\",\"type\":2},\"called_rule\":{\"start_pos\":0,\"length\":0,\"new_num\":\"\",\"type\":0}}],\"caller_prefix\":[{\"match_num\":\"\",\"caller_rule\":{\"start_pos\":0,\"length\":2,\"new_num\":\"\",\"type\":1},\"called_rule\":{\"start_pos\":0,\"length\":0,\"new_num\":\"\",\"type\":0}}]}"
<img width="913" alt="企业微信截图_17234562508919" src="https://github.com/user-attachments/assets/ab0acd4b-980a-4dc5-95b3-8e8afb7a…">
#### Debugging Data
```
(paste your debugging data here)
```
#### 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
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a improvement.
-->
### 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:
compiled on 11:50:37 Aug 9 2024 with gcc 4.8.5
```
* **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 `uname -a`)
-->
```
(paste your output here)
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3944
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3944(a)github.com>
### Description
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
We are running Kamailio in front of a backend farm, REGISTERs go directly to the backend. After registration, the backend sends out OPTIONS requests periodically. This worked with 5.8.2. Now when running a 5.8.3 server (taken from your apt repository), I get the following errors in the log:
```
Sep 04 14:41:36 sipproxy /usr/sbin/kamailio[124]: ERROR: tm [ut.h:235]: uri2dst2(): bad_uri: [sip:[[2001:16e0:affe:affe:24a2:55a2:15bf:23d1]]:59580;transport=tls]
Sep 04 14:41:36 sipproxy /usr/sbin/kamailio[124]: ERROR: tm [t_fwd.c:1764]: t_forward_nonack(): failure to add branches
```
There are extra square brackets in the URI. I compared the REGISTERs from old and new Kamailio to the backend, and also the OPTIONS packets sent by the backend, the are identical except for the obvious differences.
### Troubleshooting
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
* Have a Kamailio with nathelper enabled.
* Do something like this for nat detection:
```
def ksr_route_natdetect(self, msg):
KSR.force_rport()
# Checks if request goes to backend or not
if not msg.is_internal_message():
KSR.setbflag(FLB_NATB)
KSR.setflag(FLT_NATS)
if KSR.textops.is_present_hf("Contact") > 0:
if KSR.nathelper.set_contact_alias() < 0:
msg.log("Error in aliasing contact")
KSR.sl.sl_send_reply(400,"Bad request")
return False
else:
if msg.is_request():
KSR.nathelper.handle_ruri_alias()
return 1
```
* register a phone to the backend (e.g. an Asterisk server)
* send an OPTIONS packet from the backend to the registered device.
#### SIP
The REGISTER from Kamailio to the backend looks like this:
```
REGISTER sip:domain;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 100.74.11.1:5063;branch=z9hG4bK6c3e.2cedb59e7724d263255c1996d9d2d4fa.0;i=6
Via: SIP/2.0/TLS [2001:16e0:affe:affe:24a2:55a2:15bf:23d1]:61391;received=2001:16e0:affe:affe:24a2:55a2:15bf:23d1;rport=61391;branch=z9hG4bKPjAB7F905A-A6A2-491D-A456-89C8FD4C5183;alias
Max-Forwards: 69
From: <sip:dZmIQyb70tzt2J9@sdammone>;tag=AAA80708-4968-4B49-95B8-7DBCEFCC5E62
To: <sip:dZmIQyb70tzt2J9@sdammone>
Call-ID: 4922AA11-F4BA-49D0-AE64-EECF49735684
CSeq: 44208 REGISTER
User-Agent: foobar
Supported: outbound, path
Contact: <sip:dZmIQyb70tzt2J9@[2001:16e0:affe:affe:24a2:55a2:15bf:23d1]:61391;transport=TLS;p-xs=6eb17056fba34ce6bc7d458a1a7a80ba;ob;alias=[2001:16e0:affe:affe:24a2:55a2:15bf:23d1]~61391~3>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00000c73bfc6>"
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
Path: <sip:100.74.11.1:5063;transport=tcp;lr;xep=true>
```
The OPTIONS packet from backend to the client looks like this:
```
OPTIONS sip:dZmIQyb70tzt2J9@[2001:16e0:affe:affe:24a2:55a2:15bf:23d1]:61391;transport=TLS;p-xs=6eb17056fba34ce6bc7d458a1a7a80ba;ob;alias=[2001:16e0:affe:affe:24a2:55a2:15bf:23d1]~61391~3 SIP/2.0
Via: SIP/2.0/TCP 100.74.130.66:5060;rport;branch=z9hG4bKPj3e558221-2506-4a2b-9daa-ff7e73d05e8c;alias
From: <sip:dZmIQyb70tzt2J9@sdammone>;tag=18c9809a-4775-4c35-8e88-5c5a7bdcf1fe
To: <sip:dZmIQyb70tzt2J9@[2001:16e0:affe:affe:24a2:55a2:15bf:23d1];p-xs=6eb17056fba34ce6bc7d458a1a7a80ba;ob;alias=[2001:16e0:affe:affe:24a2:55a2:15bf:23d1]~61391~3>
Contact: <sip:dZmIQyb70tzt2J9@100.74.130.66:5060;transport=TCP>
Call-ID: 2e1efbd3-9366-4542-b909-83429266b6ef
CSeq: 2989 OPTIONS
Supported: path
Route: <sip:100.74.11.1:5063;transport=tcp;lr;xep=true>
Max-Forwards: 70
User-Agent: barfoo
Content-Length: 0
```
#### Log Messages
```
Sep 04 14:41:36 sipproxy /usr/sbin/kamailio[124]: ERROR: tm [ut.h:235]: uri2dst2(): bad_uri: [sip:[[2001:16e0:affe:affe:24a2:55a2:15bf:23d1]]:59580;transport=tls]
Sep 04 14:41:36 sipproxy /usr/sbin/kamailio[124]: ERROR: tm [t_fwd.c:1764]: t_forward_nonack(): failure to add branches
```
### Possible Solutions
Downgrading to 5.8.2 again works.
I suppose, the problem comes from this commit by @vingarzan: https://github.com/kamailio/kamailio/commit/52ab6f3dcf5ad8d967be8bdecaa64ef…
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.8.3 (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 11.4.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`)
-->
```
Ubuntu Jammy
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3968
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3968(a)github.com>