SIP.js
SIP.js copied to clipboard
Add `onCancel` delegate for Session
This PR will add onCancel
delegation for Session. This can help developers to detect CANCEL events while call is ringing on the client and fire any action needed. It can assist detect 2 scenarios:
- CANCEL arriving before answering the call.
- CANCEL arriving while trying to answer the call and Session state is still
ESTABLISHING
(means 200OK - final response - has not yet sent out).
This PR is not breaking the RFC and SIP.js internal mechanism to treat incoming CANCEL requests.