Hi,

I am having an issue getting Kamailio to properly cancel a call.

I initiate the call with an INVITE from Asterisk and then hang up.

According to rfc3665 the call flow should be:

3.8.  Unsuccessful No Answer

   Alice           Proxy 1          Proxy 2            Bob
     |                |                |                |
     |   INVITE F1    |                |                |
     |--------------->|   INVITE F2    |                |
     |     100  F3    |--------------->|   INVITE F4    |
     |<---------------|     100  F5    |--------------->|
     |                |<---------------|                |
     |                |                |      180 F6    |
     |                |     180 F7     |<---------------|
     |     180 F8     |<---------------|                |
     |<---------------|                |                |
     |   CANCEL F9    |                |                |
     |--------------->|                |                |
     |     200 F10    |                |                |
     |<---------------|   CANCEL F11   |                |
     |                |--------------->|                |
     |                |     200 F12    |                |
     |                |<---------------|                |
     |                |                |   CANCEL F13   |
     |                |                |--------------->|
     |                |                |     200 F14    |
     |                |                |<---------------|
     |                |                |     487 F15    |
     |                |                |<---------------|
     |                |                |     ACK F16    |
     |                |     487 F17    |--------------->|
     |                |<---------------|                |
     |                |     ACK F18    |                |
     |     487 F19    |--------------->|                |
     |<---------------|                |                |
     |     ACK F20    |                |                |
     |--------------->|                |                |


In my case I only have one proxy - the Kamailio box, and the call is coming 
from Asterisk instead of Alice.

The is the call flow that I am seeing:

   Asterisk         Kamailio          SIP_phone
     |                |                |
     |   INVITE       |                |
     |--------------->|   INVITE       |
     |     100        |--------------->|
     |<---------------|     100        |
     |                |<---------------|
     |                |                |
     |                |     180        |
     |     180        |<---------------|
     |<---------------|                |
     |   CANCEL       |                |
     |--------------->|                |
     |                |   CANCEL       |
     |                |--------------->|
     | 200 Canceling  |                |
     |<---------------|                |
     |                |     200        |
     |                |<---------------|
     |                |                |
     |                |                |
     |                |     487        |
     |                |<---------------|
     |                |     ACK        |
     |     487        |--------------->|
     |<---------------|                |
     |     ACK        |                |
     |--------------->|                |

     |   CANCEL       |                |
     |--------------->|                |
     | 200 Canceling  |                |
     |<---------------|                |

     |   CANCEL       |                |
     |--------------->|                |
     | 200 Canceling  |                |
     |<---------------|                |



It looks like the problem is that that "200 Canceling" has a To: tag and it shouldn't.

======================================
# cancel from Asterisk:
U 2011/05/24 15:18:56.123714 3.3.3.3:5060 -> 2.2.2.2:5060
CANCEL sip:SIP_13034445555@2.2.2.2 SIP/2.0.
Via: SIP/2.0/UDP 3.3.3.3:5060;branch=z9hG4bK51c9602a;rport.
From: "+13032223333" <sip:+13032223333@3.3.3.3>;tag=as4c415d87.
To: <sip:SIP_13034445555@2.2.2.2>.
Call-ID: 605b8de40a05924177085d71154bda77@3.3.3.3.
CSeq: 102 CANCEL.
User-Agent: VerbalWorld.
Max-Forwards: 70.
Content-Length: 0.


# 200 canceling from Kamailio to asterisk:
U 2011/05/24 15:18:56.127349 2.2.2.2:5060 -> 3.3.3.3:5060
SIP/2.0 200 canceling.
Via: SIP/2.0/UDP 3.3.3.3:5060;branch=z9hG4bK51c9602a;rport=5060.
From: "+13032223333" <sip:+13032223333@3.3.3.3>;tag=as4c415d87.
To: <sip:SIP_13034445555@2.2.2.2>;tag=4ed8ab9f3ed29a77613bb14b3431ff43-2f34.
Call-ID: 605b8de40a05924177085d71154bda77@3.3.3.3.
CSeq: 102 CANCEL.
Server: kamailio (3.1.3 (i386/linux)).
Content-Length: 0.
======================================

Why is kamialio adding a  To: tag?


Portion of kamailio.cfg
=====================

...
route
{
...
   route(WITHINDLG);

   ### only initial requests (no To: tag) from here on

   if (is_method("CANCEL"))
   {
      if (t_check_trans())
      {
         xlog("L_INFO", "MAIN: Recieved Cancel, t_check_trans is true\n");
...
         t_relay();
         exit;
      }
...

Thanks!
Carl

_______________________________________________
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

Reply via email to