Are you talking about mobile / cell phone or landline?
Mobile / cell I would do as Grossel said either make or download an appropriate app, such as a call blocker.
For landline I would intercept the tones, use a DTMF decoder and then if the number is allowed pass the DTMF tones onto the real phone.
Something along those lines should get you started.
Wilksey