**core/ut.h:751**
```
core/ut.h:751:13: warning: ‘shm_str_dup_block’ defined but not used [-Wunused-function]
static str* shm_str_dup_block(const str* src)
^~~~~~~~~~~~~~~~~
CC (gcc) [kamailio] core/proxy.o
In file included from core/ip_addr.h:39,
from core/proxy.h:32,
from core/proxy.c:33:
```
--
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/2611
### 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
<!-- 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 -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] 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
- [x] 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 -->
I found that zero servers are being logged, even though they are (ignore the line numbers, the file is slightly modified):
```
0(15681) DEBUG: dispatcher [dispatch.c:919]: ds_load_list(): found [0] dest sets
0(15681) DEBUG: dispatcher [dispatch.c:222]: ds_log_dst_cb(): dst>> 1031 sip:127.0.0.1:5182 0 0 (,0,0,0)
0(15681) DEBUG: dispatcher [dispatch.c:222]: ds_log_dst_cb(): dst>> 1011 sip:127.0.0.1:5180 0 0 (,0,0,0)
0(15681) DEBUG: dispatcher [dispatch.c:222]: ds_log_dst_cb(): dst>> 1021 sip:127.0.0.1:5181 0 0 (,0,0,0)
```
Therefore, I moved the logging of the dest sets after updating variable and this fixed the error.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2609
-- Commit Summary --
* dispatcher: Log dest sets after variable update
-- File Changes --
M src/modules/dispatcher/dispatch.c (8)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2609.patchhttps://github.com/kamailio/kamailio/pull/2609.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/2609