Hi Arun Kumar,
I executed your C code to interface with GSM module from 8051 and found theres is something wrong in that. Then I removed the code in while loolp (temp!=1) and it started working.
Thanks for your help.
Note: Please correct my if I’m wrong.