<p></p>
<p>Adding another comment from the mailing list:</p>
<blockquote>
<p>The SIP code 503 is tricky in the sense that i can indicate either server maintenance or server overload. In both cases it can send Retry-After header and any subsequent requests from same source are ignored for the duration of Retry-After interval. [1].</p>
<p>Additionally RFC3261 and RFC3263 define that transport failures (generally due to fatal ICMP errors in UDP and connection failures in TCP) should be treated as 503 response. [2].</p>
<p>So in all above cases, it is most likely that dialog does not establishes at all and 503 response is treated similar to stateless response. Therefore, a to-tag can be added/replaced before sending it to UAC.</p>
<p>Theoretically, kamailio should check and use to-tag from 503 response when converting it to 500 response and only create new to-tag if it is absent.</p>
<p>References:</p>
<p>[1] <a href="https://tools.ietf.org/html/rfc3261#section-21.5.4" rel="nofollow">https://tools.ietf.org/html/rfc3261#section-21.5.4</a></p>
<p>[2] <a href="https://tools.ietf.org/html/draft-hilt-sip-correction-503-01#section-4" rel="nofollow">https://tools.ietf.org/html/draft-hilt-sip-correction-503-01#section-4</a></p>
</blockquote>

<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/2405#issuecomment-662827291">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMXEOLIAE6RNUKCPDDR47EEXANCNFSM4PFKP4KQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZLB2DWNXTTJGXKSSP3R47EEXA5CNFSM4PFKP4K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOE6A7CGY.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/2405#issuecomment-662827291",
"url": "https://github.com/kamailio/kamailio/issues/2405#issuecomment-662827291",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>