wrong GSM/GPRS code

All we need now is the code

IN CODE TAGS please...!

ClearBufferArray was not declared
A good place to start...
The variable ClearBufferArray has not been declared in scope of the function that uses it...
(that means there is no char ClearBufferArray[nn] - or similar in the same program space that is needed.)