Leave the GSM aside for a while and test you program with a terminal.

Then just type on the keyboard what you expect your PIC to receive and see if that works.

Ioannis