<p></p>
<p>The $rs is for incoming SIP reply processing, no relation with tm or dialog module and I would keep it like that.</p>
<p>If event_route[dialog:failed] happens in the context of transmission error and the transaction fails, then you should be able to use $T(reply_code). So it should provide what you look for in this particular case.</p>
<p>Otherwise, event_route[dialog:failed] can be also executed with an internal faked msg, if it happens to be executed when no SIP traffic is handled.</p>
<p>You can eventually add a new attribute for $dlg_ctx():</p>
<ul>
<li><a href="https://www.kamailio.org/wiki/cookbooks/5.5.x/pseudovariables#dlg_ctx_attr" rel="nofollow">https://www.kamailio.org/wiki/cookbooks/5.5.x/pseudovariables#dlg_ctx_attr</a></li>
</ul>
<p>And you set its value based on whether a reply was received from the network, transaction failed and value of $T(reply_code) should be used, etc.</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#issuecomment-938443325">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZIBMMKYYFCIKOPZWKDUF2STJANCNFSM5FE3ULCA">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/ABO7UZJN7WA23QV435VESB3UF2STJA5CNFSM5FE3ULCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG7XYEPI.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#issuecomment-938443325",
"url": "https://github.com/kamailio/kamailio/issues/2867#issuecomment-938443325",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>