Sim800l disconnect atmega328

Hi I’m making automation system and I’m in last stage. My problem is sometimes sim800l and atmega328 are disconnect and don’t recive a call i need to reset atmega328p and after that they work fine. Can you help me with this problem…

If you have to reset AtMega then the code is making it get struck somewhere. Debug for infinite loops. Always have timeouts when waiting for certain conditions