Phase 2d:SipUriParser 把 OpaqueUri 升级为 SipUri - #6
Draft
lixuanqun wants to merge 1 commit into
Draft
Conversation
SipUriParser 处理 RFC 3261 §19.1.1 + RFC 3986 §3.2.2: - sip: / sips: scheme(其它 scheme 仍回退 OpaqueUri) - userinfo: user[:password]@ - hostport: host[:port] - IPv6 reference: [::1]:5060 - URI parameters: ;name=value;name2 - URI headers: ?key=value&key2=value2 - 用户名中的分号正确归入 user(如 RFC 4475 semiuri 用例) SipParser 切换 Request-URI 解析路径 - OpaqueUri 不再是默认;只有非 sip/sips scheme 才回退 - 全 6 个 accept fixture 仍 roundtrip 通过(SipUri.asWire 完全重建) 新增 SipUriParserTest(16 个单测)覆盖: - 基本 host / sips / user / user+password+port - params / headers - IPv6 reference(含/不含端口) - 非 sip scheme 回退到 OpaqueUri - roundtrip via asWire - 拒绝:空 host / 无效 port / 不完整 IPv6 / 空输入 / 缺 scheme mvn verify:9 模块 SUCCESS,49 tests(+16 URI tests)。 Co-authored-by: li xuanqun <793005378@qq.com>
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.
概述
把 Request-URI 从
OpaqueUri升级到 typedSipUri,让 user / password / host / port / params / headers / IPv6 reference 全部按 RFC 3261 §19.1.1 解析出来。实装
SipUriParser处理:
sip:/sips:scheme(其他 scheme 仍回退 OpaqueUri)userinfo = user[:password]@hostport = host[:port][2001:db8::1]:5060;name=value;name2(值为空时只存 key)?key=value&key2=value2semiuri测试sip:user;par=u%40example.net@example.com)SipParser.parseUriBestEffort()切换到新解析器。测试
新增
SipUriParserTest16 个单测:parse → asWire → parseroundtrip合规模块的全 6 个 accept fixture 仍 roundtrip 通过(
SipUri.asWire()重建 wire 形式与原始一致)。验证