problem with hardware serial, not with altsoftserial

Thank you very much Bill!!
I'll include your suggestion in the program or modify hardware serial flush function with old flush.
I think my main problem is not related with flush of the buffer. I think the gprs not receive correctly the AT command, although arduino send it or at least connecting directly the serial port to the ftdi it appears in the serial monitor. Using the another uart in the gprs module evaluation kit I can see the responses of the module and in the moment in which the arduino should send the power down command no response appears.