I want to get incomming call number and compare it
The Arduino Serial class member function readString() has a builtin timeout. The function will return on timeout. The default timeout period is 1000 ms. The timeout can be set with setTimeout(). 

The sketch needs to filter out empty lines (timeout). This can be done by adding a check of the string length. See below for an example of checking:

void loop()
{ 
  String d = Serial1.readString(); 
  if (d.length() == 0) return;
  Serial.print(d);
  if (d.indexOf("xxxxxxxxx") &gt;= 0) {
    Serial.println(": call is from saved number");
  } 
  else {
    Serial.println(": call is not from saved number");
  }
}


Cheers!