<p></p>

<h3 dir="auto">Description</h3>

<p dir="auto">module: tm<br>
kemi proto relay functions fails on TLS:</p>
<ul dir="auto">
<li>ki_t_relay_to_proto</li>
<li>ki_t_relay_to_proto_addr</li>
</ul>
<h3 dir="auto">Troubleshooting</h3>
<h4 dir="auto">Reproduction</h4>

<h4 dir="auto">Debugging Data</h4>

<pre class="notranslate"><code class="notranslate"></code></pre>
<h4 dir="auto">Log Messages</h4>

<pre class="notranslate"><code class="notranslate">13(19) ERROR: {1 1 REGISTER 184193281845942-18001879945554@192.168.1.135} tm [tm.c:2934]: ki_t_relay_to_proto(): bad protocol specified <TLS>
13(19) ERROR: {1 1 REGISTER 184193281845942-18001879945554@192.168.1.135} sl [sl_funcs.c:414]: sl_reply_error(): stateless error reply used: I'm terribly sorry, server error occurred (1/SL)
</code></pre>
<h4 dir="auto">SIP Traffic</h4>

<pre class="notranslate"><code class="notranslate">(paste your sip traffic here)
</code></pre>
<h3 dir="auto">Possible Solutions</h3>

<p dir="auto">It's missing an equal zero (== 0) on TLS test.<br>
Code: tm.c</p>
<pre class="notranslate"><code class="notranslate">   if (strncasecmp(sproto->s, "UDP", 3) == 0) { 
        proto = PROTO_UDP;
    } else if (strncasecmp(sproto->s, "TCP", 3) == 0) { 
        proto = PROTO_TCP;
    } else if (strncasecmp(sproto->s, "TLS", 3)) {
        proto = PROTO_TLS;
    } else {
        LM_ERR("bad protocol specified <%s>\n", sproto->s);
        return E_UNSPEC;
    }
</code></pre>
<p dir="auto">Fix:</p>
<pre class="notranslate"><code class="notranslate">   if (strncasecmp(sproto->s, "UDP", 3) == 0) { 
        proto = PROTO_UDP;
    } else if (strncasecmp(sproto->s, "TCP", 3) == 0) { 
        proto = PROTO_TCP;
    } else if (strncasecmp(sproto->s, "TLS", 3) == 0) {
        proto = PROTO_TLS;
    } else {
        LM_ERR("bad protocol specified <%s>\n", sproto->s);
        return E_UNSPEC;
    }
</code></pre>
<h3 dir="auto">Additional Information</h3>
<ul dir="auto">
<li><strong>Kamailio Version</strong> - output of <code class="notranslate">kamailio -v</code></li>
</ul>
<pre class="notranslate"><code class="notranslate">version: kamailio 5.5.0 (x86_64/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_BLOCKLIST, HAVE_RESOLV_RES
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 with gcc 4.9.2
</code></pre>
<ul dir="auto">
<li><strong>Operating System</strong>:</li>
</ul>

<pre class="notranslate"><code class="notranslate">No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.11 (jessie)
Release:        8.11
Codename:       jessie

Linux routersip 4.18.0-348.el8.0.2.x86_64 #1 SMP Sun Nov 14 00:51:12 UTC 2021 x86_64 GNU/Linux
</code></pre>

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