tags:

views:

411

answers:

3

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 not using domain names, so the question is, should the To header be Alice<sip:[email protected]> or Alice<sip:[email protected]>. 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!

A: 

Sounds like it should be Alice<sip:[email protected]>.

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:[email protected]> would be a valid AoR. If it's 192.168.1.42 then <sip:[email protected]> 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.

sipwiz
+1  A: 

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:[email protected]>.

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

which would allow calls to <sip:[email protected]> 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:[email protected]>, not <sip:[email protected]>. 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.

Frank Shearar
Er, downvoter: if the answer's incorrect, or inelegant, explain how to improve things.
Frank Shearar
I disagree with the answer, since in real-life scenarios, you'd always register with AOR `user@domain`, which unless you share your location database to every UA in the network, will be `user@your_network_domain`. For example if you consider domains during location, then caller would have to know the location of the phone already, since you propose registering with `To` == `sip:[email protected]`. This destroys the idea of registration / lookup, since the caller would send the call straight there. Since you don't know the actual location, you want to send the call to the UAC location service
viraptor
Location service itself does a lookup on `alice@domain` (in this case, probably `[email protected]`) and not your actual `[email protected]` - since that is going to be the result taken from the contact header.
viraptor
Another reason is that when the domain is a logical concept, you might want to be known as `alice@biloxy` and `alice@foobar` at the same time and register for both. `192.168.1.42` does not matter at this point, it goes into the contact header instead.
viraptor
And true again (see edited explanation) - un-(-1)'d the answer :)
viraptor
+1  A: 

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:[email protected], even though its location is sip:[email protected].

viraptor
Your "Proxy does user lookup" section's wrong. Registrars map URIs to transport/address/port triples, no more, no less. They do not process INVITEs. You can bundle a proxy and a registrar in the same entity. In THAT case, <sip:alice@REGISTRAR> is the right thing to do. Not in the general case, though.
Frank Shearar
True - proxy+registrar is what I assumed, which is why I wrote "proxy does user lookup". I'll change my response to say "@domain", not "@registrar", to be more correct.
viraptor
If you change "the registrar server" to "the proxy for DOMAIN" in the "Proxy does user lookup" section I'll be happy to undo my -1.
Frank Shearar
Agreed again - and corrected, thanks.
viraptor