[OpenSIPS-Devel] [B2B_ENTITIES] Difference between sending CANCEL and BYE

Bogdan-Andrei Iancu bogdan at voice-system.ro
Fri Jan 22 19:03:30 CET 2010

Hi Oliver,

BYE is a sequential request and id built based on the 200 OK from 
INVITE, while CANCEL is special request that is send before getting the 
200 OK -> there are different contexts and the 2 requests are build in 
different ways.

I strongly suggest to read the RFC3261 about building CANCEL and 
sequential request - it the best source.


Olivier Détour wrote:
> Hi,
> I would like to break a SIP communication during a call or a
> proceeding SIP session...
> If the call is in progress (Caller can speak to Callee), I can send a
> BYE to caller and callee each with send_request function;
> Here is my Wireshark trace:
> BYE sip:sa at SIP/2.0
> Via: SIP/2.0/UDP;branch=z9hG4bKda73.5742b3a7.0
> From: <sip:11 at>;tag=934c0604001f8a49c065a1707fbb682d-59cf
> To: <sip:21 at>;tag=B2B.333.0.1264181639
> CSeq: 4 BYE
> Call-ID: B2B.269.0.1264181639
> Content-Length: 0
> User-Agent: OpenSIPS (1.6.1-notls (i386/linux))
> Contact: <sip:sa at>
> If the sip session is proceeding (Caller send INVITE but he hasn't
> receive 200 OK yet), I send a CANCEL
> like I sent the BYE (send_request);
> But here is my Wireshark trace:
> CANCEL sip:22 at SIP/2.0
> Via: SIP/2.0/UDP;branch=z9hG4bK5161.0ab21263.0
> From: <sip:11 at>;tag=934c0604001f8a49c065a1707fbb682d-ac1f
> To: sip:22 at
> CSeq: 2 CANCEL
> Call-ID: B2B.134.0.1264181129
> User-Agent: OpenSIPS (1.6.1-notls (i386/linux))
> Contact: <sip:sa at>
> Why is the Request Line not for sip:sa at as for the BYE?
> Regards,

Bogdan-Andrei Iancu

More information about the Devel mailing list