Conditions with GSM module SIM900 doesn't execute
I’ve solved the condition problems by making the condition with the ASCII code of ON and OFF.

I replaced:

if ( msg == “ON”) 


with 

if(msg.indexOf("ON")&gt;=0) 


and replaced: 

else if (msg == "OFF")


with

if(msg.indexOf("OFF")&gt;=0)