I am trying to connect my raspberry pi to my hardwired doorbell in order to send a text message when the doorbell button is pushed. I have successfully sent the text message using a button connected to the breadboard but I am unable to do so when connecting the breadboard with resistors and raspberry pi to the cables wired to the doorbell itself. I believe this is due to the circuit and not the software.
My thinking was that since the doorbell has its own button, I should be able to replace the button on the breadboard with the doorbell button itself. The difference however, is that the doorbell button emits its own voltage.
I am currently using this example (minus the LED): 
How should I be wiring my doorbell to the rpi, which emits a voltage of approximately 3V when the doorbell button is pushed after the current has passed through the resistors?
If interested, here is my code:
var Gpio = require('onoff').Gpio, button = new Gpio(4, 'in'); button.watch(function (err, value) { if (err) { throw err; } //Twilio credentials required to send text message omitted process.on('SIGINT', function () { button.unexport(); }); I am using onoff and writing this in JavaScript.