I noticed that sometimes the trunk registration just fails after TTL expiry and the kamailio tries to resolve an A record for next_hop=sip:reg.sip-trunk.telekom.de:5060;transport=tcp where actually no A record exists resulting in an unregistered trunk for one register period. After the one failed period the SRV will result in correct CNAME resolving again and the trunk will be registered for one full hour (baes on TTL expiry of SRV record).
``` Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: uac [uac_reg.c:1138]: uac_reg_send(): using custom socket tcp:10.124.2.2:5060 to send request Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/socket_info.c:702]: grep_sock_info(): checking if host==us: 10==10 && [10.124.2.2] == [10.124.2.2] Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/socket_info.c:709]: grep_sock_info(): checking if port 5060 (advertise 5060) matches port 5060 Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: tm [h_table.c:580]: tm_xdata_replace(): replace existing list in backup xd from new xd Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: tm [h_table.c:413]: build_cell(): created new cell 0x7fc7766aa400 Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: tm [h_table.c:568]: tm_xdata_replace(): restore X/AVP msg context from backup data Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: tm [uac.c:468]: t_uac_prepare(): next_hop=sip:reg.sip-trunk.telekom.de:5060;transport=tcp Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/dns_cache.c:534]: _dns_hash_find(): (_sip._tcp.reg.sip-trunk.telekom.de(34), 33), h=666 Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/resolve.c:999]: get_record(): skipping 0 NS (p=0x560cf3e135dc, end=0x560cf3e135dc) Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/resolve.c:1012]: get_record(): parsing 0 ARs (p=0x560cf3e135dc, end=0x560cf3e135dc) Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/dns_cache.c:1640]: dns_get_related(): (0x7fc7766f9ab8 (_sip._tcp.reg.sip-trunk.telekom.de, 33), 33, *(nil)) (0) Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/dns_cache.c:746]: dns_cache_add_unsafe(): adding _sip._tcp.reg.sip-trunk.telekom.de(34) 33 (flags=0) at 666 Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/dns_cache.c:534]: _dns_hash_find(): (reg.sip-trunk.telekom.de(24), 1), h=400 Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/resolve.c:784]: get_record(): lookup(reg.sip-trunk.telekom.de, 1) failed Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/dns_cache.c:768]: dns_cache_mk_bad_entry(): (reg.sip-trunk.telekom.de, 1, 60, 1) Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: <core> [core/dns_cache.c:708]: dns_cache_add(): adding reg.sip-trunk.telekom.de(24) 1 (flags=1) at 400 Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: ERROR: <core> [core/resolve.c:1730]: sip_hostport2su(): could not resolve hostname: "reg.sip-trunk.telekom.de" Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: ERROR: tm [ut.h:309]: uri2dst2(): failed to resolve "reg.sip-trunk.telekom.de" Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: ERROR: tm [uac.c:491]: t_uac_prepare(): no socket found Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: DEBUG: tm [h_table.c:132]: free_cell_helper(): freeing transaction 0x7fc7766aa400 from uac.c:632 Aug 21 16:55:57 seelze-iptel1 kamailio[4116711]: ERROR: uac [uac_reg.c:1178]: uac_reg_send(): failed to send request for [siptrunk] ``` At this point it should not try to resolve reg.sip-trunk.telekom.de but instead one of the SRV CNAMES.
It seams to work properly when using ``` dns_try_naptr = on use_dns_failover = on dns_srv_lb = on use_dns_cache = on ``` `use_dns_failover` especially was off so a negative A entry was tried and failed. Will let it run for more time but seams top work.
It looks like the kamailio tries the non existing A record and than immediately stops on the broken record causing a de-register.
is there a reason why use_dns_failover is disabled by default?
Closed #3547 as completed.
If port is provided, then no SRV is done, that's its role.
Anyhow, this tracker is for reporting issues in the C code of kamailio, for questions/discussions about using/configuring kamailio, use sr-users@lists.kamailio.org mailing list.