### Description
We are trying to perform an outbound call through kamailio (5.6). When doing so, we are getting an expected 407 response from the trunk provider. As reponse we try to authenticate. This last invite being sent from kamailio to the trunk provider contains a bad content-length field.
if the content header field value was 1234 in the original invite, the last ones content-header field value is 12341234. So it looks like it's not cleared before its set.
### Troubleshooting
this source we used to troubleshoot:
xlog("L_WARN", "TRUNKAUTH entered, message: $mbu\n"); AT THIS POINT CONTENT_HEADER = 1234 (just an example)
if(t_check_status("401|407")) {
$avp(auser) = "testuser";
$avp(apass) = "credshere";
uac_auth();
xlog("L_WARN", "TRUNKAUTH Auth done, updated message: $mbu\n"); AT THIS POINT CONTENT_HEADER = 12341234
route(RELAY);
#### Reproduction
See troubleshooting
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
kamailio 5.6.2 (x86_64/linux)
```
* **Operating System**:
```
kamailio 5.6.2 (x86_64/linux)
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3275
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3275(a)github.com>
Module: kamailio
Branch: 5.6
Commit: e8494799a86a0487c013ca457cac88fac4ce6501
URL: https://github.com/kamailio/kamailio/commit/e8494799a86a0487c013ca457cac88f…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-11-28T10:05:40+01:00
pkg/kamailio/deb: fix jammy build
---
Modified: pkg/kamailio/deb/debian/backports/jammy
Modified: pkg/kamailio/deb/jammy/control
Modified: pkg/kamailio/deb/jammy/rules
---
Diff: https://github.com/kamailio/kamailio/commit/e8494799a86a0487c013ca457cac88f…
Patch: https://github.com/kamailio/kamailio/commit/e8494799a86a0487c013ca457cac88f…
---
diff --git a/pkg/kamailio/deb/debian/backports/jammy b/pkg/kamailio/deb/debian/backports/jammy
index a469871dcf..097873e0fa 100755
--- a/pkg/kamailio/deb/debian/backports/jammy
+++ b/pkg/kamailio/deb/debian/backports/jammy
@@ -6,6 +6,12 @@ DIST=jammy
rm -rf ${DIST}
cp -r debian ${DIST}
+# No mi_xmlrpc module
+sed -i -e '/libxmlrpc-c3-dev/d' -e '/^Package: kamailio-xmlrpc-modules/,/^$/d' \
+ ${DIST}/control
+sed -i -e 's/ mi_xmlrpc[ ,$]*/ /' ${DIST}/rules
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ mi_xmlrpc/' ${DIST}/rules
+
# No dnssec module:
sed -i -e '/libval-dev/d' -e '/^Package: kamailio-dnssec-modules/,/^$/d' \
${DIST}/control
diff --git a/pkg/kamailio/deb/jammy/control b/pkg/kamailio/deb/jammy/control
index 285c8be9a6..1c7ef64aa3 100644
--- a/pkg/kamailio/deb/jammy/control
+++ b/pkg/kamailio/deb/jammy/control
@@ -48,7 +48,6 @@ Build-Depends:
libunistring-dev,
libwebsockets-dev,
libxml2-dev,
- libxmlrpc-c3-dev,
openssl,
pkg-config,
python3,
diff --git a/pkg/kamailio/deb/jammy/rules b/pkg/kamailio/deb/jammy/rules
index 3ab41f9f68..77ff6490f6 100755
--- a/pkg/kamailio/deb/jammy/rules
+++ b/pkg/kamailio/deb/jammy/rules
@@ -26,7 +26,7 @@ EXCLUDED_MODULES=
# extra modules to skip, because they are not compilable now
# - regardless if they go to the main kamailio package or to some module package,
# they will be excluded from compile and install of all
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc
# module groups that are packaged in separate packages
# (with the name kamailio-$(group_name)-modules)
Hello Team,
**Description**
Automatic queue creation with Kazoo module in kamailio.
Noticed that , amqp_max_channels parameter creates automatic queues in Rabbitmq-server based on the channel number provided.
Expecting that , it should create only channels not queues.
**Parameter Used**
modparam("kazoo", "amqp_max_channels", 10)
**Additional Information**
Kamailio Version - output of kamailio -v
kamailio 5.5.1 (x86_64/linux)
Can any one help on this issue as why the kazoo module creates an automatic queue based on amqp_max_channels param ?
Thanks
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3285
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3285(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:
* 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
<!--
Explain what you did, what you expected to happen, and what actually happened.
-->
I'm testing kamailio v 5.6.1 in an alpine linux docker with musl libc (x86_64) Version 1.2.3 and I see a kamailio crash just with version option (kamailio --version).
The crash occur if I haven't localhost resolution in /etc/hosts. This isn't a canonical situation, but crash occur!
Running kamailio with gdb I see that the problem is in freeaddrinfo call in log_init function.
#### Reproduction
<!--
If the issue can be reproduced, describe how it can be done.
-->
cat /etc/hosts
#127.0.0.1 localhost
#::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
#172.30.0.3 bd9375eeb5af
#2001:db8:1111:2222:0:242:ac1e:3 bd9375eeb5af
/ #
/ # kamailio --version
Segmentation fault (core dumped)
#### 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.
-->
```
# gdb --args kamailio --version
GNU gdb (GDB) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-alpine-linux-musl".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from kamailio...
(gdb) run
Starting program: /usr/local/sbin/kamailio --version
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f9f5ed in freeaddrinfo () from /lib/ld-musl-x86_64.so.1
(gdb) bt
#0 0x00007ffff7f9f5ed in freeaddrinfo () from /lib/ld-musl-x86_64.so.1
#1 0x000055555559087d in calc_proc_no () at main.c:1976
#2 0x00007fffffffe8d0 in ?? ()
#3 0x00007fffffffed58 in ?? ()
#4 0x000055555561b143 in log_init () at core/dprint.c:483
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a fix.
-->
I suppose that log_init function needs a check for info pointer. If info pointer is not NULL, then call freeaddrinfo. I see similar protections in other points of code.
```
void log_init(void)
{
struct addrinfo hints;
struct addrinfo *info = NULL;
int gai_result;
char hostname[1024];
hostname[1023] = '\0';
gethostname (hostname, 1023);
memset (&hints, 0, sizeof (hints));
hints.ai_family = AF_UNSPEC; /*either IPV4 or IPV6 */
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
if ((gai_result = getaddrinfo (hostname, 0, &hints, &info)) != 0) {
log_fqdn = "?";
} else if (info == NULL) {
log_fqdn = "?";
} else {
log_fqdn = strdup (info->ai_canonname);
}
if(info) // add pointer validity
freeaddrinfo (info);
dprint_init_colors();
}
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.6.2 (x86_64/linux) 54a9c1
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, 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_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
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: 54a9c1
compiled on 09:26:43 Nov 15 2022 with gcc 9.3.0
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3281
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3281(a)github.com>
In my use case I use HS256 so its a shared secret normally using a string with environment variable or something, not a key file. The jwt mod expects a file to load up the secret/key. So I just create a file with the secret inside the file, but I keep getting.
```
failed to decode jwt value
```
After digging into the source and trying to debug. It looks like when it's handing secret in a file the kdata.len is off by one.
This is the dirty fix for me.
```
diff --git a/src/modules/jwt/jwt_mod.c b/src/modules/jwt/jwt_mod.c
index 233a0709..a67d0b89 100644
--- a/src/modules/jwt/jwt_mod.c
+++ b/src/modules/jwt/jwt_mod.c
@@ -509,7 +509,7 @@ static int ki_jwt_verify(sip_msg_t* msg, str *key, str *alg, str *claims,
}
}
- ret = jwt_decode(&jwt, jwtval->s, (unsigned char*)kdata.s, (size_t)kdata.len);
+ ret = jwt_decode(&jwt, jwtval->s, (unsigned char*)kdata.s, (size_t)kdata.len-1);
if (ret!=0 || jwt==NULL) {
LM_ERR("failed to decode jwt value\n");
goto error;
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3282
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3282(a)github.com>