A funny twist would be to have a recording of a 'raspberry' and have that played into the phone instead of 'hello' (ha ha).I believe that I finally figured this out.
Relay #3 is normally closed so that outgoing phone calls can be made anytime.
When a call comes in it will be categorized by the Arduino as one of three types.
White List: A known phone number that I want to ring the house phones
Black List: A known phone number that I do not want to ring the house phones
Unknown: An unknown phone number
When a call comes in it is first detected by “Ring Detection”. Relay #1 is normally closed so the signal travels to Relay #3. Relay #3 then opens and no ringing will occur in the house during this period of determining what type of call we have. HT9032D looks for the phone number which occurs between the first and second rings. The Arduino then categorizes that phone number as White List, Black List, or Unknown.
If it’s a “White List” number then Relay #1 is opened which then closes Relay #3. House phones start to ring.
If it’s a “Black List” number nothing happens. When the caller gives up, “Ring Detection” stops signalling. Relay#3 closes. Everything is back to were it was before the call. And the house phones never rang once.
View attachment 282646
If it’s an “Unknown” number Relay #2 closes and the telephone line is connected to the XE0068DT chip. The XE0068DT tells the Arduino that it opened the phone line (OH). The Arduino then sends out the outgoing message (“Press 21 to continue”). The XE0068DT listens for a DTMF from the caller and sends the information to the Arduino. The Arduino checks the incoming DTMF (or nothing) against the DTMF requested and determines if it’s a real person calling or not (telemarketer). If it’s the correct DTMF Relay #1 is opened thereby closing Relay #3 and the house phones start ringing. Otherwise nothing happens. The house phones never ring once.
I just found a mistake. If the XE0068DT "answers" the phone, the phone ringing STOPS. I need to add a ringtone generator. If the caller DTMF's the correct number, the phone ringing in the house needs to start ringing but the signal will not be coming from the VOIP.
