[Home]

Summary:ASTERISK-30451: res_pjsip: Contact header set incorrectly for call redirect (302 Moved temp.) when external_* set
Reporter:Karsten Wemheuer (kwemheuer)Labels:patch
Date Opened:2023-03-03 04:53:20.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Resources/res_pjsip_nat
Versions:18.16.0 Frequency of
Occurrence
Constant
Related
Issues:
is duplicated byASTERISK-30453 On external transfer Contact header rewriten with external_signaling_address
Environment:Debian 11 (Bullseye)Attachments:( 0) issue-20230406.patch
( 1) pjsip.conf
( 2) trace-20230303-1.pcapng
Description:Hi,
I may have found a bug that occurs with a "redirect" (application "transfer").

The scenario concerns a call that comes from the provider to the Asterisk and is to be routed in the dialplan via transfer to an external destination. the dialplan uses
Transfer(sip:+491708300432@tel.t-online.de)
The resulting 302 response contains the IP address of the router in the Contact header. However, the provider expects the domain there.
Comments:By: Asterisk Team (asteriskteam) 2023-03-03 04:53:24.849-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Karsten Wemheuer (kwemheuer) 2023-03-03 04:55:12.903-0600

Configuration of pjsip and packet capture of the scenario.

By: Karsten Wemheuer (kwemheuer) 2023-04-06 04:51:05.397-0500

I have found a possible solution to the issue.
Unfortunately I have a problem with gerrit, so I attach the patch here.
The patch prevents NAT handling of the contact header when a 302 response message is sent.
As I understand the RFC, the Contact header is supposed to specify the new destination on a 302 response, so the destination is not local.

By: Karsten Wemheuer (kwemheuer) 2023-04-06 04:52:49.469-0500

Patch against 18.17.1