[sr-dev] [kamailio] t_reply sends cancel to a terminated branch (#315)

ThomasSevestre notifications at github.com
Mon Sep 7 14:06:38 CEST 2015


Hi,

I'm using t_reply if onreply_route as follow:

    route {
      ...
      t_on_reply("ERROR");
      ...
      t_relay();
    }
    
    onreply_route[ERROR] {
      t_reply("500", "Error");
    }

I have this call flow:

    CLIENT         KAMAILIO         CARRIER
    |--- INVITE --->  |
                      |---- INVITE --->|
                      |<---- 100 ------|
    |<--- 100 --------|
                      |<---- 503 ------|
                      |---- ACK ------>|
    |<--- 500 --------|
    |---- ACK ------->|
                      |---- CANCEL --->|
                      |<--- 487 -------|

Kamailio sends a CANCEL message to a branch terminated by the carrier.

I'm not sure it is the good way to fix this issue (espacially in use cases involving multiple branches) but here is a patch that work for me on current master:

    diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
    index b2e6e53..4b9e142 100644
    --- a/modules/tm/t_reply.c
    +++ b/modules/tm/t_reply.c
    @@ -571,7 +571,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
                            }
                    }
                    cleanup_uac_timers( trans );
    -               if (is_invite(trans)){
    +               if (is_invite(trans  && get_route_type() != TM_ONREPLY_ROUTE)){
                            prepare_to_cancel(trans, &cancel_data.cancel_bitmap, 0);
     #ifdef CANCEL_REASON_SUPPORT
                            cancel_data.reason.cause=code;



---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/315
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20150907/ff88ca00/attachment.html>


More information about the sr-dev mailing list