Repository navigation
Grammar: maddr no longer overwrites the URI host; ttl is stored as a URI parameter - #1133
Open
AhmedElbashier wants to merge 1 commit into
Open
AhmedElbashier wants to merge 1 commit into
AhmedElbashier wants to merge 1 commit into
Conversation
maddr_param and via_maddr reused the host rule, whose action stores options.data.host, so a maddr value replaced the URI host (and the Via sent-by host). Parse maddr with a rule that has no host side effect and keeps host_type. ttl_param wrote to options.data.params instead of uri_params, so the ttl was lost from the URI and, inside a name-addr, showed up as a header parameter. Part of onsip#1132.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the first part of #1132 (maddr / ttl). The user-part escaping and trailing-dot FQDN items in that issue are separate changes and are not touched here.
Problem
maddr_param(andvia_maddr) parse their value with thehostrule. That rule's action setsoptions.data.host, so the maddr value replaces the URI host beforenew URI(...)runs inSIP_URI. The same thing happens to the Via sent-by host.ttl_paramwrites tooptions.data.paramsinstead ofoptions.data.uri_params. The ttl is dropped from the URI, and when the URI is inside a name-addr (Contact, To, From...) it ends up as a header parameter.On
main:Change
maddr_hostrule: same alternatives ashost(hostname / IPv4address / IPv6reference) but it only returns the text. It does not storehost, and it restoreshost_typeso that keeps describing the real host. Used bymaddr_paramandvia_maddr.ttl_paramstores intouri_params.After the change the examples give
sip:alice@atlanta.com;maddr=239.255.255.1;ttl=15, Contact params{ expires: "60" }withttlon the URI, and Via hostpc33.atlanta.com(host_type: "domain",maddr: "224.2.0.1").Tests
Added a
URI maddr and ttl parametersblock totest/spec/core/grammar.spec.ts(RFC 3261 §19.1.3 example URI, the Contact case and the Via case). They fail onmainand pass with the change. The rest of the Core/API specs pass locally. In my headless Chrome sandbox theWeb SessionDescriptionHandlerspecs fail at media setup. That suite doesn't touch the grammar (see also #1128).eslintandprettier --checkare clean on the touched files.