Hello,
iirc, the function was developed before the branch failure route was
added, mostly intended to be used in the onreply route for provisional
responses (i.e., 100-199). I see it is allowed in any route, but there
is no purpose for it at least in the failure route, where the
transaction cannot be cancelled any more, because is already in
terminated state.
So, if it is a single branch, then triggering a cancel in event route
branch failure is not useful.
Maybe it should be tried also with t_cancel_branches(), but in onreply
route, when the status is >=300.
Cheers,
Daniel
On 07.06.22 08:27, Henning Westerholt wrote:
Hello,
this might be a bug in the tmx module function, according to the docs
it should work for all branches.
Please open an issue on our github tracker about it, with the details
for reproducing it.
Cheers,
Henning
--
Henning Westerholt –
https://skalatan.de/blog/ <https://skalatan.de/blog/>
Kamailio services –
https://gilawa.com <https://gilawa.com/>
*From:* sr-users <sr-users-bounces(a)lists.kamailio.org> *On Behalf Of
*Pavel Veselovsky
*Sent:* Tuesday, June 7, 2022 6:49 AM
*To:* sr-users(a)lists.kamailio.org
*Subject:* [SR-Users] t_cancel_callid - doesn't insert Reason header,
if called from branch 0
Hallo
so far I have no reaction on my question.
Has anybody similar experience that t_cancel_callid() doesn't insert
Reason header, if called from branch 0?
What are differences between branch 0 and other branches?
Regards.
Pavel.
On Fri, Jun 3, 2022 at 3:17 PM Pavel Veselovsky
<pavel.veselovsky(a)gmail.com> wrote:
Hallo all,
I defined branch_failure routing block via t_on_branch_failure()
In the branch_failure route, in case of "408 Request timeout" I am
sending CANCEL with reason "t_cancel_callid("$ci", "$cs",
"22",
"408")".
If the t_cancel_callid("$ci", "$cs", "22",
"408") is called in
branch_failure for branch idx 0, the CANCEL is sent, but Reason
header is missing there.
Why? (I expect that t_cancel_callid() should insert Reason header
regardless of branch it is called from)
If the t_cancel_callid is called in branch idx !=0, the CANCEL
contains Reason header with cause as expected.
Thanks for clarification of this behavior,
Pavel.
P.S. code snipset:
event_route[tm:branch-failure:primary]
{
if ($T(reply_code) == "408")
{
if ($avp(branch_idx) == $T_branch_idx)
{
if (t_cancel_callid("$ci", "$cs", "22",
"408"))
{
xlog("L_INFO", "CANCEL sent ci:$ci, cs:$cs 408");
}
else
{
xlog("L_INFO", "CANCEL not sent ... ci:$ci, cs:$cs
408");
}
$var(_palotmp_) = "sip:" +
$avp(replaced_cfnry_target_number) + "@" + $dd + ":" + $dp +
";user=phone";
append_branch($var(_palotmp_),"1.0");
t_relay();
return;
}
}
}
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
* sr-users(a)lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
*
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla --
www.asipto.com
www.twitter.com/miconda --
www.linkedin.com/in/miconda
Kamailio Advanced Training - Online: June 20-23, 2022
*
https://www.asipto.com/sw/kamailio-advanced-training-online/