Hello,

this is the behaviour required by rfc, to send cancel only after receiving a provisional reply 1xx.

The cancel_b_method parameter is there to control this behaviour, but it may apply only to the case when the cancel is received and needs to be forwarded, so this needs to be investigated for t_cancel_branches("others").

Perhaps the best is to open an item on issue tracker from github.com/kamailio/kamailio not to forget about it -- these days are rather busy, with the freezing of the release in few days.

Cheers,
Daniel

On 02/01/2017 21:11, Aqs Younas wrote:
Greetings list, 
I am forking a call to multiple destinations and want to keep the only branch which sends quicker first 180/183 reply and cancel the remaining branches. Below is my related cfg snippet.


modparam("tm", "failure_reply_mode", 3)
modparam("tm", "fr_timer", 30000)
modparam("tm", "fr_inv_timer", 120000)
modparam("tm", "cancel_b_method", 2)
...
route[SIPOUT] {
        if (uri==myself) return;

        append_hf("P-hint: outbound\r\n");
        append_branch();
        append_branch();
        route(RELAY);
        exit;
}
onreply_route[MANAGE_REPLY] {
        xdbg("incoming reply\n");
        if(status=~"[12][0-9][0-9]") {
                xlog("L_INFO","Received $rs (IP:$si:$sp)\n");
                if(status=~"18[03]"){
                        t_cancel_branches("others");
                        xlog("L_INFO","cancelled all other branches\n");
                }
                route(NATMANAGE);
        }
}
...

But I see kamailio does not instantly send CANCEL to other branches after it has received 180/180 from any branch. 
Kamailio is sending CANCEL to other branches after they start sending 180/183 one by one. How can I cancel all other branches instantly?

I am sure there is something wrongly configured in my configuration.  

Any suggestion is much appreciated. 
Best Regards.


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com