<p></p>
<h3>Description</h3>
<p>I use TCP transport to relay SIP messages.<br>
When Kamailio cannot connect to another server then Kamailio generates response <code>408 Request Timeout</code>.<br>
inside <code>event_route[dialog:failed]</code> route block I check error code <code>$rs</code> but this value is <code>null</code>.<br>
This happens because Kamailio does not able to relay SIP messages and is not able to receive responses.<br>
But <code>tm</code> module generates a response <code>408 Request Timeout</code> and will be fine to init <code>$rs</code> pseudo-variable using tm module response.</p>
<h3>Expected behavior</h3>
<p><code>$rs</code> pseudo-variable contains <code>tm</code> module response when kamailio does not receive a response from another server.</p>
<h4>Actual observed behavior</h4>
<p><code>$rs</code> pseudo-variable contains <code>null</code> value when kamailio does not receive a response from another server.</p>
<p>To check you can use</p>
<pre><code>event_route[dialog:failed]
{
    $var(code_xxx) = $(rs{re.subst,/([0-9])[0-9]{2}/\1xx/});
    xlog("L_INFO", "websocket|log|dialog failed $rs; $var(code_xxx)\n");
}
</code></pre>
<p>And relay SIP message to host that reachable.</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/2867">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMP4SYLHW7OLK7NSBDUEXC5RANCNFSM5FE3ULCA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABO7UZIFFRYHXHGJUSLTOP3UEXC5RA5CNFSM5FE3ULCKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4PDH3FOQ.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/2867",
"url": "https://github.com/kamailio/kamailio/issues/2867",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>