开发者

SIP REGISTER To header with IP address instead of Domain

So I've been reading the RFC3261, and trying to figure out this particular problem. Say the UAC is 192.168.1.42, the registrar is 192.168.1.1.

According to the RFC, it says that the To field should contain the Address of Record of the entity you're registering. AoR is defined as a URI that points to a domain with the location service that would map this URI to another where the user is available.

So I'm no开发者_如何学Ct using domain names, so the question is, should the To header be Alice<sip:alice@192.168.1.42> or Alice<sip:alice@192.168.1.1>. I have a SIP conformance suite that emulates the registrar, and it seems to think it's the former. Reading the RFCs like that seems to convince me that it's the latter.

Thanks!


The To header should be the AOR whose registration you're connecting. Usually, that means the To header has the same URI as the From header.

In this case, it should thus be <sip:alice@192.168.1.42>.

EDIT: viraptor and I are working from different assumptions. I didn't assume a "normal" SIP setup. (I didn't assume anything, and I can see setups where my answer above's perfectly acceptable. However...) So, if your UA's sitting on 192.168.1.42, your registrar+proxy's sitting on 192.168.1.1 internally, and it services the example.com domain, your REGISTER would have

  • To URI: <sip:alice@example.com>
  • From URI: <sip:alice@example.com>
  • Contact: <sip:alice@192.168.1.42>

which would allow calls to <sip:alice@example.com> to end up at the SIP UA sitting on 192.168.1.42.

RFC 3261 section 10.2, at the bottom of page 56 and top of page 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.

EDIT: The asker's question is about a particular setup. In general, your address of record ("who you are") won't have an IP address: <sip:alice@example.com>, not <sip:alice@192.168.1.42>. The asker's setup is particularly strange, since the AOR's not globally routable (192.168.0.0/16 is a private network block).

An Address of Record is a logical identifier of a "person". It says who you are. A Contact URI says where you are. A registrar provides a location service to a SIP proxy. That is, a proxy says "how can I contact this AOR?" and the location service (which may or may not be a registrar!) says "at this address, on this port, using this transport". The registrar allows SIP UAs to maintain this AOR/location table, as opposed to an administratively configured location service. It's thus highly unusual to have an IP address in a private address range as an AOR, because nothing outside your LAN would know how to reach you.


Let's assume that you have devices with IPs PHONE1, PHONE2, REGISTRAR. The To header should be set to alice@DOMAIN in your case - this may be equal to alice@REGISTRAR, but does not have to be. They are equal if your registrar happens to be the proxy routing the traffic / doing location services. Here's how it works:

Proxy does registration:

In this situation you're registering your phone with To header equal to alice@DOMAIN and Contact equal to alice@PHONE1. To creates a name which other users are likely to know about. It's your logical identifier, rather than physical location.

Proxy does user lookup:

When someone tries to call alice, they won't be sending the request straight to the phone, but rather to the proxy for domain. That means, the request URI they're using on PHONE2 is alice@DOMAIN. When the packet gets to the proxy for domain and the URI is rewritten to the registered contact alice@PHONE1 and forwarded to the right place (i.e. the registered phone itself, or another proxy in registration chain).

Look in the RFC 3261, in chapter "24.1 Registration". The phones registers as sip:bob@biloxi.com, even though its location is sip:bob@192.0.2.4.


Sounds like it should be Alice<sip:alice@192.168.1.1>.

The SIP Registrar is going to use the URI in the SIP request to lookup the SIP account that's attempting to register the contact. The definitive answer to your question depends on what realm your SIP Registrar is using. If it's 192.168.1.1 then <sip:alice@192.168.1.1> would be a valid AoR. If it's 192.168.1.42 then <sip:alice@192.168.1.42> would be a valid AoR.

Most registrars will strip off the display name portion so you could leave Alice off unless you're attempting to test some specific conformance issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜