Re: [sr-dev] [kamailio/kamailio] Wrong return code used by sl_reply_error() (#2802)

2021-07-26 Thread Piotr Grabowski
Please have a look at 
https://www.kamailio.org/docs/modules/devel/modules/outbound.html "Example 1.1. 
Edge Proxy Configuration" it uses exact same syntax. If expected behaviour is 
that any statement can affect sl_reply_error() then this example needs updating.

-- 
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/2802#issuecomment-886860352___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Wrong return code used by sl_reply_error() (#2802)

2021-07-26 Thread Piotr Grabowski
Hi @miconda . I think you misunderstood bug here. Issue is that if and switch 
statements change behaviour of sl_send_error(). Same examples as configuration 
from this bug report are in Kamailio documentation so it looks like a bug, if 
not maybe documentation needs an update.

-- 
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/2802#issuecomment-886826241___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Support SCTP associations created towards same endpoint primary and secondary IP addresses on RHEL/Centos 8 (#2429)

2020-09-09 Thread Piotr Grabowski
FYI we had issue with other application using SCTP on RHEL 8.2 the result it 
that there will be a fix in Linux kernel shipped with RHEL.

https://github.com/netty/netty/issues/10455


-- 
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#issuecomment-689786931___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] Kamailio on RHEL/Centos 8 issue with SCTP associations created towards endpoint's primary and secondary IP addresses (#2429)

2020-08-06 Thread Piotr Grabowski


### 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", 1)
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



```
(paste your debugging data here)
```

 Log Messages



```
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:si...@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=
Aug  6 18:19:13 sdp-lbref02 /usr/sbin/kamailio[2294]: DEBUG:  
[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/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]: DE

Re: [sr-dev] [kamailio/kamailio] Dispatcher module and $dp variable used to overwrite $rp (#2258)

2020-03-19 Thread Piotr Grabowski
Closed #2258.

-- 
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/2258#event-3145145576___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] Dispatcher module and $dp variable used to overwrite $rp (#2258)

2020-03-19 Thread Piotr Grabowski
Fix is working.

```
/usr/local/sbin/kamailio[7421]: ERROR: 

Re: [sr-dev] [kamailio/kamailio] Dispatcher module and $dp variable used to overwrite $rp (#2258)

2020-03-19 Thread Piotr Grabowski
Thanks a lot for fast patch. I will test it today.

-- 
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/2258#issuecomment-601106596___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


[sr-dev] [kamailio/kamailio] Dispatcher module and $dp variable used to overwrite $rp (#2258)

2020-03-19 Thread Piotr Grabowski
### Description

When using dispatcher module to select destination we didn't configure explicit 
port:

```
sh-4.1# cat /etc/kamailio/dispatcher.list
# $Id$
# dispatcher destination sets
#

# line format
# setit(int) destination(sip uri) flags(int,opt) priority(int,opt) 
attributes(str,opt)
1 sip:127.0.0.1 0 0
```

When we try to rewrite port in R-URI as in following configuration:

```
sh-4.1# cat /etc/kamailio/kamailio.cfg
#!KAMAILIO
#

debug=3
sip_warning=yes
port=5060

mpath="/usr/lib64/kamailio/modules/"

loadmodule "pv.so"
loadmodule "xlog.so"
loadmodule "dispatcher.so"

modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")

route {
   ds_select_dst("1", "4");
   xlog("will update <$ru>");
   xlog("changing $rd to $dd\n");
   $rd = $dd;
   xlog("changing $rp to $dp\n");
   $rp = $dp;
   xlog("final RURI is <$ru>");
   exit;
}
```

Kamailio crashes on line:
```
   $rp = $dp;
```

Interesting thing is that we get port on previous line (see attached log).

### Troubleshooting

 Reproduction

Use provided configuration and dispatcher.list file and send any SIP request 
message to Kamailio.


 Debugging Data



```
sh-4.1# gdb /usr/sbin/kamailio  /core
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-92.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/sbin/kamailio...Reading symbols from 
/usr/lib/debug/usr/sbin/kamailio.debug...done.
done.
[New Thread 25]
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libresolv.so.2...(no debugging symbols 
found)...done.
Loaded symbols for /lib64/libresolv.so.2
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols 
found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib64/kamailio/modules/pv.so...Reading symbols from 
/usr/lib/debug/usr/lib64/kamailio/modules/pv.so.debug...done.
done.
Loaded symbols for /usr/lib64/kamailio/modules/pv.so
Reading symbols from /usr/lib64/kamailio/libsrutils.so.1...Reading symbols from 
/usr/lib/debug/usr/lib64/kamailio/libsrutils.so.1.0.debug...done.
done.
Loaded symbols for /usr/lib64/kamailio/libsrutils.so.1
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /usr/lib64/kamailio/modules/xlog.so...Reading symbols from 
/usr/lib/debug/usr/lib64/kamailio/modules/xlog.so.debug...done.
done.
Loaded symbols for /usr/lib64/kamailio/modules/xlog.so
Reading symbols from /usr/lib64/kamailio/modules/dispatcher.so...Reading 
symbols from 
/usr/lib/debug/usr/lib64/kamailio/modules/dispatcher.so.debug...done.
done.
Loaded symbols for /usr/lib64/kamailio/modules/dispatcher.so
Reading symbols from /usr/lib64/kamailio/libsrdb1.so.1...Reading symbols from 
/usr/lib/debug/usr/lib64/kamailio/libsrdb1.so.1.0.debug...done.
done.
Loaded symbols for /usr/lib64/kamailio/libsrdb1.so.1
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols 
found)...done.
Loaded symbols for /lib64/libnss_files.so.2

warning: no loadable sections found in added symbol-file system-supplied DSO at 
0x7ffe573ea000
Core was generated by `/usr/sbin/kamailio -DD -E'.
Program terminated with signal 11, Segmentation fault.
#0  0x7f52b624785b in pv_set_ruri_port (msg=0x7f52b65860c8, 
param=0x7f52b6564af8, op=254, val=0x7ffe572d2ac0) at pv_core.c:2561
2561val->rs.s[val->rs.len] = '\0';
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.212.el6.x86_64
(gdb) bt full
#0  0x7f52b624785b in pv_set_ruri_port (msg=0x7f52b65860c8, 
param=0x7f52b6564af8, op=254, val=0x7ffe572d2ac0) at pv_core.c:2561
act = {cline = 0, cfile = 0x0, rname = 0x0, type = 0, count = 0, next = 
0x0, val = {{type = STRING_ST, u = {number = 139993220313123, string = 
0x7f52b62af023 "5060", str = {s = 0x7f52b62af023 "5060", len = 0},
data = 0x7f52b62af023, attr = 0x7f52b62af023, select = 
0x7f52b62af023}}, {type = NOSUBTYPE, u = {number = 0, string = 0x0, str = {s = 
0x0, len = 0}, data = 0x0, attr = 0x0, select = 0x0}}, {type = NOSUBTYPE, u = {
number = 0, string = 0x0, str = {s = 0x0, len = 0}, data = 0x0, 
attr = 0x0, select = 0x0}}, {type = NOSUBTYPE, u = {number = 0, string = 0x0, 
str = {s = 0x0, len = 0}, data = 0x0, attr = 0x0, select = 0x0}}, {
  type = NOSUBTYPE, u = {number = 0, string = 0x0, str = {s = 0x0, 
len = 0}, data = 0x0, attr = 0x0