<p></p>
<h3>Description</h3>
<p>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.</p>
<h4>Reproduction</h4>
<p>The network is configured for two addresses: 10.9.9.121/24 and 10.9.7.121/24.</p>
<p>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.</p>
<p>MySQL database has a user in the uacreg table with the socket column set to udp:10.9.7.120:5060.</p>
<p>kamailio.cfg includes the following to enable sending of REGISTER messages:</p>
<p>mhomed = 1<br>
listen=udp:10.9.9.120<br>
listen=udp:10.9.7.120</p>
<p>#!define DBURL "mysql://kamailio:kamailiorw@10.9.9.101/kamailio"</p>
<p>modparam("rr", "append_fromtag", 1);<br>
modparam("uac", "reg_db_url", DBURL);<br>
modparam("uac", "reg_contact_addr", "10.9.7.120:5060");<br>
modparam("uac", "reg_keep_callid", 1);<br>
modparam("uac", "default_socket", "udp:10.9.7.120:5060");<br>
modparam("uac", "reg_timer_interval", 30);</p>
<h4>Log Messages</h4>
<p>The initial REGISTER outputs the following log data.  The registration completes successfully.</p>
<p>Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: uac [uac.c:407]: child_init(): run initial uac registration routine<br>
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<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/socket_info.c:628]: grep_sock_info(): checking if host==us: 10==10 && [10.9.7.120] == [10.9.9.120]<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/socket_info.c:635]: grep_sock_info(): checking if port 5060 (advertise 0) matches port 5060<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/socket_info.c:628]: grep_sock_info(): checking if host==us: 10==10 && [10.9.7.120] == [10.9.7.120]<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/socket_info.c:635]: grep_sock_info(): checking if port 5060 (advertise 0) matches port 5060<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: tm [uac.c:435]: t_uac_prepare(): next_hop=sip:10.9.7.102<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: tm [uac.c:158]: dlg2hash(): hashid 3846<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: tm [uac.c:244]: t_run_local_req(): executing event_route[tm:local-request]<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/parser/msg_parser.c:610]: parse_msg(): SIP Request:<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/parser/msg_parser.c:612]: parse_msg():  method:  <br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/parser/msg_parser.c:614]: parse_msg():  uri:     sip:10.9.7.102<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/parser/msg_parser.c:616]: parse_msg():  version: <SIP/2.0><br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/parser/parse_via.c:1303]: parse_via_param(): Found param type 232,  = <z9hG4bK60f.6fd7c907000000000000000000000000.0>; state=16<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/parser/parse_via.c:2639]: parse_via(): end of header reached, state=5<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/parser/msg_parser.c:498]: parse_headers(): Via found, flags=2<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG:  [core/parser/msg_parser.c:500]: parse_headers(): this is the first via<br>
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<br>
Mar 24 19:09:27 kam_test kamailio[8425]: DEBUG: <script>: In event_route(tm:local-request)<br>
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</p>
<p>When the timer expires, the following is logged.  Since the socket is not found, the registration fails:</p>
<p>Mar 24 19:09:57 kam_test kamailio[8425]: DEBUG: tm [uac.c:435]: t_uac_prepare(): next_hop=sip:10.9.7.102<br>
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR:  [core/forward.c:181]: get_out_socket(): no socket found<br>
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR:  [core/forward.c:183]: get_out_socket(): no corresponding socket found for(udp:10.9.7.102:5060)<br>
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)<br>
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR: tm [uac.c:463]: t_uac_prepare(): no socket found<br>
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<br>
Mar 24 19:09:57 kam_test kamailio[8425]: ERROR: uac [uac_reg.c:1196]: uac_reg_update(): failed to send request for [kamailioha]</p>
<h3>Additional Information</h3>
<p>version: kamailio 5.3.2 (arm6/linux)<br>
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<br>
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>
id: unknown<br>
compiled on 17:22:05 Mar 18 2020 with gcc 8.3.0</p>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>
<p>Linux kam_test 4.19.75-v7+ <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="264838103" data-permission-text="Title is private" data-url="https://github.com/kamailio/kamailio/issues/1270" data-hovercard-type="issue" data-hovercard-url="/kamailio/kamailio/issues/1270/hovercard" href="https://github.com/kamailio/kamailio/issues/1270">#1270</a> SMP Tue Sep 24 18:45:11 BST 2019 armv7l GNU/Linux</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2262">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZM7QGQH7ZLLLUVYNHDRJELVPANCNFSM4LS7E3CQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZOJ7ZN6V52URBQKGQDRJELVPA5CNFSM4LS7E3C2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IYA74RQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2262",
"url": "https://github.com/kamailio/kamailio/issues/2262",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>