Question
Why are my outbound SIP calls failing when a BYE message is sent with a CSeq value of 1 instead of incrementing from the last ACK?
Product
Programmable Voice
Answer
According to SIP protocol standards, CSeq sequence numbers must increase by one per direction within a dialog, rather than globally across the entire call.
When a BYE message is generated from the opposite direction of the initial request (for example, Twilio terminating a call initiated by your system), it is treated as the first new request in that specific direction. Therefore, the CSeq correctly starts at 1. If the BYE message is sent in the same direction as previous requests, the CSeq will increment by 1 as expected.
If your system is rejecting or failing to process the BYE message, you will need to adjust the SIP configuration on your Session Border Controller (SBC) or Private Branch Exchange (PBX) to track CSeq numbers per direction independently, rather than enforcing a global incrementation rule.
Additional Information
- This behavior strictly complies with RFC 3261 (Section 12.2.1.1), which states: "Requests within a dialog MUST contain strictly monotonically increasing and contiguous CSeq sequence numbers (increasing-by-one) in each direction..."
- If you are using a third-party PBX or SBC, please consult your vendor's documentation on how to adjust SIP header validation to align with this standard.