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

sipsess: allow UPDATE and INFO in early dialog #878

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

maximilianfridrich
Copy link
Contributor

According to RFC 3261 section 12.1

2xx and 101-199 responses with a To tag, where the request was
INVITE, will establish a dialog.  A dialog established by a non-final
response to a request is in the "early" state and it is called an
early dialog.

This means that UPDATE (or INFO) requests are allowed within early dialogs (RFC 6086 mentions this in section 4.2.1, RFC 3311 in section 5.1).

However, UPDATEs with SDP offers or answers are still only allowed in "early confirmed dialogs" which have been confirmed by a PRACK (see RFCs 3311 and 6337).

@alfredh
Copy link
Contributor

alfredh commented Jul 15, 2023

This looks fine to me, please merge if this looks okay...

@@ -253,7 +253,7 @@ static void target_refresh_handler(struct sipsess_sock *sock,
return;
}

if (got_offer || is_invite) {
Copy link
Collaborator

@cspiel1 cspiel1 Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We think that here a negative reply should be sent if the SDP is not allowed.

Another commit will follow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

|| sess->terminated || sess->awaiting_answer)
if (!sess || (!sess->established && !sess->refresh_allowed &&
mbuf_get_left(desc)) || sess->terminated || sess->awaiting_answer
|| !sip_dialog_established(sess->dlg))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split up this into 2-3 different if-s

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

|| sess->awaiting_answer)
if ((!sess->established && !sess->refresh_allowed
&& mbuf_get_left(sess->desc)) || sess->awaiting_answer
|| !sip_dialog_established(sess->dlg))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related. The check is not needed here. The function is not in the API. So we can drop this in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

if (!desc) {
err = ENOMEM;
goto out;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@maximilianfridrich maximilianfridrich force-pushed the update_fixes branch 2 times, most recently from 225257c to 46ea2fa Compare July 24, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants