<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">I’m trying to implement following routing behaviour:</div><div class=""><br class=""></div><div class="">- ingress INVITE is sequentially forked to 1 or more endpoints</div><div class="">- under certain conditions sequential forking may be stopped and pre-defined error returned to the caller</div><div class=""><br class=""></div><div class="">Here’s is part of the config responsible for handling errors:</div><div class=""><br class=""></div><div class=""><div style="color: rgb(54, 54, 54); background-color: rgb(255, 255, 255); font-family: Menlo, Monaco, "Courier New", monospace; line-height: 18px; white-space: pre;" class=""><div class="">failure_route[ROUTE_ELEMENT_FINAL_FAILURE_HELPER] {</div><div class="">    route(ROUTE_ELEMENT_FINAL_FAILURE)<span style="color: rgb(146, 205, 120);" class="">;</span></div><div class="">}</div><div class=""><br class=""></div><div class=""><div style="line-height: 18px;" class=""><div class="">route[ROUTE_ELEMENT_FINAL_FAILURE] {</div><div class="">    <span style="color: rgb(146, 205, 120);" class=""># We need to check if the error happens before the first egress, because T-state is not defined yet so we can not use t_reply</span></div><div class="">    if ($var(before_first_egress) == 0) {</div><div class="">        t_reply(<span style="color: rgb(162, 86, 55);" class="">"$var(sipCode)"</span>, <span style="color: rgb(162, 86, 55);" class="">"$var(sipMessage)"</span>)<span style="color: rgb(146, 205, 120);" class="">;</span></div><div class="">    } else {</div><div class="">        sl_send_reply(<span style="color: rgb(162, 86, 55);" class="">"$var(sipCode)"</span>, <span style="color: rgb(162, 86, 55);" class="">"$var(sipMessage)"</span>)<span style="color: rgb(146, 205, 120);" class="">;</span></div><div class="">    }</div><div class="">}</div></div></div></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Here is a simple scenario where delivering call to first endpoint times out after receiving 180 Ringing (using custom fr_inv_timer value) where:</div><div class="">- .33 is caller</div><div class="">- .208 is Kamailio</div><div class="">- .138 is callee</div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="ECFFF355-7557-47CA-A573-550B6376FBB5" src="cid:63584C6F-483C-4E7D-8779-02DED8537403" class=""></div><div class=""><br class=""></div><div class="">Notice that 504 is retransmitted by Kamailio. Here is a comparison of 180 and 504 returned by Kamailio:</div><div class=""><br class=""></div><div class=""><img apple-inline="yes" id="74C8120E-418C-4CB0-B0E0-E568B884AC14" src="cid:1DE6F81C-A85D-444F-9121-322EE481F959" class=""></div><div class=""><br class=""></div><div class="">As can be seen, 180 was proxied from the callee and has callee’s to-tag (tag=CALLEE1), however 504 that was generated by Kamailio using t_reply() has a different to-tag (presumably generated by Kamailio).</div><div class=""><br class=""></div><div class="">How can I tell Kamailio not to generate new to-tag but to use the last one that proxied back to the caller?</div><div class=""><br class=""></div><div class="">Thanks in advance for any help!</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Ivan</div></body></html>