GSM IMSI, MCC and MNC lookup tool

posted 2009-06-28 18:59:33, link to this article
Read full article

I've written a small tool to decode (or well, that is a big word for taking some substrings ;) ) GSM IMSI (International Mobile Subscriber Identity) numbers.
It then takes the MCC (Mobile Country Code) and MNC (Mobile Network Code) pair, looks it up, and presents you a mobile operator name and country.

Alternatively, you can search by just a MCC or MNC value, or both, and again, it lists all matches.

Follow the read link to give it a try.

Patch for Gammu's DCT3 debug trace

posted 2009-06-27 20:06:43, link to this article

I've written a quick and dirty patch for Gammu's nokiadebug command. Normally, nokiadebug writes debug traces to a hardcoded out.xml file, which is not really practical.

With my patch applied to gammu-1.24.0, the output of nokiadebug that was previously sent to stdout is now written to stderr. The debug traces are now written to stdout. This way it is much easier to follow the debug traces 'live'.

You might need to rebuffer gammu's stdout to emit the complete protocol hierarchy per message at once. The following (pretty ugly) awk does this for you, to add some clarity I've added line breaks to what was an even uglier one-liner before:

hessch@c3:~/gsm$ gammu nokiadebug nhm5_587.txt v18-19 2>/dev/null | awk '
        /^\<l1/ {i=0}
        /^\<\/l1/ { end = 1 }
        {
                if ( i>=0 ) {
                        buf[i] = $0;
                        i++
                };
                if (end == 1){
                        end = 0;
                        for (j = 0; j < i; j++) {
                                print buf[j];
                        };
                        i = 0;
                }
        }
'

You can download my patch for Gammu at http://isquared.nl/src/gammu-xmlstdout.patch..