SIM800 - how to allow only certain numbers

Good day forum,

I use a SIM800 shield as the means to communicate collected data from my Arduino to my FTP server and txt to my phone. During the setup process and after each upload of data I retrieve the current airtime balance on the sim card.

Since yesterday the service provider sends an sms back to the sim immediately after enquiring the sim balance. The sms they send consists of more than one sms, and it messes up my system. After setup when the system goes to standby it continuously reads the sim memory for sms’s and if it finds an sms with a specific command it runs that part of the code. Now as soon as this sms arrives from the service provider, after sending the command to read ("AT+CMGL=“ALL”) I get a continuous stream of garbage coming from the SIM800. It does not do this when the received sms is the normal size, less than 160 chars I guess.

I realise I should take time to dissect the sms’s and delete them one by one but this is a secondary solution in my mind. Ideally I’d like to block all sms’s or calls even from all numbers except mine.

Any idea if this is possible and how do I do this?

The code that runs in loop to continuously check for a new sms command:

void checksmsCommands()
    {                   
        if (sendATcommand(F("AT+CMGL=\"ALL\""), F("#getmastfile"), 500) == 1)
        {
          busy = true;
          smsCommand = true;
          Serial1.end();
          digitalWrite(24, HIGH);
          digitalWrite(22, LOW);
          Serial.println(F("<<< SMS command #getmastfile read, starting Getmastfile() >>>"));
          lcd.clear();
          lcd.setCursor(0,0);    
          lcd.print(F("<<SYSTEM BUSY!>>"));
          lcd.setCursor(0,1);   
          lcd.print(F("RELOAD  MASTFILE"));
          delay(1500);         
          while (sendATcommand(F("AT+CMGDA=\"DEL ALL\""), F("OK"), 500) == 0);
          GetmastFileattempts = 0;
          checksumOK = false;
          ModemReset();               
          SetupGPRS();
          GetmastFileattempts = 0;
          while ((!checksumOK) && (GetmastFileattempts < 3))   
            GetmastFile();
          firstStandby(); 
          return;
        } 
      }