<!--
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
- [ ] Tested changes locally
#### Description
From https://github.com/kamailio/kamailio/pull/3569
After initial subscription by the SCA device, if we power off and on again, we won't get an unsubscribe notification and we are getting a new record-route with sca-subscription. In this case kamailio not updating the new record-route for the SCA Device.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3571
-- Commit Summary --
* sca: update rr if necessary for subscriptions
-- File Changes --
M src/modules/sca/sca_subscribe.c (11)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3571.patchhttps://github.com/kamailio/kamailio/pull/3571.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3571
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3571(a)github.com>
### Description
I use debian 11 and Kamailio 5.6.x
modparam("htable", "htable", "callpush=>size=10;autoexpire=86400;dbtable=callpush;dbmode=1")
I can store the values in the table, but if I shutdown kamailio, the current values are not stored in the table.
#### Reproduction
Use a htable and dbtable and dbmode=1 and shutdown kamailio.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3536
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3536(a)github.com>
<!--
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.
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
The current issue revolves around the absence of username support within the NDB REDIS KAMALIO framework when dealing with Redis, particularly concerning the Redis and Sentinel components. While Redis inherently offers the capability to utilize both usernames and passwords during authentication, this capability is not currently extended to the NDB REDIS KAMALIO setup.
As a result, when attempting to establish connections to Redis instances through NDB REDIS KAMALIO, there is no provision for providing a username as part of the authentication process. Instead, the framework only accommodates the usage of passwords for authentication. This stands in contrast to Redis, which permits the inclusion of both usernames and passwords for enhanced security measures.
Consequently, the limitation within NDB REDIS KAMALIO can hinder organizations seeking to ensure comprehensive security practices, especially when the requirement is to employ both usernames and passwords for authentication. This divergence between the authentication capabilities of Redis and NDB REDIS KAMALIO can potentially compromise security standards and hinder compatibility with certain authentication setups.
To address this issue, it would be essential for the development team behind NDB REDIS KAMALIO to enhance the framework's capabilities by incorporating support for username-based authentication in addition to passwords. This alignment with Redis's authentication model would ensure that organizations can confidently implement secure data interactions while maintaining consistency with established security policies
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Expected behavior
The expected behavior entails an improvement within the NDB REDIS KAMALIO framework to support both usernames and passwords for authentication when interacting with Redis instances, particularly in the Redis and Sentinel components. This enhancement would bring NDB REDIS KAMALIO in line with Redis's native authentication capabilities, where both usernames and passwords are accepted during the authentication process.
Upon implementing this improvement, users of NDB REDIS KAMALIO should be able to configure their connections by providing both a username and a password as part of the authentication details. This allows NDB REDIS KAMALIO to establish connections to Redis instances that require both authentication credentials, thereby enhancing security and ensuring compatibility with various authentication setups.
By incorporating support for usernames in addition to passwords, NDB REDIS KAMALIO can accommodate organizations that require comprehensive security measures, especially in scenarios where username-based authentication is mandated. This alignment with Redis's authentication model would enable organizations to effectively collect, manage, and interact with data while adhering to established security policies.
In summary, the expected behavior is that NDB REDIS KAMALIO should be upgraded to offer support for usernames and passwords during authentication, mirroring Redis's capabilities. This enhancement ensures a consistent and secure approach to data interactions and supports various authentication requirements within Redis environments
#### Actual observed behavior
The current actual behavior is that NDB REDIS KAMALIO does not have the capability to accept usernames as part of the authentication process when connecting to Redis instances, specifically in both the Redis and Sentinel components. While Redis itself allows for the usage of both usernames and passwords for authentication, this feature is not currently integrated into the NDB REDIS KAMALIO framework.
As a result, when configuring connections to Redis instances using NDB REDIS KAMALIO, there is no provision to include a username alongside the authentication details. The framework only accommodates the use of passwords for authentication purposes. This deviation from Redis's authentication model could lead to compatibility issues with certain authentication setups, particularly those that mandate the use of both usernames and passwords.
In essence, the actual behavior is that NDB REDIS KAMALIO falls short of aligning with Redis's authentication capabilities, thereby potentially hindering secure data interactions and limiting compatibility with certain security policies. Users attempting to adhere to comprehensive authentication practices may face challenges when utilizing NDB REDIS KAMALIO due to its inability to support usernames during authentication.
To address this actual behavior, it would be necessary to enhance NDB REDIS KAMALIO's capabilities to include support for both usernames and passwords during the authentication process. This enhancement would ensure that organizations can confidently utilize NDB REDIS KAMALIO while maintaining the security standards and authentication requirements necessary for their Redis environments.
#### 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`
```
(paste your output here)
```
* **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/3552
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3552(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.
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
Currently, kamailio NDB Redis integration with Sentinel does not offer support for password authentication, leading to potential security concerns in our system. As a result, we are unable to ensure the desired level of protection for sensitive data stored in Redis.
*Expected Behavior:*
We expect Kamailio to allow the configuration of password authentication for Sentinel in the NDB Redis integration, enabling a secure and password-protected connection to the Redis instances.
*Proposed Solution:*
To address this issue, we recommend implementing a feature that enables password authentication for the Sentinel-based NDB Redis connections. This improvement will provide an added layer of security, ensuring that only authorized users can access the Redis instances.
*Impact:*
The absence of password authentication support poses a security risk, making our system vulnerable to potential unauthorized access and data breaches. Implementing this enhancement will safeguard sensitive information and strengthen our Redis integration's security framework.
Note: as of now NDB REDIS support redis authentication using password
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
Steps to Reproduce:*
1. Attempt to configure password authentication for Sentinel in kamailio NDB Redis integration.
ex:
modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=1;sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379";pass=mypassword")
*It is failed to connect the sentinel *
<!--
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.
-->
```
(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 fix.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
(paste your output here)
```
* **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`)
-->
```
(paste your output here)
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3530
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3530(a)github.com>
### Description
Newer rtpengine versions support manipulating SDP "a=" lines directly. Although kamailio is quite versatile when it comes to editing SIP message body, this functionality is often rather frail, especially when forking and having to use msg_apply_changes several times. I believe it would be beneficial to be able to offload such functionality to rtpengine, especially if one wants to apply different manipulations per outgoing branch.
### Expected behavior
There should be a way to issue rtpengine ng-control protocol commands compatible with the sdp-attr dictionary syntax.
#### Actual observed behavior
Currently sdp-attr tokens are not properly evaluated. For example, **doing**:
> rtpengine_manage("ICE=remove rtcp-mux-demux trust-address replace-origin replace-session-connection replace-SDP-version direction=internal direction=external sdp-attr-audio-substitute=$avp(fmtp_line) sdp-attr-audio-substitute=fmtp:101 0-15");
_[NOTE: $avp(fmtp_line) seems to expand in empty string here, which is a config error, but it doesn't affect the syntax demonstration in this example IMO]_
**results in**:
```
{
"supports": [ "load limit" ],
"sdp": "...",
"ICE": "remove",
"sdp-attr-audio-substitute": "",
"sdp-attr-audio-substitute": "fmtp:101",
"direction": [ "internal", "external" ],
"flags": [ "trust-address", "0-15" ],
"replace": [ "origin", "session-connection", "SDP-version" ],
"rtcp-mux": [ "demux" ],
"call-id": "...",
"received-from": [ "IP4", "..." ],
"from-tag": "...",
"to-tag": "...",
"command": "answer"
}
```
### Possible Solutions
Support the special syntax of sdp-attr as documented here: https://github.com/sipwise/rtpengine/blob/master/docs/ng_control_protocol.md
Here's one way to do it (I guess).
In order to get this:
```
"sdp-attr" :
{
"audio" :
{
"add" : [ "ptime:20", "sendrecv" ],
"substitute": [["fmtp:101 0-15" , "fmtp:126 0-16" ]]
},
"video":
{
"remove" : [ "rtpmap:101 telephone-event/8000" ]
},
"none" :
{
"substitute": [[ "sendrecv" , "sendonly" ], [ "ptime:20" , "ptime:40" ]]
}
}
```
Use a syntax similar to the following:
> rtpengine_manage("... sdp-attr-audio-add=ptime:20 sdp-attr-audio-add=sendrecv sdp-attr-audio-substitute=fmtp:101 0-15 sdp-attr-audio-substitute=fmtp:101 0-16 sdp-attr-video-remove=rtpmap:101 telephone-event/8000 sdp-attr-none-substitute=sendrecv sdp-attr-none-substitute=sendonly sdp-attr-none-substitute=ptime:20 sdp-attr-none-substitute=ptime:40 ...");
It's not very pretty, but it could work. Caveats:
* How to handle whitespace (e.g. there's a space in "fmtp:101 0-15" and in "rtpmap:101 telephone-event/8000" )
* substitute commands must always be in pairs, data type is a list of lists containing exactly two items as value in "substitute" key
Unfortunately my C skills are not up to this task, but if I can provide any other kind of help please let me know. Thanks!
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3509
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3509(a)github.com>
#### 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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
This is a proposed evolution that adds socket timestamping of received UDP packets (using SO_TIMESTAMPNS).
It computes the delay between this timestamp and the time at which the packet is read by Kamailio.
This can then be accessed using pv "$TV(RD)" (RD for "receive relay").
Rationale :
The Kamailio server is handling traffic that is irregular and can temporarily spike to a point where all children are still busy when new packets are incoming on the network interface.
Consequently, these packets have to wait until a worker is available. The client will see a higher response time, that currently cannot be monitored by Kamailio itself.
This evolution allows to make this wait time observable by Kamailio, allowing to log or write the information to CDR for example.
If this is possible, I'd like to merge this feature in Kamailio.
Of course, I'm ready to discuss the PR and make any necessary changes.
All comments and reviews are most welcome.
I've tested this locally on Linux (3.10.0-957.10.1.el7.x86_64) with the latest Kamailio master as of 2023/03/23.
Thanks!
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3404
-- Commit Summary --
* core: add socket timestamp of received packets and keep track of receive delay
* pv: add $TV(RD) to get the new information "receive delay"
-- File Changes --
M src/core/ip_addr.h (1)
M src/core/parser/msg_parser.h (1)
M src/core/receive.c (8)
M src/core/udp_server.c (60)
M src/core/ut.h (34)
M src/modules/pv/pv_time.c (15)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3404.patchhttps://github.com/kamailio/kamailio/pull/3404.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3404
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3404(a)github.com>
<!--
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:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
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.
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
Currently the functions set_advertised_address and set_advertised_port only accept strings as parameters. Trying to use it with variable causes an error.
Having the function using a hard coded value is not a good practice and in order to add flexibility to the script in different installations it would be nice to have this function accepting variables.
Also, the 'advertise' option on the 'listen' parameter is not always desired because it apply for all messages sent via the socket, and there are situations where different advertised IP for the same interface are necessary.
### Expected behavior
set_advertised_address should receive a variable as parameter and use its value to change the SIP headers.
### Actual observed behavior
Kamailio won't start if set_advertised_address is used with a variable due to script parse error or it will set the SIP message with the literal string "$var(test)" for example, instead of using the value of $var(test).
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# kamailio -v
version: kamailio 5.2.2 (x86_64/linux) 67f967
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, 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_BLACKLIST, HAVE_RESOLV_RES
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: 67f967
compiled on 11:40:41 Mar 11 2019 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`)
-->
```
# uname -a
Linux voice-conn-kamailio-1 3.10.0-514.21.2.el7.x86_64 #1 SMP Tue Jun 20 12:24:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2137
<!-- 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 -->
kamctl now sources the kamctlrc from only one location if available in this order:
1. same folder as kamctl,
2. {intstall_prefix}/etc/kamailio/,
3. ~/.kamctlrc
4. /etc/kamailio/.
If no kamctlrc is found, it continues just like before. Should it stop?
#### Issue description
`kamctl` uses env variables from all the config files above, and retains the env value of the latest config that declares it.
Let's say we have 3 kamctlrc files right now:
```
# first config file (same folder that kamctl resides)
# {prefix_install}/sbin/kamctlrc
...
SIP_DOMAIN=kamailio.org
DBENGINE is commented
...
```
```
# second config file
# /etc/kamailio/kamctlrc
...
SIP_DOMAIN=kam02.tst.nbg.gilawa.net
DBENGINE=MYSQL
...
```
```
# third config file
# {prefix_install}/etc/kamailio/kamctlrc
...
SIP_DOMAIN is commented
DBENGINE=MYSQL
...
```
Running `{install_prefix}/sbin/kamctl` (before changes in order) it prints :
```
Loading config file /home/xenofon/kamailio-source-install/sbin/kamctlrc
Loading config file /etc/kamailio/kamctlrc
Loading config file /home/xenofon/kamailio-source-install/etc/kamailio//kamctlrc
SIP_DOMAIN env var is kam02.tst.nbg.gilawa.net
DBENGINE env var is MYSQL
```
suggesting that env variables from multiple sources are gathered and overwritten in cases.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3594
-- Commit Summary --
* kamctl: Source only one kamctlrc
-- File Changes --
M utils/kamctl/kamctl (23)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3594.patchhttps://github.com/kamailio/kamailio/pull/3594.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3594
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3594(a)github.com>
Use tcp_send_timeout config option also on listening socket to timeout outbound messages sent on passive inbound connections.
#### 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 #3443
#### Description
Based on the description of core parameter "tcp_send_timeout" the timeout should also work for sending on forked incoming tcp connections. But sending on a broken connection causes the kernel to use the default values of `tcp_retries1` and `tcp_retries2` , leading to try to send a SIP message for 15 minutes. This makes absolutely no sense in a real time kamailio application.
Following man 7 tcp TCP_USER_TIMEOUT can be used on recent Linux kernels to utilize tcp_send_timeout:
TCP_USER_TIMEOUT (since Linux 2.6.37)
This option takes an unsigned int as an argument. When the value is greater than 0, it specifies the maximum
amount of time in milliseconds that transmitted data may remain unacknowledged before TCP will forcibly close the
corresponding connection and return ETIMEDOUT to the application. If the option value is specified as 0, TCP will
use the system default.
Increasing user timeouts allows a TCP connection to survive extended periods without end-to-end connectivity. De‐
creasing user timeouts allows applications to "fail fast", if so desired. Otherwise, failure may take up to 20
minutes with the current system defaults in a normal WAN environment.
This option can be set during any state of a TCP connection, but is effective only during the synchronized states
of a connection (ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, and LAST-ACK). Moreover, when used
with the TCP keepalive (SO_KEEPALIVE) option, TCP_USER_TIMEOUT will override keepalive to determine when to close
a connection due to keepalive failure.
The option has no effect on when TCP retransmits a packet, nor when a keepalive probe is sent.
This option, like many others, will be inherited by the socket returned by accept(2), if it was set on the listen‐
ing socket.
Further details on the user timeout feature can be found in RFC 793 and RFC 5482 ("TCP User Timeout Option").
Having a tcp connection break by firewall or network breakdown the retransmits to this destination are now aborted after `tcp_send_timeout` seconds with a
NOTICE: <core> [core/tcp_read.c:267]: tcp_read_data(): error reading: Connection timed out (110) ([1.2.3.4]:51151 ->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3528
-- Commit Summary --
* core: Add TCP_USER_TIMEOUT socket option on listening socket.
-- File Changes --
M src/core/tcp_main.c (13)
M src/core/tcp_options.h (7)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3528.patchhttps://github.com/kamailio/kamailio/pull/3528.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3528
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3528(a)github.com>