pres_htable_restore(): Remove check of expired presentity entries when
initially filling the hash table to represent the number of expired +
valid entries. Because hash.c::delete_phtable() decrements publ_count on
removal of _every_ expired DB entry.
get_p_notify_body(): Compensate the fix on hash table restore by
checking for the expires time on building the NOTIFY. This also fixes a
problem when a SUBSCRIBE is received for an expired entry before the
cleaner can remove the entry from the DB.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/809
-- Commit Summary --
* Presence: Fix startup inconsistency in presentity hash table
-- File Changes --
M modules/presence/notify.c (17)
M modules/presence/presentity.c (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/809.patchhttps://github.com/kamailio/kamailio/pull/809.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/809
When doing a dispatcher reload with kamcmd kamailio crashes.
```
# kamailio -v
version: kamailio 5.0.0-dev6 (x86_64/freebsd) 276ccc
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, 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, select, kqueue.
id: 276ccc
compiled on 17:39:46 Sep 29 2016 with clang 3.4
```
```
#0 0x00000008098d32c3 in ds_avl_destroy (node_ptr=0x809ed2b40) at dispatch.c:3046
3046 if(dest->uri.s!=NULL)
[New Thread 80286b400 (LWP 100148/<unknown>)]
(gdb) bt
#0 0x00000008098d32c3 in ds_avl_destroy (node_ptr=0x809ed2b40) at dispatch.c:3046
#1 0x00000008098d95cb in ds_destroy_list () at dispatch.c:1000
#2 0x0000000809911ead in destroy () at dispatcher.c:593
#3 0x0000000000508345 in destroy_modules () at sr_module.c:811
#4 0x0000000000517ff7 in cleanup (show_status=1) at main.c:526
#5 0x000000000052011c in shutdown_children (sig=15, show_status=1) at main.c:668
#6 0x000000000051f094 in handle_sigs () at main.c:760
#7 0x0000000000530859 in main_loop () at main.c:1748
#8 0x000000000053b530 in main (argc=15, argv=0x7fffffffeb38) at main.c:2632
Current language: auto; currently minimal
```
```
Nov 3 10:10:17 <local0.info> kamailio[43234]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43233]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43232]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43231]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43230]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43228]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43227]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43226]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43225]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43224]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.info> kamailio[43229]: INFO: <core> [main.c:811]: sig_usr(): signal 15 received
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43233 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43234 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43232 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43231 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43230 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43229 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43228 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43227 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43226 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43225 exited normally, status=0
Nov 3 10:10:17 <local0.alert> kamailio[43223]: ALERT: <core> [main.c:738]: handle_sigs(): child process 43224 exited normally, status=0
Nov 3 10:10:17 <local0.info> kamailio[43223]: INFO: <core> [main.c:756]: handle_sigs(): terminating due to SIGCHLD
```
--
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/846
Hi All.
After some try to configure kamailio 4.4.3 to act as SPI TLS client for Cisco SIP TLS gateways I have found one issue.
If I do client configuration for tls
[client:10.1.23.19:5061]
verify_certificate = yes
ca_list = /etc/kamailio/CAs/ca1.pem
[client:10.1.23.29:5061]
verify_certificate = yes
ca_list = /etc/kamailio/CAs/ca2.pem
[client:default]
verify_certificate = no
require_certificate = no
Kamailo always do default profile selection (I do configuration without server_name or server_id, with it kamailio works fine but there are some troubles to make selection of this parameters from
config script, I need additional checks and queries)
after some research in tls module source code I have added some debug information in file tls_server.c:
```
if (c->flags & F_CONN_PASSIVE) {
state=S_TLS_ACCEPTING;
dom = tls_lookup_cfg(cfg, TLS_DOMAIN_SRV,
&c->rcv.dst_ip, c->rcv.dst_port, 0, 0);
} else {
state=S_TLS_CONNECTING;
sname = tls_get_connect_server_name();
srvid = tls_get_connect_server_id();
// -------------------------------------------------------------
DBG("Entered client config loockup (c->rcv.dst_port %d)\n", c->rcv.dst_port);
DBG("Entered client config loockup (&c->rcv.dst_ip %s)\n", ip_addr2a(&c->rcv.dst_ip));
DBG("Entered client config loockup (c->rcv.src_port %d)\n", c->rcv.src_port);
DBG("Entered client config loockup (&c->rcv.src_ip %s)\n", ip_addr2a(&c->rcv.src_ip));
// -------------------------------------------------------------
dom = tls_lookup_cfg(cfg, TLS_DOMAIN_CLI,
&c->rcv.dst_ip, c->rcv.dst_port, sname, srvid);
}
```
After making a test call:
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: <core> [parser/msg_parser.c:597]: parse_msg(): method: <INVITE>
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: <core> [parser/msg_parser.c:599]: parse_msg(): uri: <sip:9098@10.1.23.19:5061;transport=TLS>
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: <core> [parser/msg_parser.c:601]: parse_msg(): version: <SIP/2.0>
I see:
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: <core> [ip_addr.c:229]: print_ip(): tcpconn_new: new tcp connection: 10.1.23.19
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: <core> [tcp_main.c:985]: tcpconn_new(): on port 5061, type 3
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: <core> [tcp_main.c:1295]: tcpconn_add(): hashes: 1394:0:0, 1
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_server.c:197]: tls_complete_init(): completing tls connection initialization
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_server.c:160]: tls_get_connect_server_name(): xavp with outbound server name not found
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_server.c:140]: tls_get_connect_server_id(): xavp with outbound server id not found
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_server.c:219]: tls_complete_init(): Entered client config loockup (c->rcv.dst_port 40123)
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_server.c:220]: tls_complete_init(): Entered client config loockup (&c->rcv.dst_ip 10.1.23.23)
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_server.c:221]: tls_complete_init(): Entered client config loockup (c->rcv.src_port 5061)
Oct 26 09:23:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_server.c:222]: tls_complete_init(): Entered client config loockup (&c->rcv.src_ip 10.1.23.19)
Where:
**&c->rcv.dst_ip 10.1.23.23** - it is my local kamailio tls socket ip address to make tls connect from
**c->rcv.dst_port 40123** - it is my local kamailio tls socket port
**&c->rcv.src_ip 10.1.23.19** - ip of my TLS device to make tls connection to
**c->rcv.src_port 5061** - port of my TLS device to make tls connection to
so if I change line
```
dom = tls_lookup_cfg(cfg, TLS_DOMAIN_CLI,
&c->rcv.dst_ip, c->rcv.dst_port, sname, srvid);
to
```
```
dom = tls_lookup_cfg(cfg, TLS_DOMAIN_CLI,
&c->rcv.src_ip, c->rcv.src_port, sname, srvid);
```
I got correct client domain selection from tls.cfg:
Oct 26 09:33:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_server.c:233]: tls_complete_init(): Using initial TLS domain TLSc<10.1.23.19:5061> (dom 0x7fd2eefa3d68 ctx 0x7fd2ef7e70a8 sn [])
Oct 26 09:33:56 sip1 /usr/sbin/kamailio[20712]: DEBUG: tls [tls_domain.c:703]: sr_ssl_ctx_info_callback(): SSL handshake started
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/842
-- Commit Summary --
* Merge pull request #3 from kamailio/master
* modules/tls: fix TLS client config selection based on dst ip and port
-- File Changes --
M modules/tls/tls_server.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/842.patchhttps://github.com/kamailio/kamailio/pull/842.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/842