How to remove Reason HF from branched CANCEL?

Benoit Panizzon via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Organization ImproWare AG
Message-ID <[email protected]>
Hi Gang

I try to remove the Reason Header from a CANCEL message.

I use parallel branching on the registrar.

The route below is called very soon in request_route.
The cancel matches as I get the log entry just before calling
remove_hf("Reason")

But the Reason HF is still present when the CANCEL is forked to the
registered CPE.

The INVITE is routed through a branch_route after forking where headers
can be altered per branch. But I don't see the CANCEL in the branch
route.

Is there a way to alter header in a branched cancel message?

        # CANCEL processing
        if (is_method("CANCEL")) {
                if (t_check_trans()) {
                        route(FILTER_CANCEL);
                        route(RELAY);
                }
                exit;
        }

route[FILTER_CANCEL]
{
        # Buggy iPhones send wrong cancel cause code 200.
        if (is_present_hf("Reason")) {
                $var(cause) = $(hdr(Reason){param.value,cause});
                $var(text) = $(hdr(Reason){param.value,text});
                if (($var(cause) == 200) && ($var(text) == "Call Rejected By User")) {
                        if ($avp(debug) > 0) {
                                xlog("L_INFO", "$cfg(route): Remove wrong iPhone Cancel Reason HF\n"); 
                        }
                        remove_hf("Reason");
                }
        }
}


Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G    -    Leiter Commerce Kunden
______________________________________________________

Zurlindenstrasse 29             Tel  +41 61 826 93 00
CH-4133 Pratteln                Fax  +41 61 826 93 01
Schweiz                         Web  http://www.imp.ch
______________________________________________________
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.