I have 3 registrars being replicated to each other using dmq_usrloc. These registrars sit behind proxy servers. I use the path header to specify the received address. When the nathelper module is enabled, the nathelper then sends keep alive options messages from all three registrars for the same contact instead of the node that processed the original registration.
I am using in-memory replication (db_mode = 0), so the server_id core parameter does not seem to be taking affect for in-memory replication, i believe this is only for database mode only. I currently have server_id set differently for each registrar, to no effect.
nathelper module configuration parameters are as follows:
``` modparam("nathelper", "natping_interval", 20) modparam("nathelper", "natping_processes", 4) modparam("nathelper", "ping_nated_only", 1) modparam("nathelper", "sipping_from", "sip:keepalive@domain.com") modparam("nathelper", "sipping_method", "OPTIONS") modparam("nathelper", "force_socket", NAT_PING_SOCKET) ```
NAT_PING_SOCKET is set to the local interface of each registrar where I want the message to originate from:
``` # Registrar01 #!define NAT_PING_SOCKET "10.7.0.170:5060" # Registrar02 #!define NAT_PING_SOCKET "10.7.0.171:5060" # Registrar03 #!define NAT_PING_SOCKET "10.7.0.172:5060" ```
server_id is set for each registrar
``` # Registrar01 server_id=001 # Registrar02 server_id=002 # Registrar03 server_id=003 ```
I noticed that when the force_socket is set and a registration is sent from a node that did not process the request, then an options messages is sent via the forced_socket but the originating IP is that of the primary interface of the node, in this case, the kamailio listening address on the 10.6.0.0/24 segment, and example message follows:
``` 12:42:13.320519 00:50:56:91:5e:77 > 00:50:56:91:64:fe, ethertype IPv4 (0x0800), length 455: (tos 0x60, ttl 64, id 62009, offset 0, flags [none], proto UDP (17), length 441) 10.6.0.170.sip > 10.7.0.109.sip: [udp sum ok] SIP, length: 413 OPTIONS sip:subscriber01@172.16.0.138:5060;alias=78.143.152.30~49233~1 SIP/2.0 Via: SIP/2.0/UDP 10.6.0.170:5060;branch=0 Route: sip:10.7.0.109;lr;received=sip:78.143.152.30:49233 From: sip:keepalive@domain.com;tag=uloc-3-55e0473b-1503-af38-6cf5fbae-864c1976 To: sip:subscriber01@172.16.0.138:5060;alias=78.143.152.30~49233~1 Call-ID: 9f855711-a24ef866-112a3d5@10.6.0.170 CSeq: 1 OPTIONS Content-Length: 0 ```
The MAC address above confirms that the sending interface is that of force_socket for nathelper, but the source IP address is that of the primary interface of the registrar.
This results in martian source messages on the target proxy server:
``` Aug 31 12:42:13 proxy01 kernel: martian source 10.7.0.109 from 10.6.0.170, on dev eth1 Aug 31 12:42:13 proxy01 kernel: ll header: 00:50:56:91:64:fe:00:50:56:91:5e:77:08:00 ```
I suspect the latter issue (martian source) will resolve itself if the registrar not processing the registration stops sending nathelper keep alive messages for contacts it did not itself process.
Please let me know if you require any additional information from me to debug this issue further.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310
Kamailio version:
``` # kamailio -v version: kamailio 4.3.1 (x86_64/linux) f38e67 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, F_MALLOC, DBG_F_MALLOC, USE_FUTEX, 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, epoll_lt, epoll_et, sigio_rt, select. id: f38e67 compiled on 15:01:49 Aug 26 2015 with gcc 4.4.7 ```
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310#issuecomment-136349472
Just a friendly reminder of this issue.
Could this be a configuration issue or is this indeed a bug?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310#issuecomment-138458007
I missed this originally and although I've not looked closely at it yet, a quick alternative might be to use the nat_traversal module's keepalive mechanism instead, directly on the edge proxies. Works for us at least.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310#issuecomment-138500280
Filtering by server id is available only on devel version, as I could see in the sources. You have to set parameter filter_server_id for nathelper module to 1.
With this occasion I noticed that filter_server_id is not documented in nathelper module readme - @linuxmaniac forgot to do it, I guess, he pushed this feature.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310#issuecomment-138543481
Mea culpa!
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310#issuecomment-138544758
Hi All,
Thanks for the responses, does this mean that I cannot run the server id filtering with kamailio v4.3.x? Or am I miss-understanding you and I need to enable filter_server_id parameter in config to use the server id as a filter rule in kamailio v4.3.x?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310#issuecomment-138549101
The feature is not in 4.3.x, you can't enable it there based on my check to source code -- it was added after the release of 4.3.0. It might work by just getting the usrloc, registrar and nathelper modules from master branch and overwrite those in 4.3.x branch.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310#issuecomment-139501542
Closed #310.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/310#event-439225261