[OpenSIPS-Users] Opensips should reply "SIP/2.0 200 canceling" to CANCEL after forwarding ? or wait after reply

Julien Chavanton jc at atlastelecom.com
Mon Jun 28 13:40:46 CEST 2010


There was a lot of action taking place in the same second in this SIP glare condition.
 
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 88.88.88.88:5060;branch=z9hG4bKnvvm4u3018h1if0210g1.1
Call-ID: SDhbtm701-2ddaa941b6ca35682061bd51f5f7b29d-agt38s3
From: <sip:7083596365 at sipgw14.com;user=phone>;tag=SDhbtm701-9270
To: <sip:7260711 at 10.10.10.1:5060;user=phone>;tag=db962f7fab4d65668601cd9ff01c7d01-265f
CSeq: 1 INVITE
Server: OpenSIPS (1.5.1-notls (x86_64/linux))
Content-Length: 0
 
My concern is that Opensips would not take the initiative to confirm a call is terminated sending "487" if it does not have the confirmation from the terminating UA. 
 

________________________________

From: Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro]
Sent: Fri 25/06/2010 8:11 AM
To: Julien Chavanton
Cc: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] Opensips should reply "SIP/2.0 200 canceling" to CANCEL after forwarding ? or wait after reply



Hi Julien,

The only case when the 487 is generated by opensips is when a CANCEL is
received for an INVITE branch which did not received yet no reply. In
such a case opensips will inject a 487 reply on that branch to
compensate to lack of reply from the downstream  party.

The order of the requests in siptrace is really irrelevant (for < 1s
intervals) as it is strongly affected by the parallel processing in
opensips and by the DB op (to insert the trace).

Could you post the whole 487 reply from DB ? My guess the 487 is a
result of a race between the incoming CANCEL from caller and the first
100 reply from callee.

Regards,
Bogdan

Julien Chavanton wrote:
> Hi thanks for this feed back, unfortunatly I do nto have a full trace
> but I am using sip_trace data from database.
> 
> This is waht I from on this call-id, it seems like an isolated case,
> but I am wandering where is the "487" triggered
> 
> 88.88.88.88(UA) -->  10.10.10.1(opensips) --> 10.2.2.22(UA)
> 
> I am handling CANCEL like this, could t_relay() trigger this call ?
> 
>  ####---> Handling CANCEL
>  if ( is_method("CANCEL") ) {
>    if ( t_check_trans() ){
>      t_relay();
>    }
>    exit;
>  }
> 
> +---------------------+--------+--------+----------------------+----------------------+----------------+
> | time_stamp          | method | status | fromip               |
> toip                 | fromtag        |
> +---------------------+--------+--------+----------------------+----------------------+----------------+
> | 2010-05-26 17:52:52 | INVITE |        | udp:88.88.88.88:5060 |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:52:52 | INVITE |        | udp:88.88.88.88:5060 |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:52:53 | INVITE |        | udp:10.10.10.1:5060  |
> udp:10.2.2.22:5060   | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 | CANCEL |        | udp:88.88.88.88:5060 |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 | INVITE | 100    | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 | CANCEL | 200    | udp:10.10.10.1:5060  |
> udp:88.88.88.88:5060 | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 |        | 100    | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 | INVITE |        | udp:88.88.88.88:5060 |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 | INVITE | 200    | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 | CANCEL |        | udp:10.10.10.1:5060  |
> udp:10.2.2.22:5060   | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 | INVITE | 487    | udp:10.10.10.1:5060  |
> udp:88.88.88.88:5060 | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 |        | 200    | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:52:59 | INVITE | 200    | udp:10.10.10.1:5060  |
> udp:88.88.88.88:5060 | SDhbtm701-9270 |
> | 2010-05-26 17:53:11 | ACK    |        | udp:88.88.88.88:5060 |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:53:27 | INVITE | 200    | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 17:53:27 |        | 200    | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | SDhbtm701-9270 |
> | 2010-05-26 18:13:19 | BYE    |        | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | 1190677408     |
> | 2010-05-26 18:13:20 | BYE    |        | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | 1190677408     |
> | 2010-05-26 18:13:20 | BYE    |        | udp:10.10.10.1:5060  |
> udp:88.88.88.88:5060 | 1190677408     |
> | 2010-05-26 18:13:40 | BYE    | 481    | udp:88.88.88.88:5060 |
> udp:10.10.10.1:5060  | 1190677408     |
> | 2010-05-26 18:13:40 |        | 481    | udp:88.88.88.88:5060 |
> udp:10.10.10.1:5060  | 1190677408     |
> | 2010-05-26 18:13:40 | BYE    |        | udp:10.2.2.22:5060   |
> udp:10.10.10.1:5060  | 1190677408     |
> | 2010-05-26 18:13:40 | BYE    | 481    | udp:10.10.10.1:5060  |
> udp:10.2.2.22:5060   | 1190677408     |
> +---------------------+--------+--------+----------------------+----------------------+----------------+
> 
>
> ------------------------------------------------------------------------
> *From:* Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro]
> *Sent:* Mon 21/06/2010 5:09 PM
> *To:* OpenSIPS users mailling list
> *Cc:* Julien Chavanton
> *Subject:* Re: [OpenSIPS-Users] Opensips should reply "SIP/2.0 200
> canceling" to CANCEL after forwarding ? or wait after reply
>
> Hi Julien,
>
> I doubt opensips generates a 487 Request terminated for an INVITE when
> the CANCEL is passing through - the 497 is end to end, not hop by hop
> (as the CANCEL), So, the 487 is generated by callee and opensips simply
> relays it back.
>
> Regards,
> Bogdan
>
> Julien Chavanton wrote:
> >
> > Hi, regarding handling of CANCEL request,
> >
> > Please correct me if I am wrong,
> >
> > I have glare condition on how Opensips handled Cancel requests.
> > The problem is taht Opensips respond "487 Request terminated" strait
> > after forwarding the CANCEL but it does not know if the targe UA will
> > accept it.
> >
> > I think it should wait after the target UA to reply before, as this
> > can create out of sync situation if there is a problem with the target.
> > in this senario the "200 OK" is  received at the same time as the
> > CANCEL is sent, in this case the target UA as the right to ignore the
> > CANCEL because it as generated a final response.
> >
> >
> > UA -----> CANCEL ------------------------> osips
> > UA <------ SIP/2.0 200 canceling --------> osips
> >                                            osips <--- 200 OK <-- UA
> >                                            osips ---> CANCEL --> UA
> > UA <---- SIP/2.0 487 Request Terminated -> osips
> >
>
> --
> Bogdan-Andrei Iancu
> OpenSIPS Bootcamp
> 20 - 24 September 2010, Frankfurt, Germany
> www.voice-system.ro
>


--
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
20 - 24 September 2010, Frankfurt, Germany
www.voice-system.ro




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100628/f8896da7/attachment.htm 


More information about the Users mailing list