How to intercept incoming phone call notification?

The idea is to react to incoming phone calls on MacOS desktop. To get the number / email address of incoming call and act accordingly in my application. Any ideas? MBS? Thanks in advance.

I am interested in that too but I do not have the programming fortitude.

If it is a WhatsApp call, WhatsApp Dekttop, Download WhatsApp, for Mac works well… I have some precomposed answers to common questions.
For cell phones and landline calls, I am in the Dark.