Skip to content

Conversation

@maximilianfridrich
Copy link
Contributor

@maximilianfridrich maximilianfridrich commented Nov 7, 2025

res_pjsip: Introduce redirect module for handling 3xx responses
This commit introduces a new redirect handling module that provides
infrastructure for following SIP 3xx redirect responses. The redirect
functionality respects the endpoint's redirect_method setting and only
follows redirects when set to 'uri_pjsip'. This infrastructure can be
used by any PJSIP module that needs to handle 3xx redirect responses.

res_pjsip_messaging: Add support for following 3xx redirects
This commit integrates the redirect module into res_pjsip_messaging
to enable following 3xx redirect responses for outgoing SIP MESSAGEs.

When follow_redirect_methods contains 'message' on an endpoint, Asterisk
will now follow 3xx redirect responses for MESSAGEs, similar to how
it behaves for INVITE responses.

Resolves: #1576

UserNote: A new pjsip endpoint option follow_redirect_methods was added.
This option is a comma-delimited, case-insensitive list of SIP methods
for which SIP 3XX redirect responses are followed. An alembic upgrade
script has been added for adding this new option to the Asterisk
database.

@maximilianfridrich
Copy link
Contributor Author

cherry-pick-to: 20
cherry-pick-to: 22
cherry-pick-to: 23
multiple-commits: standalone
testsuite-test-pr: 117

@github-actions
Copy link

github-actions bot commented Nov 7, 2025

Workflow PRCheck completed successfully

@github-actions
Copy link

github-actions bot commented Nov 9, 2025

Workflow PRCheck completed successfully

@github-actions
Copy link

Workflow PRCheck completed successfully

@maximilianfridrich
Copy link
Contributor Author

Thanks for the review @jcolp! I've incorporated your feedback and responded to your comments. Let me know what you think.

@github-actions
Copy link

Workflow PRCheck completed successfully

This commit introduces a new redirect handling module that provides
infrastructure for following SIP 3xx redirect responses. The redirect
functionality respects the endpoint's redirect_method setting and only
follows redirects when set to 'uri_pjsip'. This infrastructure can be
used by any PJSIP module that needs to handle 3xx redirect responses.
This commit integrates the redirect module into res_pjsip_messaging
to enable following 3xx redirect responses for outgoing SIP MESSAGEs.

When follow_redirect_methods contains 'message' on an endpoint, Asterisk
will now follow 3xx redirect responses for MESSAGEs, similar to how
it behaves for INVITE responses.

Resolves: asterisk#1576

UserNote: A new pjsip endpoint option follow_redirect_methods was added.
This option is a comma-delimited, case-insensitive list of SIP methods
for which SIP 3XX redirect responses are followed. An alembic upgrade
script has been added for adding this new option to the Asterisk
database.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Pull Request Checklist Complete force

@github-actions github-actions bot added the has-pr-checklist A PR Checklist is present on the PR label Dec 30, 2025
@github-actions
Copy link

Workflow PRCheck completed successfully

@gtjoseph gtjoseph dismissed github-actions[bot]’s stale review December 30, 2025 13:11

Pull Request Checklist Complete

@gtjoseph gtjoseph removed the has-pr-checklist A PR Checklist is present on the PR label Dec 30, 2025
@gtjoseph gtjoseph dismissed their stale review December 30, 2025 13:14

Changes completed

@gtjoseph gtjoseph added the cherry-pick-test Trigger dry run of cherry-picks label Dec 30, 2025
@github-actions github-actions bot added cherry-pick-testing-in-progress Cherry-Pick tests in progress cherry-pick-checks-passed Cherry-Pick checks passed and removed cherry-pick-test Trigger dry run of cherry-picks cherry-pick-checks-failed Cherry-Pick checks failed cherry-pick-testing-in-progress Cherry-Pick tests in progress labels Dec 30, 2025
@github-actions
Copy link

Workflow PRCPCheck completed successfully

@github-actions github-actions bot merged commit d8caa66 into asterisk:master Dec 30, 2025
84 checks passed
@github-actions
Copy link

Successfully merged to branch master and cherry-picked to ["20","22","23"]

@maximilianfridrich maximilianfridrich deleted the pjsip_redirect_module branch January 8, 2026 07:27
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.

[improvement]: res_pjsip_messaging: Follow 3xx redirect messages if redirect_method=uri_pjsip

3 participants