Problem with light up leds with GSM Shield

Hello, may you help me with my code please? I'm trying to lights up and down a led making a phone call and sending sms messages to a GSM Shield and a arduino UNO.

My problem is that the messages dont do nothing and with the phone call i can't Synchronized to an incoming call turns on or off the LED.

Sorry for my english.

My code is:

// include the GSM library
#include <GSM.h>

// PIN Number for the SIM
#define PINNUMBER ""

// initialize the library instances
GSM gsmAccess;
GSM_SMS sms;
GSMVoiceCall vcs;

// Array to hold the number a SMS is retreived from
char senderNumber[20];

void setup()
{
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  Serial.println("SMS Messages Receiver");

  // connection state
  boolean notConnected = true;

  // Start GSM connection
  while (notConnected)
  {
    if (gsmAccess.begin(PINNUMBER) == GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("GSM initialized");
  Serial.println("Waiting for messages");
}
int x=LOW;
void loop()
{
  char c;

  // If there are any SMSs available()
  if (sms.available())
  {
    
    while (c = sms.read())
      Serial.print(c);
      String Mensaje=String (c);
      if(Mensaje=="On")
      {
        digitalWrite(7,HIGH);
        delay(1000);
      }
      if(Mensaje=="Off")
      {
        digitalWrite(7,LOW);
        delay(1000);
      }
    sms.flush();
  }

  delay(1000);
  
  //Here starts the calling part
  // Check the status of the voice call
  switch (vcs.getvoiceCallStatus())
  {
    case IDLE_CALL: // Nothing is happening

      break;

    case RECEIVINGCALL: // Yes! Someone is calling us

    if(digitalRead(13)==x)
    {
        
        if (x==HIGH)
        {
          digitalWrite(13,LOW);
          delay(1000);
          int x=HIGH;
        }
        if (x==LOW)
        {
          digitalWrite(13,HIGH);
          delay(1000);
          int x=LOW;
        }
       
    }
    if(digitalRead(13)!=x)
    {
      if (x==HIGH)
        {
          digitalWrite(13,LOW);
          delay(1000);
          int x=HIGH;
        }
        if (x==LOW)
        {
          digitalWrite(13,HIGH);
          delay(1000);
          int x=LOW;
        }
    }

  }
  delay(1000);

}

C_digo_final.ino (2.02 KB)

      String Mensaje=String (c);

Useless crap. Making a String out of ONE character is pointless.

      if(Mensaje=="On")

There is not a snowball's chance in hell of that one character String equaling "On". or "Off". NONE!

Learn to read serial/client streams properly.