<!-- 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 -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] 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 #1911
#### Description
<!-- Describe your changes in detail -->
The goal was to have a different, more complex hashing algorithm that would offer a better distribution among nodes. We've seen in production that the current algorithm does not perform well under heavy load therefore we decided to add SHA1 hashing. After running performance tests we've decided that we need a cryptographic function in order to have the best results mostly when the callids have small entropy.
In order to add SHA1, a new API was added in crypto module exporting a function applying SHA1 to a string. The API was used in rtpengine module over the callid. After this operation the hash was calculated as before except for applying 0xFF mask over the hash as it was done before, which restrains the power of this algorithm.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1986
-- Commit Summary --
* crypto: add exportable API and expose SHA1 hashing function
* rtpengine: use SHA1 over callid for better distribution among nodes
* rtpengine: add modparam to switch between legacy hashing algorithm and SHA1
* rtpengine: update README
-- File Changes --
A src/modules/crypto/api.c (30)
A src/modules/crypto/api.h (63)
M src/modules/crypto/crypto_mod.c (2)
M src/modules/crypto/crypto_uuid.c (34)
M src/modules/crypto/crypto_uuid.h (8)
M src/modules/rtpengine/doc/rtpengine_admin.xml (25)
M src/modules/rtpengine/rtpengine.c (53)
M src/modules/rtpengine/rtpengine.h (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1986.patchhttps://github.com/kamailio/kamailio/pull/1986.diff
--
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/pull/1986
<!--
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:
* 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 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 have installed kamailio with apt-get on my Debian buster
I have downloaded the kamailio source of the same version
echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64/
I have compiled the app_java module successfully
I have copied the resulting app_java.so into my kamailio modules path
I have tried to load app_java adding the following into my conf
`# module app_java
loadmodule "app_java.so"
modparam("app_java", "class_name", "Kamailio")
modparam("app_java", "child_init_method", "child_init")
modparam("app_java", "java_options", "-Djava.compiler=/usr/lib/jvm/java-11-openjdk-amd64/bin/javac -Djava.class.path=/usr/lib/x86_64-linux-gnu/kamailio/java/:/usr/lib/x86_64-linux-gnu/kamailio/java/:/usr/lib/x86_64-linux-gnu/kamailio/java/kamailio.jar -verbose:gc,jni")
modparam("app_java", "force_cmd_exec", 1);
`
kamailio crashes
-->
### Troubleshooting
#### Reproduction
<!--
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 `uname -a`)
-->
```
(paste your output here)
```
--
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/1969
<!--
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:
* 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 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
Using t_set_fr within the LOCATION section of a slightly modified default kamailio.cfg only works if the contact is using UDP and not TCP.
```
# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 30000)
# User location service
route[LOCATION] {
[...]
# per subscriber ring time
if ($avp(s:ring_time) != $null) {
# xlog("setting time out to $avp(s:ring_time)");
t_set_fr($avp(s:ring_time) * 1000);
}
}
```
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
#### Reproduction
register an contact with UDP, set the timer to 5 seconds. observe kamailio terminates the invite after 5 seconds.
then with TCP observe kamailio terminates the invite after 30 seconds (the default)
<!--
If the issue can be reproduced, describe how it can be done.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.2.1 (x86_64/linux) 947769
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: 947769
compiled on 20:48:14 Feb 26 2019 with gcc 4.8.5
```
* **Operating System**:
CentOS 7
<!--
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`)
-->
--
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/1966
<!--
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:
* 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 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 are using rtpengine with kamailio [KSR-LUA]. kamailio sending the rtpengine_offer to rtpengine. If kamailio didn't get the response from the rtpengine then it's not retrying . for rtpengine_answer and rtpengine_delete retry is working pretty good.
we are using following rtpengine configuration
# ----- rtpengine params -----
modparam("rtpengine", "db_url", DBURL)
modparam("rtpengine", "table_name" , "rtpengine")
modparam("rtpengine", "rtpengine_allow_op", 1)
modparam("rtpengine", "queried_nodes_limit", 4)
modparam("rtpengine", "rtpengine_retr", 2)
modparam("rtpengine", "rtp_inst_pvar", "$avp(RTP_INSTANCE)")
modparam("rtpengine", "setid_default", 1)
modparam("rtpengine", "rtpengine_tout_ms", 400)
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
### Troubleshooting
#### Reproduction
This issue can be reproduced by above configuration. and need to use rtpengine_offer,rtpengine_answer and rtpengine_delete with ksr lua routing.
<!--
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`
```
version: kamailio 5.1.4 (x86_64/linux) a1df59
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_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: a1df59
compiled on 06:23:23 Oct 30 2018 with gcc 4.8.4
```
* **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`)
-->
```
root@ip-172-31-4-160:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
root@ip-172-31-4-160:~# uname -a
Linux ip-172-31-4-160 3.13.0-143-generic #192-Ubuntu SMP Tue Feb 27 10:45:36 UTC 2018 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/1696
### Description
In a setup with 2 kamailios in active/passive with a virtual IP that failovers between them:
sbc01 (active) is handling calls.
sbc02 (passive) is started, and does an initial dialog sync via DMQ
```
root@sbc01:~# kamctl rpc stats.get_statistics all | grep dialog
"dialog:active_dialogs = 39",
"dialog:early_dialogs = 2",
"dialog:expired_dialogs = 0",
"dialog:failed_dialogs = 583",
"dialog:processed_dialogs = 2527",
root@sbc01:~#
```
```
root@sbc02:/etc/kamailio# kamctl rpc stats.get_statistics all | grep dialog
"dialog:active_dialogs = 39",
"dialog:early_dialogs = 0",
"dialog:expired_dialogs = 0",
"dialog:failed_dialogs = 0",
"dialog:processed_dialogs = 0",
root@sbc02:/etc/kamailio#
```
>From that point onwards, as long as sbc01 stays as active, sbc02 stays as passive, and no restarts occur anywhere, the values for `dialog` metrics in sbc02 will not change and remain as they are, in the previous example, active_dialogs would remain as 39.
### Troubleshooting
This was discovered during some tests from #1591
#### Reproduction
Setup 2 kamailio instances that replicate dialogs via DMQ.
1- On Kamailio1 put some traffic to have some active dialogs (must call `dlg_manage()` in routing script for these test calls)
2- Start Kamailio2
3- Compare output of: `kamcmd stats.get_statistics dialog:` on both nodes.
4- Alter the amount of active dialogs on Kamailio1 (either end some or create new ones).
5- Repeat step 3.
Kamailio1 --> Step5 will have different values from Step3.
Kamailio2 --> Step5 will have exactly the same values from Step3.
### Possible Solutions
`dialog:active_dialogs` should remain as 0 on Kamailio2, as technically there are no dialogs being handled by that server, it only has information of replicated dialogs and those stats are available in the `dlg.stats_active` metric.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# kamailio -V
version: kamailio 5.2.0-pre1 (x86_64/linux) 2ecf60-dirty
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: 2ecf60 -dirty
compiled with gcc 6.3.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 `uname -a`)
-->
```
root@sbc02:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
root@sbc02:~# uname -a
Linux sbc02 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u6 (2018-10-08) x86_64 GNU/Linux
root@sbc02:~#
```
--
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/1692
It seems a good idea to support JWT as a new SIP authorization method. Wonder if anyone is interested? Think auth_db would be the best spot to add support for JWT.
---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/29
### Description
Kamailio with TOPOS enabled acts as a proxy between SIP client and SBC.
When client sends "180 Ringing" without Contact header - kamailio does not forward it to SBC.
If Contact header exists in "180 Ringing" - all works as expected.
### Troubleshooting
#### Reproduction
Load and configure topos module
Make call with "180 Ringing" without Contact header - kamailio will not forward it.
#### Log Messages
```
ERROR: topos [tps_storage.c:340]: tps_storage_link_msg(): bad sip message or missing Contact hdr
```
#### SIP Traffic
```
SIP/2.0 180 Ringing
Via: SIP/2.0/TLS 1.2.3.4:5061;branch=z9hG4bKef45.8c75f0bae8a59dfaec6ff533ff0f3b2d.0
From: <sip:1111@1.2.3.4:5061>;tag=02000879948559
To: <sip:2.2.2.2@5.6.7.8:5061;transport=tls;user=phone>;tag=SDbsq8499-y2pMOVV
Call-ID: apdW7374315131g0bcGhEfDjFof
CSeq: 988207425 INVITE
User-Agent: agent
Supported: replaces, outbound
Content-Length: 0
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.1.6 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, 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_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select
```
* **Operating System**:
```
Red Hat Enterprise Linux Server 7.3
3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 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/1720
### Description
In our setup, we try to eliminate setup configuration in database and replace it with files. The advantage is, that we can maintain those files via puppet or ansible, and since we always rewrite the whole file, we don't have to take care about deleting obsolete entries. We can run different Kamailio versions without having problems with the version table when using the same database. And finally, we can stop all those local mysqld processes on a lot of machines.
Modules like the dispatcher module were easy to change. But the permissions module is not prepared to run without database, if you want to use `allow_trusted()` or `allow_source_address()` and similar. The only option to feed those functions with data is a database table.
### Expected behavior
We would like to place files for trusted and address into the Kamailio directory and have Kamailio read from those files during startup or after reload commands.
#### Actual observed behavior
Data for trusted and address have to reside inside a database.
--
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/2037
When I just tried to do a commit today, I got the following error:
```
kamailio $ git ci .
error: 'pkg/docker' does not have a commit checked out
fatal: updating files failed
```
It is related to the `pkg/docker` submodule referencing to kamailio/kamailio-ci.
Not sure if this is due to a new git version or something else, because I did commits in that folder a few days ago.
To get is sorted out, I did:
```
kamailio $ git submodule update pkg/docker
Submodule path 'pkg/docker' not initialized
Maybe you want to use 'update --init'?
kamailio $ git submodule update --init pkg/docker
Submodule 'pkg/docker' (https://github.com/kamailio/kamailio-ci.git) registered for path 'pkg/docker'
Cloning into '/.../kamailio/pkg/docker'...
Submodule path 'pkg/docker': checked out 'b92a1c899b8c474afadd0cf29dd7cb4ea01a3466'
```
Then it worked to do the commit.
I wonder if this is going to break the process we were used with, specially the installation guidelines from GIT repo. Therefore I open this item to see if we really need the to have `pkg/docker` submodule, or better have the docker files directly in the repo. Other options to keep things sane and simple?
Git version:
```
$ git --version
git version 2.22.0
```
--
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/2003