gsm doorbell

Hello everyone, I am making a gsm intercom where by pressing a button you will have through the sim800l module the telephone call to a number, I have also added an i2c lcd with which you are invited to press the button to call, by pressing the button the module sim makes the call and the display communicates that it is calling … but as soon as the call ends how can I tell the display that the call has ended and then it should display it for a few seconds and then return to the text of: press the button to call , if I insert it in the loop module I will always have the same text repeated, I find myself in difficulty, I also added the ATA parameter to answer automatically when I call my intercom and this does it well after a few rings, the only problem is what the message does not return to the display press the button to call, another interesting thing would be to be able to automatically enter the number and store it in the arduin memory or in order to make the GSM intercom independent from the programmer who will have to program the number for each customer, can someone help me? here is the code I made so far:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);

#define Button_call 5
#include "SoftwareSerial.h"
SoftwareSerial mySerial(2, 3);


void setup(){

  lcd.begin();
  lcd.backlight();
  Serial.begin(9600);
  mySerial.begin(9600);

  pinMode(Button_call , INPUT_PULLUP);
   lcd.clear();
     lcd.setCursor(0, 0);
      lcd.print("PRESS BUTTON");
       lcd.setCursor(0, 1);
       lcd.print("FOR CALLING    ");

       
}
void loop(){
 

  while (Serial.available())
  {
    mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
   
  }
  while(mySerial.available())
  {
    Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
     if (mySerial.println("RING")){
        mySerial.println("ATA");   
      }
      }
           if (digitalRead(Button_call ) == LOW) {
   
    
    Serial.println("Button_call PRESSED");
     mySerial.println("ATD+39338.....;");
      delay(10);
      lcd.clear();
     lcd.setCursor(0, 0);
      lcd.print("WAITHING");
       lcd.setCursor(0, 1);
       lcd.print("CALLING...");
         
   delay(20);
 
     
   
   }else{

}
  }

Hi fiffidu,

does the code that you have posted do the calling part?
best regards Stefan

this code of calling:

if (digitalRead(Button_call ) == LOW) {  // if pressed 
   
   
    Serial.println("Button_call PRESSED");
     mySerial.println("ATD+39338.....;"); // compose number and calling my number
      delay(10);
      lcd.clear();
     lcd.setCursor(0, 0);
      lcd.print("WAITHING");
       lcd.setCursor(0, 1);
       lcd.print("CALLING...");
         
   delay(20);

Ok. You just send the command atd.. via serial interface and the simkit does the call. Please provide the documentation of the gsm-module. The gsm-module should send a status-message to the arduino or there is a command for asking the moduls status. Your code has to check the status of the gsm-module

I have the sim800l module, I can't understand after the call which state it assumes.

fifiddu:
I have the sim800l module, I can't understand after the call which state it assumes.

Do you expect that your potential helpers do the search for the datasheet and the documentation?
google is your friend
https://www.google.de/search?lr=&newwindow=1&as_qdr=all&ei=XU1sX7fAIYPSkgWepbCQCQ&q=sim800l+datasheet

best regards Stefan

I HOPE IN HELP not in google, thanks.

This is not only a XY-question This is even an XYZ question.

easy to understand analogon:
YOU "I need a tool"

potential helper "What Kind of tool?"

YOU "the tool is named wrench"

potential helper: "can you give some specs or a datasheet of your "Wrench"

YOU "I hope for helping me wrenching"

potential helper: as long as you can't specify if it is a open-end-wrench of which size a hexnut-wrench with which size of connecting-socket, which size of hexnut etc. etc. etc. the only thing I can co with the wrong kind of wrench is beating you for beeing too lazy to provide sufficient information!

Just an analogon of course I don't want to beat you.

at least post the link of the onlineshop where you have bought the SIM800

best regards Stefan