This isn't as simple as it sounds. Before looking for a 'device', provide a breakdown of exactly what it has to do.
For example:
1. monitor the incoming line for a ringing voltage
2. seize the line (go off hook)
3. connect the incoming/outgoing audio paths. Note they have to be combined to a two-wire connection.
4. play the outgoing recorded message.
5. listen for the incoming password, maybe by voice or keypad tones
6a. if rejected, send a warning to the line and disconnect.
6b. if accepted, connect the phone and generate the ringing voltage to it
7. monitor for the phone going off hook, if it doesn't within a reasonable time, turn the ringing voltage off and disconnect the incoming line.
8. if is answered, turn the ringing voltage off and either directly (relays) or indirectly (through your circuit) connect the phone to the incoming line.
9. detect when the call is finished to reset the system.
You also need a method to program the password and answering message into the system.
There are commercial devices that do this but they are expensive. The electrical needs depend on the phone line requirements of your country and it varies from place to place. Typical phone lines are balanced around ground potential and constant current when off hook. You probably have to generate around 50V DC for the line and maybe 75 to 100V AC for the ringing voltage.
Brian.