i want to get IMEI no. of GSM module

Hello,
i want to get IMEI no. of GSM module and i'm using test code ARDUINO/FILE/EXAMLPES/GSM/TOOLS/DEVICE IMEI , when i compile code. IDE showing Error that -

'getIMEI' was not declared in this scope.
'modem' was not declared in this scope
'GSMModem' does not name a type

PLZ help me to come out from this prob.

Thanku.....

I can't see that in my version of the IDE - which one are you using?

Anyway, what's wrong with sending the AT command 'AT+GSN'?

thanks for your reply...

When i compile this code " test device" to get IMEI no. ,it runs properly but it will print output like "IMEI - 0" on serial monitor. why it is not giving my device's IMEI no.
and when i marge this code with some other code then it is showing error-

error: 'GSMModem' does not name a type
in function 'void IMEI_number()':
error: 'modem' was not declared in this scope
error: 'modem' was not declared in this scope

im using arduino IDE 1.6.3.....
may be problem occurring with this IDE version?

Hello,
Plz help me to come out from this prob. i have tried a lot to solve it but nothing hpnd