Skip to content
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

Merged
merged 2 commits into from
Aug 25, 2021
Merged

add onCancel delegation to Session #5

merged 2 commits into from
Aug 25, 2021

Conversation

slavikbialik
Copy link

No description provided.

/** @internal */
public constructor(private incomingCancelRequest: IncomingRequestMessage) {}

/** Incoming ACK request message. */

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?

Copy link
Author

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) {

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?

Copy link
Author

@slavikbialik slavikbialik Aug 25, 2021

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.

@slavikbialik slavikbialik merged commit b4737b6 into develop Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants