An important point when writing AT command interfaces is not to rely on assumptions about a specific response format. The first step will be to strip off delimiters and leading spaces.
I don't know what gets() is supposed to do, but I would expect that <CR><LF> is removed from the response string. In this case, the compare would fail.