How to stop CMGS?

I’ve got a problem - after AT+CMGS in pdu format I just cannot end the command. Neither CTRL-Z nor ESC helps. The problems occurs only with OpenAT running. We have some debug and controlling commands on UART1 and it seems to be a reason for this problem but we cannot get rid of them.
What can I do to solve this problem?