Search code examples
networkinggeolocationcoordinatesgsmcellid

Get the HLR and VLR Records of Cellid of base stations


I am working on a geo-location app, it’s mandatory I get the exact location of people or places. After having read about how a GSM network works I’m informed that records of active user’s mobile numbers are stored in the HLR and VLR on each base station transceivers.

How do I get these records? I mean HLR and VLR of base stations?


Solution

  • The HLR (Home Location Register) is actually a central database of user info, including location, authentication info etc. It is a separate node and is not located or hosted 'in' the base station in any large scale network.

    The VLR (Visitor Location Register) is essentially like a cache of some of the information from the HLR for all the mobiles attached to a particular MSC (Mobile Switch). The MSC/VLR may sometimes be combined but they are nearly always separate from the Base stations in any normal network.

    Either way, the information in the HLR and VLR is not usually available externally. Some of the information would never be shared, but there are some services which will allow you query some HLR info - for example (I have not used these and cannot vouch for them):

    Even if you do get find this is supported for your target network, the location information will generally be very coarse as you will likely just get the MSC the user is attached to - in some modern distributed switch networks knowing the MSC number will really not narrow down the location very much.

    If your app is smartphone based, then the phone itself will have much more accurate location information, generally, as it can use GPS and WiFi network information to give a quite precise location (so long as the user grants permission, which most users do these days, for better or for worse).