The RFC 3262 said: https://tools.ietf.org/html/rfc3261#section-10
The To header field contains the address of record whose registration is to be created, queried, or modified.
That means TO contains AoR, and it should be some sort of sip uri. Normally we will see display name part in front of the sip uri. So if we send sip register msg like
F1 REGISTER B -> SIP Server REGISTER sip:ss2.wcom.com SIP/2.0 Via: SIP/2.0/UDP there.com:5060 From: LittleGuy <sip:UserB@there.com> To: LittleGuy <sip:UserB@there.com> <--- sip uri should contain AoR, LittleGuy is display name Call-ID: 123456789@there.com CSeq: 1 REGISTER Contact: <sip:UserB@110.111.112.113> Contact: <sip:+1-972-555-2222@gw1.wcom.com;user=phone> Contact: tel:+1-972-555-2222 Content-Length: 0
So we should expect sip: UserB@there.com was our AoR. But if we check kamailio using kamctl ul show, we got:
"AoRs": [{ "Info": { "AoR": "UserB", "HashID": -1589985196, "Contacts": [{ "Contact": { "Address": "sip:userb@192.168.251.30;reg-alias=0acdbd32e97b7c21;transport=udp",
hmm, so where is the domain part ( there.com )? It turns out kamailio has a configure part ( usrloc module), by default is 0
modparam("usrloc", "use_domain", 0) This flag said: If the domain part of the user should be also saved and used for identifying the user (along with the username part). Useful in multi domain scenarios. Non 0 value means true.
That is why we do not see that domain part. Later on, when we use lookup() to find the AoR, kamailio will only use the number/username part to match. ( no domain is used)