### Description
We have some JS code looping over all P-Asserted-Identity headers removing some of the entries:
```
let headerIndex = 0;
const telUriMatcher = new RegExp("tel:");
let paiValue = ksr.pv
.gete("$(hdr(P-Asserted-Identity)[" + headerIndex + "])")
.toString();
while (paiValue.length > 0) {
ksr.info(
`${ksr.pv.getw("$ci")}: Found P-A-I header with content <${ksr.pv.getw(
"$(hdr(P-Asserted-Identity)[" + headerIndex + "])"
)}> at index ${headerIndex}\n`
);
if (telUriMatcher.test(paiValue)) {
ksr.info(
`${ksr.pv.getw("$ci")}: Removed P-A-I header ${ksr.pv.getw(
"$(hdr(P-Asserted-Identity)[" + headerIndex + "])"
)}\n`
);
ksr.textopsx.remove_hf_value(
"P-Asserted-Identity[" + headerIndex + "]"
);
}
headerIndex++;
paiValue = ksr.pv
.gete("$(hdr(P-Asserted-Identity)[" + headerIndex + "])")
.toString();
}
```
In our tests, we wanted to remove the second header, but the first one got removed instead. The pseudovars docs say, the index of a header is 0-based. In textopsx docs it doesn't explicitly say, it's 1-based, but the first example shows it actually is.
### Possible Solutions
Right now, we replaced the line
```
ksr.textopsx.remove_hf_value("P-Asserted-Identity[" + headerIndex + "]");
```
with this one:
```
ksr.textopsx.remove_hf_value("P-Asserted-Identity[" + (headerIndex + 1) + "]");
```
This solves the problem, but it is not what we would expect. Both header access methods should use the same index base.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.3.5 (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, 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, 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: unknown
compiled with gcc 8.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`)
-->
```
Linux hostname 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) 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/2387
### Description
I'm using dispatcher module like:
```
loadmodule "dispatcher.so"
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_ping_interval", 60)
```
With records like:
```
1 sip:sip.host.com;transport=tls 0 1 socket=tls:111.222.233.10:5061;ping_from=sip:my-domain-01.com
2 sip:sip.host.com;transport=tls 0 1 socket=tls:111.222.233.20:5061;ping_from=sip:my-domain-02.com
```
In event_route[tm:local-request] I'm modifying 'Contact' and would like to specify what client TLS profile to use via server name or server id.
```
event_route[tm:local-request] {
if(is_method("OPTIONS")) {
append_hf("Contact: <sip:some-host.com;transport=tls>\r\n");
$xavp(tls=>server_name)=$fd;
$xavp(tls[0]=>server_id)=$fd;
}
}
```
Setting 'tls' xavp doesn't make any difference and default client TLS profile is being used.
It happens because in src/modules/tm/uac.c there is a code:
```
t_run_local_req()
...
tm_xdata_swap(new_cell, &backup_xd, 0);
...
/* restore original environment */
tm_xdata_swap(new_cell, &backup_xd, 1);
```
which resets any xavp changes done in event_route[tm:local-request].
Expected behaviour: ability to use xavp in tm:local-request route. That would allow to choose TLS client profile for dispatcher initiated requests.
### Possible Solutions
As a hack, in tm_xdata_swap() for mode=1, don't restore xavp list if it was NULL.
```
if (x->xavps_list != NULL && *x->xavps_list==NULL) {
// .... don't restore empty list...
} else {
xavp_set_list(x->xavps_list);
}
```
This change allows to select required TLS profile for dispatcher requests.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.3.5 (x86_64/linux) ff2f8c-dirty
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_BLACKLIST, 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: ff2f8c -dirty
compiled on 10:19:05 Jul 28 2020 with gcc 7.5.0
```
* **Operating System**:
```
Linux xx 4.15.0-111-generic #112-Ubuntu SMP Thu Jul 9 20:32:34 UTC 2020 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/2413
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
### 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 Kamailio in a multi-homed configuration to register with another device using the uac module, it does not retrieve the custom or default socket information for timed registration attempts. It does, however, use the custom/default socket data for the initial registration.
#### Reproduction
The network is configured for two addresses: 10.9.9.121/24 and 10.9.7.121/24.
Two floating IP addresses are also assigned (via Pacemaker/Corosync): 10.9.9.120/24 and 10.9.7.120/24. For testing, all addresses can be assigned permanently, so it is not necessary to have Pacemaker/Corosync installed.
MySQL database has a user in the uacreg table with the socket column set to udp:10.9.7.120:5060.
kamailio.cfg includes the following to enable sending of REGISTER messages:
mhomed = 1
listen=udp:10.9.9.120
listen=udp:10.9.7.120
#!define DBURL "mysql://kamailio:kamailiorw@10.9.9.101/kamailio"
modparam("rr", "append_fromtag", 1);
modparam("uac", "reg_db_url", DBURL);
modparam("uac", "reg_contact_addr", "10.9.7.120:5060");
modparam("uac", "reg_keep_callid", 1);
modparam("uac", "default_socket", "udp:10.9.7.120:5060");
modparam("uac", "reg_timer_interval", 30);
#### Log Messages
The initial REGISTER outputs the following log data. The registration completes successfully.
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: uac [uac.c:407]: child_init(): run initial uac registration routine
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: uac [uac_reg.c:1172]: uac_reg_update(): using custom socket udp:10.9.7.120:5060 to send request
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/socket_info.c:628]: grep_sock_info(): checking if host==us: 10==10 && [10.9.7.120] == [10.9.9.120]
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/socket_info.c:635]: grep_sock_info(): checking if port 5060 (advertise 0) matches port 5060
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/socket_info.c:628]: grep_sock_info(): checking if host==us: 10==10 && [10.9.7.120] == [10.9.7.120]
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/socket_info.c:635]: grep_sock_info(): checking if port 5060 (advertise 0) matches port 5060
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: tm [uac.c:435]: t_uac_prepare(): next_hop=<sip:10.9.7.102>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: tm [uac.c:158]: dlg2hash(): hashid 3846
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: tm [uac.c:244]: t_run_local_req(): executing event_route[tm:local-request]
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/parser/msg_parser.c:610]: parse_msg(): SIP Request:
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/parser/msg_parser.c:612]: parse_msg(): method: <REGISTER>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/parser/msg_parser.c:614]: parse_msg(): uri: <sip:10.9.7.102>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/parser/msg_parser.c:616]: parse_msg(): version: <SIP/2.0>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/parser/parse_via.c:1303]: parse_via_param(): Found param type 232, <branch> = <z9hG4bK60f.6fd7c907000000000000000000000000.0>; state=16
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/parser/parse_via.c:2639]: parse_via(): end of header reached, state=5
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/parser/msg_parser.c:498]: parse_headers(): Via found, flags=2
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <core> [core/parser/msg_parser.c:500]: parse_headers(): this is the first via
Mar 24 19:09:27 kam_test kamailio[8425]: exec: *** cfgtrace:local_route=[tm:local-request] c=[/usr/local/etc/kamailio/kamailio.cfg] l=229 a=26 n=xlog
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <script>: In event_route(tm:local-request)
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: tm [uac.c:664]: send_prepared_request_impl(): uac: 0x7268e184 branch: 0 to 10.9.7.102:5060
When the timer expires, the following is logged. Since the socket is not found, the registration fails:
Mar 24 19:09:57 kam_test kamailio[8425]: DEBUG: tm [uac.c:435]: t_uac_prepare(): next_hop=<sip:10.9.7.102>
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR: <core> [core/forward.c:181]: get_out_socket(): no socket found
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR: <core> [core/forward.c:183]: get_out_socket(): no corresponding socket found for(udp:10.9.7.102:5060)
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR: tm [ut.h:316]: uri2dst2(): no corresponding socket found for "10.9.7.102" af 2 (udp:10.9.7.102:5060)
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR: tm [uac.c:463]: t_uac_prepare(): no socket found
Mar 24 19:09:57 kam_test kamailio[8425]: DEBUG: tm [h_table.c:132]: free_cell_helper(): freeing transaction 0x7268de10 from uac.c:604
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR: uac [uac_reg.c:1196]: uac_reg_update(): failed to send request for [kamailioha]
### Additional Information
version: kamailio 5.3.2 (arm6/linux)
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_BLACKLIST, 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: unknown
compiled on 17:22:05 Mar 18 2020 with gcc 8.3.0
* **Operating System**:
Linux kam_test 4.19.75-v7+ #1270 SMP Tue Sep 24 18:45:11 BST 2019 armv7l 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/2262
This bug report concerns a Kamailio instance that's functioning as an edge proxy, accepting requests from clients over TLS and forwarding them to internal components over UDP.
I've observed occasional "deadlocks" that all take place after there were connectivity issues between Kamailio and one or more of the clients (logging messages such as "tcp_send failed", "handle_tcpconn_ev(): connect x failed", "tcp_read_data(): error reading: Connection reset by peer").
Environment:
* Ubuntu 16.04
* Kamailio 5.2.7 (5.2.7+ubuntu16.04)
Relevant config:
```
# for TLS clients
socket_workers=10
listen=tls:wan.ip:TLS_PORT
# to be able to forward incoming TCP requests to UDP destinations
socket_workers=10
listen=udp:wan.ip:TLS_PORT
# for RPC commands
socket_workers=2
listen=tcp:127.0.0.1:HTTP_PORT
```
## Reproduction
After a lot of trial and error, I've found a way to somewhat reproducibly trigger the problem using sipp. It involves setting up a large amount of simultaneous calls dialing into the edge proxy using TLS, to a destination UA that will answer the call and keep it open for a few seconds, then using `ctrl-c` to suddenly quit sipp which will ungracefully terminate the TCP/TLS connections.
It takes me a couple of iterations to trigger the problem, e.g repeat until Kamailio starts failing:
* start sipp
* terminate sipp with ctrl-c
* (quickly) restart sipp
* terminate sipp
* etc
The amount of simultaneous calls has to be sufficiently large. In my environment I'm unable to reproduce the problem at all with 10-20 calls, while 50 calls always triggers the problem after a couple of iterations.
Example sipp commandline: `sipp -nd -sf caller.xml -d 2000 -r 50 -l 500 -m 5000 -max_socket 1000 -t ln -tls_cert cert.crt -tls_key key.key kamailio.edge.proxy:5061`
## Failure mode 1
In one of the failure modes, it appears that all available TCP/TLS workers are permanently bricked; sipp's calls will simply timeout and not trigger any dialplan handling.
Interestingly, even though I have dedicated workers for TLS (SIP client) and TCP (RPC commands), and my reproduction scenario doesn't connect to the HTTP_PORT at all, this failure scenario bricks the TCP (RPC) listeners as well; any curl requests to it will simply timeout as well.
Kamailio will hang for a while on (systemd) restart.
## Failure mode 2
In another failure mode, it looks like the TCP workers are unaffected but the UDP perform forwarding to UDP destinations are broken. Sipp's calls will enter Kamailio, but forwarding (`relay()`) to the next hop will timeout even though the destination is functioning just fine. Since this failure mode doesn't break RPC I was able to enable debug logging:
```
2020-07-07T17:26:58.770411+02:00 kamailio[24056]: INFO: From Customer
2020-07-07T17:26:58.770697+02:00 kamailio[24056]: DEBUG: pv [pv_trans.c:590]: tr_eval_string(): i=0 j=2
2020-07-07T17:26:58.770971+02:00 kamailio[24056]: DEBUG: dispatcher [dispatch.c:2055]: ds_manage_routes(): set [4]
2020-07-07T17:26:58.771248+02:00 kamailio[24056]: DEBUG: dispatcher [dispatch.c:2161]: ds_manage_routes(): using alg [0] hash [250849449]
2020-07-07T17:26:58.771535+02:00 kamailio[24056]: DEBUG: dispatcher [dispatch.c:2205]: ds_manage_routes(): selected [0-4-0/1] <sip:wan.ip:8065>
2020-07-07T17:26:58.771817+02:00 kamailio[24056]: DEBUG: dispatcher [dispatch.c:2226]: ds_manage_routes(): using first entry [4/1]
2020-07-07T17:26:58.772090+02:00 kamailio[24056]: DEBUG: dispatcher [dispatch.c:2269]: ds_manage_routes(): using entry [4/0]
2020-07-07T17:26:58.772362+02:00 kamailio[24056]: DEBUG: dispatcher [dispatch.c:2016]: ds_select_dst_limit(): selected target destinations: 2
2020-07-07T17:26:58.773001+02:00 kamailio[24056]: DEBUG: pv [pv_core.c:2611]: pv_set_force_sock(): trying to set send-socket to [udp:wan.ip:5061]
2020-07-07T17:26:58.773353+02:00 kamailio[24056]: DEBUG: <core> [core/socket_info.c:559]: grep_sock_info(): checking if host==us: 13==13 && [wan.ip] == [wan.ip]
2020-07-07T17:26:58.773829+02:00 kamailio[24056]: DEBUG: <core> [core/socket_info.c:566]: grep_sock_info(): checking if port 5061 (advertise 0) matches port 5061
2020-07-07T17:26:58.774122+02:00 kamailio[24056]: NOTICE: Relaying (cid: 1-9151(a)sipp.ip).
2020-07-07T17:26:58.774417+02:00 kamailio[24056]: DEBUG: siputils [checks.c:120]: has_totag(): no totag
2020-07-07T17:26:58.774708+02:00 kamailio[24056]: DEBUG: tm [t_lookup.c:1344]: t_newtran(): msg (0x7f69d1cc4980) id=1265/24056 global id=1265/24056 T start=(nil)
2020-07-07T17:26:58.774989+02:00 kamailio[24056]: DEBUG: tm [t_lookup.c:499]: t_lookup_request(): start searching: hash=43232, isACK=0
2020-07-07T17:26:58.775315+02:00 kamailio[24056]: DEBUG: tm [t_lookup.c:457]: matching_3261(): RFC3261 transaction matching failed - via branch [z9hG4bK-9151-1-1]
2020-07-07T17:26:58.775612+02:00 kamailio[24056]: DEBUG: tm [t_lookup.c:682]: t_lookup_request(): no transaction found
2020-07-07T17:26:58.775908+02:00 kamailio[24056]: DEBUG: <core> [core/md5utils.c:67]: MD5StringArray(): MD5 calculated: 0a5d4a8d13f9606523da9c4d193b2261
2020-07-07T17:26:58.776270+02:00 kamailio[24056]: DEBUG: <core> [core/dns_cache.c:3197]: dns_srv_sip_resolve(): (wan.ip, 0, 0), ip, ret=0
2020-07-07T17:26:58.776701+02:00 kamailio[24056]: DEBUG: <core> [core/msg_translator.c:1765]: check_boundaries(): no multi-part body
2020-07-07T17:26:58.777012+02:00 kamailio[24056]: DEBUG: <core> [core/msg_translator.c:2935]: create_via_hf(): id added: <;i=a701>, rcv proto=3
2020-07-07T17:26:58.777596+02:00 kamailio[24056]: DEBUG: tm [t_funcs.c:375]: t_relay_to(): new transaction forwarded
2020-07-07T17:26:58.777948+02:00 kamailio[24056]: DEBUG: <core> [core/receive.c:354]: receive_msg(): request-route executed in: 1927 usec
2020-07-07T17:26:58.778243+02:00 kamailio[24056]: DEBUG: <core> [core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)
2020-07-07T17:26:58.779265+02:00 kamailio[24056]: message repeated 5 times: [ DEBUG: <core> [core/usr_avp.c:636]: destroy_avp_list(): destroying list (nil)]
2020-07-07T17:26:58.779431+02:00 kamailio[24056]: DEBUG: <core> [core/xavp.c:507]: xavp_destroy_list(): destroying xavp list (nil)
2020-07-07T17:26:58.779753+02:00 kamailio[24056]: DEBUG: <core> [core/receive.c:458]: receive_msg(): cleaning up
2020-07-07T17:27:00.705303+02:00 kamailio[24053]: DEBUG: tm [t_reply.c:1266]: t_should_relay_response(): ->>>>>>>>> T_code=0, new_code=408
2020-07-07T17:27:00.705917+02:00 kamailio[24053]: DEBUG: tm [t_lookup.c:1041]: t_check_msg(): msg (0x7f69b1017e80) id=1264/24056 global id=1264/24056 T start=0x7f69b10167c0
2020-07-07T17:27:00.706187+02:00 kamailio[24053]: DEBUG: tm [t_lookup.c:1116]: t_check_msg(): T (0x7f69b10167c0) already found for msg (0x7f69b1017e80)!
2020-07-07T17:27:00.706533+02:00 kamailio[24053]: DEBUG: tmx [t_var.c:539]: pv_get_tm_reply_code(): reply code is <408>
2020-07-07T17:27:00.706879+02:00 kamailio[24053]: DEBUG: tm [t_lookup.c:1041]: t_check_msg(): msg (0x7f69b1017e80) id=1264/24056 global id=1264/24056 T start=0x7f69b10167c0
2020-07-07T17:27:00.707198+02:00 kamailio[24053]: DEBUG: tm [t_lookup.c:1116]: t_check_msg(): T (0x7f69b10167c0) already found for msg (0x7f69b1017e80)!
2020-07-07T17:27:00.707522+02:00 kamailio[24053]: DEBUG: tmx [t_var.c:594]: pv_get_tm_reply_reason(): reply reason is [Request Timeout]
{
"DSC": "tcp receiver (tls:wan.ip:5061) child=0",
"IDX": 14,
"PID": 24056
},
{
"DSC": "slow timer",
"IDX": 11,
"PID": 24053
},
```
Kamailio will restart (systemd) normally and everything will function normally again afterwards.
--
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/2395
#### Pre-Submission Checklist
- [ ] 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:
- [ ] PR should be backported to stable branches
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
The sig_usr() signal handler contains debug code to print memory usage and statistics that is not async-signal-safe, which can cause crashes or misbehavior. This code which only affects explicit SIGUSR1 signals on children processes, and is not guarded with the SIG_DEBUG macro.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2127
-- Commit Summary --
* core: main - Protect async-signal-unsafe code in sig_usr() with SIG_DEBUG
-- File Changes --
M src/main.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2127.patchhttps://github.com/kamailio/kamailio/pull/2127.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/2127
(from devmeeting #Fosdem) - adding new dependencies as core dependencies
- Curl
- libssl
- uuid
- libunistring
- libxml2
Any other candidates? They have to be libraries that are commonly installed on most Linux/Unix system.
This would mean that a lot of more modules will be built by default, like TLS, HTTP_CLIENT, WEBSOCKET.
We may also look over the names of the packages/groups for the build system and linux distros
--
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/969
<!--
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
Kamailio is unable to create a SCTP association to IP address that is reachable normally when dispatcher.list is configured as following:
```
760320003 sip:10.59.144.2:5063;transport=sctp 9 0 dstid=1
760320003 sip:10.59.144.130:5063;transport=sctp 9 0 dstid=1
```
10.59.144.2 and 10.59.144.130 are IPs of same endpoint treated as primary and secondary, Kamailio can't send probe (OPTIONS requests) as SCTP association can't be created.
Issue doesn't exist on RHEL/Centos 6.
### Troubleshooting
#### Reproduction
Use previously mentioned dispatcher list with changed IP addresses to match local configuration.
SCTP part of kamailio.cfg
```
# if not OS default is used
#modparam("sctp", "sctp_socket_rcvbuf", 14096)
#modparam("sctp", "sctp_socket_sndbuf", 14096)
# Number of milliseconds before an unsent message/chunk is dropped.
modparam("sctp", "sctp_send_ttl", 10000)
modparam("sctp", "sctp_autoclose", 300)
# How many times to attempt re-sending a message on a re-opened association, if the sctp stack did give up sending it (it's not related to sctp protocol level retransmission). Useful to improve reliability with peers that reboot/restart or fail over to another machine.
modparam("sctp", "sctp_send_retries", 1)
modparam("sctp", "sctp_srto_initial", 200)
modparam("sctp", "sctp_srto_max", 250)
modparam("sctp", "sctp_srto_min", 150)
modparam("sctp", "sctp_asocmaxrxt", 4)
modparam("sctp", "sctp_init_max_attempts", 3)
modparam("sctp", "sctp_init_max_timeo", 1000)
modparam("sctp", "sctp_hbinterval", 1000)
modparam("sctp", "sctp_pathmaxrxt", 2)
modparam("sctp", "sctp_sack_delay", 10)
modparam("sctp", "sctp_sack_freq", 1)
modparam("sctp", "sctp_max_burst", 4)
```
#### 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).
-->
```
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: dispatcher [dispatch.c:3234]: ds_ping_result_helper(): probing set, but not mode DS_PROBE_INACTIVE
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: dispatcher [dispatch.c:3268]: ds_ping_set(): probing set #760320003, URI sip:10.59.144.2:5063;transport=sctp
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: dispatcher [dispatch.c:3293]: ds_ping_set(): Default ping_from: sip:siplb@sdp.t-mobile.at
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: tm [uac.c:435]: t_uac_prepare(): next_hop=<sip:10.59.144.2:5063;transport=sctp>
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: <core> [core/resolve.c:1244]: srv_sip_resolvehost(): 10.59.144.2:5063 proto=4
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2281]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.130:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.130:5063: SCTP_ADDR_ADDED: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: <core> [core/resolve.c:1356]: srv_sip_resolvehost(): returning 0xa7c280 (10.59.144.2:5063 proto=4)
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: tm [uac.c:158]: dlg2hash(): hashid 27287
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2281]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.130:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.130:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2280]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.130:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.130:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: tm [uac.c:652]: send_prepared_request_impl(): uac: 0x7fbf4eb4e5b8 branch: 0 to 10.59.144.2:5063
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG: tm [../../core/onsend.h:69]: run_onsend(): required parameters are not available - ignoring
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2282]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.2:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.2:5063: SCTP_ADDR_ADDED: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2278]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.2:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.2:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2282]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.2:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.2:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2285]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.2:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.2:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2283]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.130:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.130:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2279]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.130:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.130:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2279]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.2:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.2:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:14 sdp-lbref02 /usr/sbin/kamailio[2280]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.2:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.2:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:14 sdp-lbref02 /usr/sbin/kamailio[2278]: DEBUG: sctp [sctp_server.c:2317]: sctp_handle_notification(): sctp notification from 10.59.144.130:5063 on sdp-lbref02-sigtran01:5060: SCTP_PEER_ADDR_CHANGE: 10.59.144.130:5063: SCTP_ADDR_MADE_PRIM: assoc_id 0
Aug 6 18:19:15 sdp-lbref02 /usr/sbin/kamailio[2285]: DEBUG: sctp [sctp_server.c:2340]: sctp_handle_notification(): sctp notification from 10.59.144.130:5063 on sdp-lbref02-sigtran01:5060: SCTP_ASSOC_CHANGE: SCTP_CANT_STR_ASSOC: assoc_id 0, ostreams 0, istreams 0
Aug 6 18:19:15 sdp-lbref02 /usr/sbin/kamailio[2282]: DEBUG: sctp [sctp_server.c:2340]: sctp_handle_notification(): sctp notification from 10.59.144.2:5063 on sdp-lbref02-sigtran01:5060: SCTP_ASSOC_CHANGE: SCTP_CANT_STR_ASSOC: assoc_id 0, ostreams 0, istreams 0
Aug 6 18:19:15 sdp-lbref02 /usr/sbin/kamailio[2285]: DEBUG: sctp [sctp_server.c:2299]: sctp_handle_notification(): sctp notification from 10.59.144.2:5063 on sdp-lbref02-sigtran01:5060: SCTP_SEND_FAILED: error 0, assoc_id 0, flags 0
Aug 6 18:19:15 sdp-lbref02 /usr/sbin/kamailio[2285]: DEBUG: sctp [sctp_server.c:2098]: sctp_handle_send_failed(): sctp: RETRY-ing (1)
```
#### 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.
-->
Issue is gone when one of IP addresses is removed from dispatcher.list.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
kamailio -v
version: kamailio 5.3.5 (x86_64/linux) 9e70e8
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_BLACKLIST, 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: 9e70e8
compiled on 12:22:26 Jun 22 2020 with gcc 8.3.1
```
Also tested latest 5.2 and 5.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@sdp-lbref02 ~]# uname -a
Linux sdp-lbref02 4.18.0-193.14.3.el8_2.x86_64 #1 SMP Mon Jul 20 15:02:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@sdp-lbref02 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.2 (Ootpa)
```
--
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/2429