lreproxy: add new lreproxy module
<!-- 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 #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2208
-- Commit Summary --
* lreproxy module
-- File Changes --
A src/modules/lreproxy/README.md (1)
A src/modules/lreproxy/lreproxy.c (1976)
A src/modules/lreproxy/lreproxy.h (120)
A src/modules/lreproxy/lreproxy_funcs.c (460)
A src/modules/lreproxy/lreproxy_funcs.h (41)
A src/modules/lreproxy/lreproxy_hash.c (521)
A src/modules/lreproxy/lreproxy_hash.h (70)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2208.patchhttps://github.com/kamailio/kamailio/pull/2208.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/2208
<!-- 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, ...)
- [ ] 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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2649
-- Commit Summary --
* ims_diameter_server: check response is not null before json conversion
* ims_diameter_server: fix initialization of s_message
* ims_diameter_server: drop cdp session to avoid deadlock
* ims_diameter_server: fix check for addAVPsfromJSON return code
-- File Changes --
M src/modules/ims_diameter_server/ims_diameter_server.c (15)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2649.patchhttps://github.com/kamailio/kamailio/pull/2649.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/2649
### Description
ndb_redis is treating MOVED reply from redis cluster as error and breaking out even before the cluster handling code gets a chance to process this.
```
if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
LM_ERR("Redis error:%.*s\n",
(int)rpl->rplRedis->len, rpl->rplRedis->str);
goto error_exec;
}
if (check_cluster_reply(rpl->rplRedis, &rsrv)) {
...
}
```
### Troubleshooting
#### Reproduction
Setup a redis cluster with at least 2 nodes.
Set modparam cluster=1 and allow_dynamic_nodes=1
fire redis get commands
#### Log Messages
```
ERROR: ndb_redis [redis_client.c:1037]: redisc_exec(): Redis error:MOVED 1090 10.4.20.69:6379
```
### Possible Solutions
revert https://github.com/kamailio/kamailio/commit/d00b14704805d728f5a845a6af900ef…
or
Add another check to ignore the above logic if cluster support is enabled.
or
Do not treat MOVED replies as of type REDIS_REPLY_ERROR
### Additional Information
```
kamailio built from branch 5.4.1
```
--
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/2461
### Description
When using a combination of TopoS+UACreg+Dialog, Kamailio fails to match received replies to a transaction in a dialog.
### Troubleshooting
modparam("topos", "storage", "redis")
modparam("topos", "sanity_checks", 0)
modparam("topos", "contact_mode", 0)
modparam("dialog", "track_cseq_updates", 1)
#### Reproduction
Load Topos + UAC + Dialog modules. Enable dialog cseq tracking.
Add some uacrec record. Register with remote peer.
Make a call towards the remote peer.
INVITE
- Cseq: 1, Branch number: 0. Kamailio will receive a 401 challenge.
- Cseq: 2, Branch number: 1, it will include the Digest auth and try again. . The mangled topos Contact username will be slightly different (supposed to be?)
- Next, the UAS will reply with 100 Trying. In response to that, Kamailio keeps retransmitting the same INVITE with Cseq 2 over and over again, presumably because it fails to match that reply to an existing transaction.
#### Debugging Data
```
DEBUG: {2 2 INVITE a19dfac7c4a65} tm [t_lookup.c:1009]: t_reply_matching(): failure to match a transaction
```
#### 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).
-->
```
2021/02/26 12:10:16.213947 10.10.10.2:5060 -> 10.10.10.1:5060
INVITE sip:8882223333@mypbx.mydomain.net SIP/2.0
Via: SIP/2.0/UDP mysbc.mydomain.com:5060;branch=z9hG4bK4f81.97f17905fe7afced720300fea57ef462.0;i=6a
FROM: Demo Five<sip:2385@mypbx.mydomain.net>;tag=29e99c29147f425f914b73512fc13cf3
TO: <sip:8882223333@mypbx.mydomain.net>
CSEQ: 1 INVITE
CALL-ID: 33c9034c136e57de9c1278daef7d02fb
MAX-FORWARDS: 69
CONTENT-LENGTH: 575
MIN-SE: 300
SUPPORTED: timer
USER-AGENT: UA
CONTENT-TYPE: application/sdp
ALLOW: INVITE,ACK,OPTIONS,CANCEL,BYE,NOTIFY
SESSION-EXPIRES: 3600
Contact: <sip:btpsh-603922bd-3db9-1@mysbc.mydomain.com:5060>
2021/02/26 12:10:16.215650 10.10.10.1:5060 -> 10.10.10.2:5060
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP mysbc.mydomain.com:5060;branch=z9hG4bK4f81.97f17905fe7afced720300fea57ef462.0;i=6a;received=10.10.10.2;rport=5060
From: Demo Five<sip:2385@mypbx.mydomain.net>;tag=29e99c29147f425f914b73512fc13cf3
To: <sip:8882223333@mypbx.mydomain.net>;tag=as7c952f5b
Call-ID: 33c9034c136e57de9c1278daef7d02fb
CSeq: 1 INVITE
Server: B2B
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer, path
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="4f8fcced"
Content-Length: 0
2021/02/26 12:10:16.238191 10.10.10.2:5060 -> 10.10.10.1:5060
ACK sip:8882223333@mypbx.mydomain.net SIP/2.0
FROM: Demo Five<sip:2385@mypbx.mydomain.net>;tag=29e99c29147f425f914b73512fc13cf3
To: <sip:8882223333@mypbx.mydomain.net>;tag=as7c952f5b
CSEQ: 1 ACK
CALL-ID: 33c9034c136e57de9c1278daef7d02fb
MAX-FORWARDS: 69
Via: SIP/2.0/UDP mysbc.mydomain.com:5060;branch=z9hG4bK4f81.97f17905fe7afced720300fea57ef462.0;i=6a
CONTENT-LENGTH: 0
2021/02/26 12:10:16.280455 10.10.10.2:5060 -> 10.10.10.1:5060
INVITE sip:8882223333@mypbx.mydomain.net SIP/2.0
Via: SIP/2.0/UDP mysbc.mydomain.com:5060;branch=z9hG4bK4f81.97f17905fe7afced720300fea57ef462.1.cs1;i=6a
FROM: Demo Five<sip:2385@mypbx.mydomain.net>;tag=29e99c29147f425f914b73512fc13cf3
TO: <sip:8882223333@mypbx.mydomain.net>
CSEQ: 2 INVITE
CALL-ID: 33c9034c136e57de9c1278daef7d02fb
MAX-FORWARDS: 69
CONTENT-LENGTH: 575
MIN-SE: 300
SUPPORTED: timer
USER-AGENT: UA
CONTENT-TYPE: application/sdp
ALLOW: INVITE,ACK,OPTIONS,CANCEL,BYE,NOTIFY
SESSION-EXPIRES: 3600
Authorization: Digest username="2385", realm="asterisk", nonce="4f8fcced", uri="sip:8882223333@mypbx.mydomain.net", response="ec1986d94b9a508c4e9761c3c1cb80eb", algorithm=MD5
Contact: <sip:btpsh-603922bd-3db0-4@mysbc.mydomain.com:5060>
2021/02/26 12:10:16.284672 10.10.10.1:5060 -> 10.10.10.2:5060
SIP/2.0 100 Trying
Via: SIP/2.0/UDP mysbc.mydomain.com:5060;branch=z9hG4bK4f81.97f17905fe7afced720300fea57ef462.1.cs1;i=6a;received=10.10.10.2;rport=5060
From: Demo Five<sip:2385@mypbx.mydomain.net>;tag=29e99c29147f425f914b73512fc13cf3
To: <sip:8882223333@mypbx.mydomain.net>
Call-ID: 33c9034c136e57de9c1278daef7d02fb
CSeq: 2 INVITE
Server: B2B
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer, path
Session-Expires: 900;refresher=uas
Contact: <sip:8882223333@10.10.10.1:5060>
Content-Length: 0
2021/02/26 12:10:16.745320 10.10.10.2:5060 -> 10.10.10.1:5060
INVITE sip:8882223333@mypbx.mydomain.net SIP/2.0
Via: SIP/2.0/UDP mysbc.mydomain.com:5060;branch=z9hG4bK4f81.97f17905fe7afced720300fea57ef462.1.cs1;i=6a
FROM: Demo Five<sip:2385@mypbx.mydomain.net>;tag=29e99c29147f425f914b73512fc13cf3
TO: <sip:8882223333@mypbx.mydomain.net>
CSEQ: 2 INVITE
CALL-ID: 33c9034c136e57de9c1278daef7d02fb
MAX-FORWARDS: 69
CONTENT-LENGTH: 575
MIN-SE: 300
SUPPORTED: timer
USER-AGENT: UA
CONTENT-TYPE: application/sdp
ALLOW: INVITE,ACK,OPTIONS,CANCEL,BYE,NOTIFY
SESSION-EXPIRES: 3600
Authorization: Digest username="2385", realm="asterisk", nonce="4f8fcced", uri="sip:8882223333@mypbx.mydomain.net", response="ec1986d94b9a508c4e9761c3c1cb80eb", algorithm=MD5
Contact: <sip:btpsh-603922bd-3db0-4@mysbc.mydomain.com:5060>
```
### 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.5.0-dev4 (x86_64/linux) 5ad3bd
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
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: 5ad3bd
compiled on 15:35:01 Feb 11 2021 with gcc 4.9.2
```
* **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`)
-->
```
Debian GNU/Linux 8 (jessie)
```
--
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/2654
### Description
I have created a broken config with construction
```
if (is_request()) {
}
```
When I try to check config I get the core
```
0(66437) CRITICAL: <core> [core/cfg.y:3665]: yyerror_at(): parse error in config file proxy-media.cfg, line 18, column 5: syntax error
0(66437) CRITICAL: <core> [core/cfg.y:3665]: yyerror_at(): parse error in config file proxy-media.cfg, line 18, column 5: bad command
0(66437) CRITICAL: <core> [core/cfg.y:3662]: yyerror_at(): parse error in config file proxy-media.cfg, line 20, column 5-6:
ERROR: bad config file (3 errors) (parsing code: 1)
0(66437) ERROR: <core> [core/ppcfg.c:243]: pp_ifdef_level_error(): different number of preprocessor directives: 1 more #!if[n]def as #!endif
0(66437) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized
Program received signal SIGSEGV, Segmentation fault.
0x00007fffee8589ca in BN_clear_free () from /lib64/libcrypto.so.1.1
Missing separate debuginfos, use: yum debuginfo-install brotli-1.0.6-2.el8.x86_64 cyrus-sasl-lib-2.1.27-5.el8.x86_64 hiredis-0.13.3-13.el8.x86_64 jansson-2.11-3.el8.x86_64 keyutils-libs-1.5.10-6.el8.x86_64 krb5-libs-1.18.2-5.el8.x86_64 libcom_err-1.45.6-1.el8.x86_64 libcurl-7.61.1-14.el8.x86_64 libidn2-2.2.0-1.el8.x86_64 libnghttp2-1.33.0-3.el8_2.1.x86_64 libpsl-0.20.2-6.el8.x86_64 libselinux-2.9-4.el8_3.x86_64 libssh-0.9.4-2.el8.x86_64 libunistring-0.9.9-3.el8.x86_64 libxcrypt-4.1.1-4.el8.x86_64 libxml2-2.9.7-8.el8.x86_64 openldap-2.4.46-15.el8.x86_64 openssl-libs-1.1.1g-11.el8.x86_64 pcre2-10.32-2.el8.x86_64 xz-libs-5.2.4-3.el8.x86_64 zlib-1.2.11-16.el8_2.x86_64
(gdb) bt full
#0 0x00007fffee8589ca in BN_clear_free () from /lib64/libcrypto.so.1.1
No symbol table info available.
#1 0x00007fffecec5825 in ssh_dh_finalize.part () from /lib64/libssh.so.4
No symbol table info available.
#2 0x00007fffeceb6e4d in libssh_destructor () from /lib64/libssh.so.4
No symbol table info available.
#3 0x00007ffff7de4386 in _dl_fini () from /lib64/ld-linux-x86-64.so.2
No symbol table info available.
#4 0x00007ffff708df8c in __run_exit_handlers () from /lib64/libc.so.6
No symbol table info available.
#5 0x00007ffff708e0c0 in exit () from /lib64/libc.so.6
No symbol table info available.
#6 0x00007ffff70777ba in __libc_start_main () from /lib64/libc.so.6
No symbol table info available.
#7 0x000000000041c39e in _start ()
No symbol table info available.
(gdb)
```
On host installed
```
[root@bcf-a0 config]# rpm -qf /lib64/libcrypto.so.1.1
openssl-libs-1.1.1g-11.el8.x86_64
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
[root@bcf-a0 config]# kamailio -v
version: kamailio 5.5.0-dev3 (x86_64/linux) aff06f
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: aff06f
compiled on 04:01:30 Jan 7 2021 with gcc 8.3.1
```
* **Operating System**:
```
[root@host ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
```
--
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/2599
### Description
I want to be sure my customization does not produce memory leack.
To get this work I want to use the ASAN project.
Could you add `mode=asan` build option that adds gcc ` -fsanitize=address -static-libasan` options `-lasan` linker flags.
More info
https://www.osc.edu/resources/getting_started/howto/howto_use_address_sanit…
Maybe important.
ASAN expects linked first
```
[root@b276215a3a22 kamailio]# kamailio -DD -E
==13760==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
```
--
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/2650
Dear all
we have been testing this module with the following setup
kamailio 5.3.2
evapi params
modparam("evapi", "workers", 4)
modparam("evapi", "netstring_format", 0)
modparam("evapi", "bind_addr", "127.0.0.1:8448")
modparam("evapi", "max_clients", 32)
then in the configuration we do evapi_relay of avp including a json data
(which can be quite long), like this
{"key" : "aarp2q0tcpqhs0cpucuhukjs2ah2j00q(a)10.18.5.64" , "msg" :
{"rg_in":"701","ani_init":{"ani_source":"pai", ....... }}}
We have an application listening on the tcp socket and writing those
messages to a kafka cluster, and this works ok, and in the previous manual
tests we have done no issue was found.
But when making some load tests, and passing some live traffic we see some
issues
seems like some times, when there are messages to be sent to the tcp socket
at the same time, they are sent in the same message, when normally each
data sent using evapi_relay is sent in 1 message
We do sometimes see something like this on the application consuming from
the tcp socket
2020-11-25 15:20:01.744 UTC [error]
<0.706.0>@evapi_kafka_listener:handle_info:167 body "{\"key\" : \"
6142651aa63616c6c04a783cd(a)72.21.24.130\" , \"msg\" :
{\"rg_in\":\"677\",\"ani_init\":{\"ani_source\":\"fro\",.......}}}{\"key\"
: \"isbc7caT4001915251VabcGhEfHdNiF0i(a)172.16.120.1\" , \"msg\" :
{\"rg_in\":\"22\",\"ani_init\":{\"ani_source\":\"pai\", .......
,\"translate" not valid json; error = {691,invalid_trailing_data}
2020-11-25 15:20:01.745 UTC [error]
<0.706.0>@evapi_kafka_listener:handle_info:167 body
"dPartition\":\"-1\",......}}}" not valid json; error = {1,invalid_json}
and we do see that the application cannot parse the json message fine,
because we have like 2 json objects together
......{\"ani_source\":\"fro\",.......}}}{\"key\" :
\"isbc7caT4001915251Vabc............
This happens with 2 different UDP receivers processing messages and calling
evapi_relay at the same time. But i don't think this happens all the time.
Seems like some issue when several processes try to use evapi workers at
the same time.
We tried to increase evapi workers and it's the same
We also saw another issue I think. Seems when the avp sent to evapi socket
is bigger than ~1680 char, the json is also truncated, and also happens
when we use the socket in Lo interface which has an MTU of 65535.
Could you please take a look to see if there is any problem or limitation,
or if we are using something wrong?
thanks and best regards
david
--
[image: Logo]
David Escartín Almudévar
VoIP/Switch Engineer
descartin(a)sonoc.io
*SONOC*
C/ Josefa Amar y Borbón, 10, 4ª · 50001 Zaragoza, España
Tlf: +34 917019888 · www.sonoc.io