[SR-Users] t_cancel_callid - doesn't insert Reason header, if called from branch 0

Pavel Veselovsky pavel.veselovsky at gmail.com
Fri Jun 3 15:17:19 CEST 2022


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;
        }
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220603/73ace853/attachment.htm>


More information about the sr-users mailing list