SIM800L freezes after few messages

HI i have a sim800l interfacing with atmega16 based on an arduino code .sometimes when i send a message it doesnt respond to it and i should send a few more messages to get a respond and when it responds it responds to all of received messages.my device when it receives 1 or 2 sends 433MHz signal.
i use a 5v,2A mobile charger and a DC-DC buck convert with output of 3.8V to power sim800l and atmega16.
atmega16 and sim8000l are connected on a breadboard , is this the reason for this problem?

#include <SoftwareSerial.h>
#include <RCSwitch.h>
#include <EEPROM.h>
RCSwitch transmitter = RCSwitch();
SoftwareSerial mySerial(10,11);  
char incomingByte; 
String inputString;
//atmega16
int btn1=19;
int btn2=23;
int led=14;
int tpin=7;
long tcode1;
long tcode2;
//mega
//int btn1=9;
//int btn2=8;
//int led=13;
//int tpin=7;
//long tcode1;
//long tcode2;
void setup(){
  Serial.begin(9600);
  transmitter.enableTransmit(tpin);
  mySerial.begin(9600);
  pinMode(btn1,INPUT);
  pinMode(btn2,INPUT);
  pinMode(led,OUTPUT);
  pinMode(12,OUTPUT);
  digitalWrite(12,LOW);
  tcode1=getRandom();
  tcode2=tcode1-2;
  digitalWrite(led,HIGH);
  delay(15000);
  Serial.println("START"); 
  while(!mySerial.available()){
    
    mySerial.println("AT");
    delay(1000); 
    Serial.println("Connecting...");
    
    }
  digitalWrite(led,LOW);
  Serial.println("Connected!");  
  mySerial.println("AT+CMGF=1");  //Set SMS to Text Mode 
  delay(1000);  
  mySerial.println("AT+CNMI=1,2,0,0,0");  //Procedure to handle newly arrived messages(command name in text: new message indications to TE) 
  delay(1000);
  mySerial.println("AT+CMGDA=\"DEL ALL\"");
}

void loop(){
  int val1=digitalRead(btn1);
  int val2=digitalRead(btn2);
  if(val1==HIGH){
    digitalWrite(led,HIGH);
    transmitter.send(tcode1,24);
    delay(200);
  }else if(val2==HIGH){
    digitalWrite(led,HIGH);
    transmitter.send(tcode2,24);
    delay(200);
  }
  else{
    digitalWrite(led,LOW); 
  }
  delay(500);
  smsHandler();
  
}
void smsHandler(){
  if(mySerial.available()){
      delay(100);
      while(mySerial.available()){
        incomingByte = mySerial.read();
        inputString += incomingByte; 
        }
        delay(10);      
        inputString.toUpperCase();
        inputString=inputString.substring(51);
        Serial.print("text: ");
        Serial.println(inputString);
        if (inputString.indexOf('1') > -1){
          digitalWrite(led,HIGH);
          Serial.println("UNLOCK");
          transmitter.send(tcode1,24);
          mySerial.println("AT+CMGDA=\"DEL ALL\"");
          delay(10000);
          digitalWrite(led,LOW);
          }
         if (inputString.indexOf('2') > -1){
          digitalWrite(led,HIGH);
          Serial.println("LOCK");
          transmitter.send(tcode2,24);
          mySerial.println("AT+CMGDA=\"DEL ALL\"");
          delay(10000);
          digitalWrite(led,LOW);
          }          

        delay(50);
        inputString = "";
  
}}
long getRandom(){
  if(EEPROM.read(5)==255){
    Serial.println("FIRST TIME");
    EEPROM.update(5,analogRead(A0));
    randomSeed(EEPROM.read(5));
    long randomCode=random(80000000,99999999);
    
    return randomCode;
  }
  else{
    randomSeed(EEPROM.read(5));
    long randomCode=random(80000000,99999999);
    return randomCode;
  }
}

Most probably you're running out of memory.

Don't use the String class on AVR Arduinos!

Hi ,can you edit my code?
im not a good programmer i dont know how to avoid using string

im not a good programmer

So become one. Don't start with such complicated tasks but learn with easy examples.
Use c-style strings (character arrays) instead of the String class.

Hi ,can you edit my code?

No, this is not a free programming service.