Phone [Q] How to treat my mobile as IVR engine

Hi i am an android developer.

i am trying to develop a app like Voice Mail box. What i need is the call should attend automatically when the mobile is in silent mode and play music through the call ( just like "i'm busy , u can put a message to mail box").
is there any way to achieve this. I don't want to enable the speaker and mic.

i appreciate your help, Thanks in advance