-
Notifications
You must be signed in to change notification settings - Fork 926
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
Destination Port Inferred Incorrectly When Assigning $du #700
Comments
If the $du is referring to a SRV record, chances are that 5060 is wrong too as the SRV may have any port. |
It is only about the returned value of the variable $dp. The port is not set in the outbound proxy uri. The logic is, if the $du has no port value, then return 5060 -- probably some old code relying on default value for port -- relevant piece of code inside the pv module:
|
So I pushed a patch to return 5061 for tls, thinking that the target was to have a valid value if one tries to use $dp to build a new URI. On the other hand, I think it may be better to make it return $null if port is not set in the uri. |
I agree, returning $NULL if the port is not set is an improvement. |
Or maybe adding a new variable like $dup (and $rup given it is the same for $rp), which will return based on uri value and $dp/$rp stay as expected destination port... just ideas... |
Great point @oej - I hadn't considered the case of SRV records which may change that. @miconda I could go for something like that. We could also just be very explicit about it, and rather than create a pseudo-var for something that may be wrong for reasons @oej mentioned, maybe just provide a function in core, like If going the
|
It may be that {uri.port} transformation return empty string or 0 when the port is not in an uri, like:
For documentation, feel free to add the content you think it's helpful in the wiki portal where the variables are documented. |
When manually assigning
$du
, the destination port pseudo-var$dp
is set to 5060 unless explicitly overridden in the URI.This should probably be inferred from the transport param, as it yields an incorrect value when transport=tls (which, unless explicitly overridden, should default to port 5061).
The text was updated successfully, but these errors were encountered: