To 标头应该是您要连接其注册的 AOR。通常,这意味着 To 标头与 From 标头具有相同的 URI。
在这种情况下,它应该是 <sip:alice@192.168.1.42>。
编辑:viraptor 和我的工作假设不同。我没有假设“正常”的 SIP 设置。(我没有做任何假设,我可以看到我上面的答案完全可以接受的设置。但是......)因此,如果您的 UA 位于 192.168.1.42,那么您的注册商+代理在内部位于 192.168.1.1,它会提供服务example.com 域,您的 REGISTER 将拥有
- 到 URI:<sip:alice@example.com>
- 来自 URI:<sip:alice@example.com>
- 联系人:<sip:alice@192.168.1.42>
这将允许对 <sip:alice@example.com> 的呼叫最终到达位于 192.168.1.42 的 SIP UA。
RFC 3261第 10.2 节,第 56 页底部和第 57 页顶部:
To: The To header field contains the address of record whose
registration is to be created, queried, or modified. The To
header field and the Request-URI field typically differ, as
the former contains a user name. This address-of-record MUST
be a SIP URI or SIPS URI.
From: The From header field contains the address-of-record of the
person responsible for the registration. The value is the
same as the To header field unless the request is a third-
party registration.
编辑:提问者的问题是关于特定设置的。通常,您的记录地址(“您是谁”)不会有 IP 地址:<sip:alice@example.com>,而不是 <sip:alice@192.168.1.42>。询问者的设置特别奇怪,因为 AOR 不是全局可路由的(192.168.0.0/16 是专用网络块)。
记录地址是“人”的逻辑标识符。它说你是谁。联系人 URI 说明您的位置。注册器向 SIP 代理提供位置服务。也就是说,代理说“我如何联系这个 AOR?” 并且位置服务(可能是也可能不是注册商!)说“在这个地址,在这个端口,使用这个传输”。注册器允许 SIP UA 维护此 AOR/位置表,而不是管理配置的位置服务。因此,将私有地址范围内的 IP 地址作为 AOR 是非常不寻常的,因为您的 LAN 之外的任何人都不会知道如何与您联系。