[SR-Users] Wrong handling CANCEL message

pars3c pars3c at gmail.com
Thu Apr 29 21:14:44 CEST 2010


Hi, i have a problem about the handling of the "cancel" message.

The call flow is this:

A             -----------------> (Invite)                Proxy (P)
B

                (100 Tryng)         <---------------------------


----------------->(Invite)                                 B

 
(100 Tryng)         <---------------------------

 
(183 Progress)  <---------------------------

(183 Progress)  <---------------------------

 
(200 OK)              <---------------------------

(200 OK)              <---------------------------

--------------------------------->(CANCEL)

(200 canceling) <---------------------------

 
(200 OK)              <---------------------------

(200 OK)              <---------------------------

----------------->(ACK)

----------------->(ACK)

 
(BYE)     <---------------------------

(BYE)     <---------------------------

----------------->(481 Call Leg/Transaction Does Not Exist)

----------------->(481 Call Leg/Transaction Does Not Exist)

 

The B side answer with OK, after a while , a send a CANCEL. I don't know why
Kamailio don't forward this message to the B side.

B retry to send the OK message, then A send the ACK.

At the end , B send BYE , but A don't have the transactin.

 

In this situation, kamailio should deliver the "CANCEL" to the B side ?
(even if, before B send the OK )

Or the proxy should not consider the CANCEL because  B has answered with
"OK"  ?

Where is the error on my configuration ?

Thanks

 

I have Kamailio 1.5.3 and my configuration is this:

 

 

 

modparam("siptrace", "trace_on", 0)

modparam("carrierroute", "config_source", "db")

modparam("auth_db", "password_column", "ha1")

modparam("auth_db", "use_domain", 1)

modparam("usrloc", "db_mode", 2)

#modparam("usrloc","nat_bflag", 8)

modparam("permissions", "trusted_table", "trusted")

modparam("permissions", "db_mode", 1)

modparam("permissions", "peer_tag_avp", "$avp(i:707)")

modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")

modparam("avpops","avp_table","usr_preferences")

modparam("avpops","attribute_column","attribute")

modparam("avpops","value_column","value")

modparam("uac","from_restore_mode","auto")

modparam("tm", "fr_timer", 12)

modparam("tm", "wt_timer", 32)

modparam("rr", "append_fromtag", 1)

#modparam("rr", "enable_full_lr", 1)

modparam("userblacklist", "use_domain", 0)

#modparam("dialog", "dlg_flag", 2)

 

 

modparam("registrar|nathelper", "received_avp", "$avp(i:42)")

#modparam("registrar", "min_expires", 17000)

 

 

modparam("acc", "db_flag", 2)

modparam("acc", "db_missed_flag", 3)

modparam("acc", "db_table_acc", "acc")

modparam("acc", "db_table_missed_calls", "missed_calls")

modparam("acc", "detect_direction", 1)

 

 

route{

 

# -----------------------------------------------------------------

# Sanity Check Section

# -----------------------------------------------------------------

        if (!mf_process_maxfwd_header("10")) 

        {

                sl_send_reply("483", "Too Many Hops");

                exit;

        };

  

        if (msg:len > max_len) 

        {

                sl_send_reply("513", "Message Overflow");

                exit;

        };

                 

# -----------------------------------------------------------------

# Preprocessing

# -----------------------------------------------------------------

 

                if (!method=="REGISTER") record_route();

 

# -----------------------------------------------------------------

# NAT Detection

# -----------------------------------------------------------------

 

                force_rport();

                if (nat_uac_test("19")) {

                               if (method=="REGISTER") {

                                               fix_nated_register();

                               } else {

                                               fix_nated_contact();

                               }

                               setflag(7);

                }

# -----------------------------------------------------------------

# 

# -----------------------------------------------------------------


                

                sip_trace();

                

                ##Loose_route packets

                if (has_totag()) {

                               if (loose_route()) {

                                               if(method=="BYE") {

                                                               #Account BYE
transactions

                                                               setflag(2);

                                               };

                                               route(2);

                               } else {

                                               if ( is_method("ACK") ) {

                                               if ( t_check_trans() ) {

                                                                   # non
loose-route, but stateful ACK; 

                                                           # must be an ACK
after a 487 or e.g. 404 from upstream server

                                                t_relay();

                                        exit;

                                       } else {

                                                # ACK without matching
transaction ... ignore and discard.\n");

                                    exit;

                               }

                               }

                                               sl_send_reply("404","Not
here");

                               }

                               exit;

                }

                

# -----------------------------------------------------------------

#             CANCEL processing 

# -----------------------------------------------------------------


 

                if (is_method("CANCEL")) {

                               if (t_check_trans()) t_relay();

                               exit;

                };

                t_check_trans();

 

# -----------------------------------------------------------------

# 

# -----------------------------------------------------------------


 

                if (method =="OPTIONS" || method=="SUBSCRIBE") {exit;};

                if (method =="REGISTER") {route(3);}; 

 

                route(1);

 

}

 

 

route[2] 

{  

                t_on_reply("1");    

                if (!t_relay()) {

                               sl_reply_error();

                };

                exit;

}              

 

 

 

..

 

 

failure_route[2] {

                if (t_was_cancelled()) {

#                             xlog("INFO:cancelled transaction--\n");

                               exit;

                }              

                

                revert_uri();

..

                t_on_failure("2");

                append_branch();

                if (!t_relay()) {

                               exit;

                };

}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100429/7c4bca44/attachment.htm>


More information about the sr-users mailing list