[Home]

Summary:ASTERISK-28884: x-ast-orig-host not filtered out from request URI and To header
Reporter:nappsoft (nappsoft)Labels:patch
Date Opened:2020-05-11 09:13:36Date Closed:2020-05-22 08:47:28
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Resources/res_pjsip_nat
Versions:16.9.0 16.10.0 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:Attachments:( 0) ast_message_filter.diff
( 1) patch2.diff
( 2) patch3.diff
Description:In the Changelog to Change-Id Idc263ad2d2d7bd8faa047e5804d96a5fe1cd282e one can read concerning x-ast- URI parameters: "Asterisk will never send a request with those headers in it". But while res_pjsip_nat filters out the x-ast-* URI parameters from the contact header, they stay in the request URI and the to-Header.

This makes the INVITE request larger than necessary and because of that we were facing issues in some scenarios with PPPoE connections (MTU 1492) and routers that do not support UDP fragmentation.

I was able to work around the issue with the attached patch. However you might prefer to add the removal of the URI parameters to res_pjsip_nat or you might think that it's necessary to not remove the parameters at all for whatever reason.

So please let me know whether you'd like the patch to be submitted via gerrit or not.
Comments:By: Asterisk Team (asteriskteam) 2020-05-11 09:13:38.112-0500

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.

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.

By: George Joseph (gjoseph) 2020-05-11 09:41:15.419-0500

Usually, the module that added the header should be responsible for cleaning it up again so removing it from other headers should probably go in res_pjsip_nat:restore_orig_contact_host().

If you could make the change there instead and submit to gerrit, that'd be the fastest way to get this fixed.


By: nappsoft (nappsoft) 2020-05-11 10:04:51.568-0500

So do you think something like patch2.diff would be good to go? => added my code before if (tdata->msg->type != PJSIP_RESPONSE_MSG) as this is obviously mainly a problem with Request-Messages... (or should one do the removal in the to header as well only in Request messages?)

By: nappsoft (nappsoft) 2020-05-11 10:09:21.123-0500

So do you think something like patch2.diff would be good to go? => added my code before if (tdata->msg->type != PJSIP_RESPONSE_MSG) as this is obviously mainly a problem with Request-Messages... (or should one do the removal in the to header as well only in Request messages? have a look at patch3.diff as well in this case).

By: George Joseph (gjoseph) 2020-05-11 10:47:03.156-0500

I'd go with patch3 and only look on To for request messages.



By: Friendly Automation (friendly-automation) 2020-05-22 08:47:30.750-0500

Change 14466 merged by Friendly Automation:
res_pjsip_nat.c: remove x-ast-orig-host from request URI and To header

[https://gerrit.asterisk.org/c/asterisk/+/14466|https://gerrit.asterisk.org/c/asterisk/+/14466]

By: Friendly Automation (friendly-automation) 2020-05-22 08:51:55.286-0500

Change 14465 merged by Friendly Automation:
res_pjsip_nat.c: remove x-ast-orig-host from request URI and To header

[https://gerrit.asterisk.org/c/asterisk/+/14465|https://gerrit.asterisk.org/c/asterisk/+/14465]

By: Friendly Automation (friendly-automation) 2020-05-22 08:52:25.601-0500

Change 14464 merged by Friendly Automation:
res_pjsip_nat.c: remove x-ast-orig-host from request URI and To header

[https://gerrit.asterisk.org/c/asterisk/+/14464|https://gerrit.asterisk.org/c/asterisk/+/14464]

By: Friendly Automation (friendly-automation) 2020-05-22 08:53:03.435-0500

Change 14406 merged by Friendly Automation:
res_pjsip_nat.c: remove x-ast-orig-host from request URI and To header

[https://gerrit.asterisk.org/c/asterisk/+/14406|https://gerrit.asterisk.org/c/asterisk/+/14406]