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

Order route set based on dialogs role #4337

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwes
Copy link
Contributor

@jwes jwes commented Mar 5, 2025

RFC 3261 specifies, that:

The route set MUST be set to the list of URIs in the Record-Route
header field from the request, taken in order and preserving all URI
parameters.

-- section 12.1.1 UAS behavior

also:

The route set MUST be set to the list of URIs in the Record-Route
header field from the response, taken in reverse order and preserving
all URI parameters.

-- section 12.1.2 UAC behavior

Currently, just the UAC behavior was taken into account backward iterating the list.

While still continuing to iterate backwards, the route is appended in front if the role is UAS.

RFC 3261 specifies, that:

>  The route set MUST be set to the list of URIs in the Record-Route
>  header field from the request, taken in order and preserving all URI
>  parameters.

-- section 12.1.1 UAS behavior

also:

>  The route set MUST be set to the list of URIs in the Record-Route
>  header field from the response, taken in reverse order and preserving
>  all URI parameters.

-- section 12.1.2 UAC behavior

Currently, just the UAC behavior was taken into account backward
iterating the list.

While still continuing to iterate backwards, the route is appended in
front if the role is UAS.
@sauwming
Copy link
Member

sauwming commented Mar 5, 2025

Checking the code, dlg_update_routeset() is only called from pjsip_dlg_on_rx_response(), and only if dlg->role == PJSIP_ROLE_UAC.

In fact, there's an assertion just a few lines above the patch:

if (dlg->role == PJSIP_ROLE_UAC) {
...
} else {
    pj_assert(!"Should not happen");
}

@jwes
Copy link
Contributor Author

jwes commented Mar 5, 2025

pjsip_method_creates_dialog does only return true on UAC's?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants