When an SMS is received its text is dumped into microcontroller's RAM using a very calibrated approach. Therefore the 7th character(7th was chosen randomly) always lands at location 57H of RAM. This was determined by connecting the phone to PC's serial port and debugging using the Proteus Simulation. The RAM was monitored as the phone sent the SMS text and it was dumped.
So the 7th character is compared using the below table and the appropriate function is called for performing the action using relays.