I did this a few years back, and used the ringer settings referred to in the comments:
https://www.instructables.com/id/Hac...hone-Intercom/
Essentially using unlocked Linsys voip adapters, one phone rings when the other is picked up
I used 2 Linksys boxes and changed the settings slightly so instead of 2 phones into 1 unit, I have 1 phone in each, and the calls go over IP to the other module / phone. But that was because I was linking 2 distant rooms that happened to have Ethernet..