We need to know when someone picks up or hangs up your phone. We can achieve that easily by intercepting the handset switch.
Each phone has four switches that are triggered during a different point during the travel distance. I am not exactly sure why they needed four. But we only need one!
I tried to identify the switches that are triggered around 50% travel.
In the newer designs you can complete remove the circuit, but in the older designs the circuit is difficult to remove so I just left it connected.
For newer (more common) designs it is pin 1 & 3. For older (spiderweb filled) phones it is 2 & 3.
** The polarity of these is inverted. For new phone it will for LOW-HIGH. For old phones it will go HIGH-LOW. **
Connect the two cables to your Arduino Mega. One to Pin 40 and the other to GND (doesn't matter which order). Set pinMode to INPUT_PULLUP.