I asked for the circuit. I know that AT+CMGR=x\r\n is the command used to read the received SMS but before that you have to send an AT command once so that the GSM will indicate with +CMTI: SM, x response if a new SMS is received and if this +CMTI: string is received then you can send the AT+CMGR=x\r\n command for reading SMS. I don't remember the command that has to be given to do that. Give me some time . I am reading the AT manual. I will write a code soon.
I am attaching incomplete code.