There's a problem with this. On GSM at least, my understanding is that the unique identifier (the IMSI) is rarely sent over the air, and more often an encrypted counterpart is sent.
http://en.wikipedia.org/wiki/International_Mobile_Subscriber...
You'll have a lot of problems with this, both with uniquely identifying subscribers, and ensuring that you are not violating any privacy laws.
Check out OpenBTS and OpenBSC for basic code and feasibility stuff.