How to retrieve TAC from IMEI?
Asked Answered
N

2

7

The problem is simple. I have an IMEI and I want to retrieve a TAC from it. How can I do it? Is there a way of recognizing how many digits should TAC have if I have just an IMEI? Is it necessary to know explicitly the year of production of the device to know it?

Neapolitan answered 23/7, 2012 at 13:39 Comment(1)
What solution did you use in the end?Kalman
H
7

Read 8 digits from beginning. TACs with 6 digits are rarely and are in the past (since 2004).

But for safety you can analyze it twice, and begin from longest version, then use short. If you find phone model, then you use that TAC. If not, then use 8 digits, because old phones are well known (in most cases).

To transform tac to phone model use databases:

Halftone answered 28/8, 2012 at 17:30 Comment(1)
My main concern is how to recognize the TAC type - 6 or 8 digits. According to you, it's necessary to refer to device database to do this. Thanks.Copula
P
4

The first eight digits of the IMEI number is the TAC code. Prior to 2004, the first six digits were the actual device identifier and the next two were a Final Assembly Code (FAC)representing where the device was manufactured. Since then, the FAC portion has been dropped.

TAC codes are issued by two authorities (CTIA for North America and the GSM Association for everywhere else), identifiable by the first two digits. Because the TAC codes are issued sequentially, you can test positions three through six to identify the six-digit TAC codes. For example, I use code like this:

if    substr(IMEI,1,2) = '01' and substr(IMEI,1,8) < '01015900'  /* CTIA */
   or substr(IMEI,1,2) = '35' and substr(IMEI,1,8) < '35150100'  /* GSMA */
   then TAC_TYPE = '6-digit';
   else TAC_TYPE = '8-digit';

These ranges were determined by my personal inspection of the TAC code tables and are not guaranteed.

See this Wikipedia link for more info.

Polecat answered 29/8, 2012 at 16:54 Comment(1)
Thanks for a piece of code, but this is my main concern - how can I recognize the TAC type (6 or 8 digits).Copula

© 2022 - 2024 — McMap. All rights reserved.