-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add onCancel
delegation to Session
#5
Conversation
/** @internal */ | ||
public constructor(private incomingCancelRequest: IncomingRequestMessage) {} | ||
|
||
/** Incoming ACK request message. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** Incoming ACK request message. */
Why ACK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, it's a copy-paste from another object, I will fix.
@@ -420,6 +421,14 @@ export class Invitation extends Session { | |||
public _onCancel(message: IncomingRequestMessage): void { | |||
this.logger.log("Invitation._onCancel"); | |||
|
|||
// validate state for CANCEL delegation | |||
if (this.state === SessionState.Initial || this.state === SessionState.Establishing) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to check the State not just send the Cancel?
What problem it solves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After talking with Eric from SIP.js he said he'll only accept this addition only if I won't try to bypass the RFC.
As CANCEL should not arrive in ESTABLISHED state, and if it does according the RFC it should ignore it and not process it at all.
That's why the delegation part will only work in INITIAL and ESTABLISHING.
Initial - is when the CT is still ringing.
Establishing - is when the CT SIP.js is still structing the 200OK but hasn't sent it out yet.
Established - is when the 200OK is already sent.
This step is not for processing the CANCEL, it is being done already... this step is for processing the delegation part only.
No description provided.