You should use 4.1 instead of 3.1, because 3.1 is really old (and no
longer supported) version.
Location table keeps attributes per username@domain. To get the
attributes, you need the username@domain. The typical use case is when a
SIP requests comes to the proxy targeting username@domain, yo
I went through usrloc page on kamailio site. Link given below.
http://www.kamailio.org/docs/modules/3.1.x/modules_s/usrloc.html
It states that the module keeps a user location table and provides access to
the table to other modules.
The module exports no functions that could be used directly fro