Do not leave message in voicemail

Good morning,

I need some help because I didn’t find any answer to my question :

I’d like to be able to not leave a message in some voicemails.
I’d like to be able, when someone get my voicemail, to just play a song like “hi, I’m not here, please call me later” and hang up. I don’t want someone to be able to leave a message.

Is it possible to do such a thing ?
I’m using voicemail with MySQL database.

Thanks a lot for your answer !

In case of busy/unanswered case if you don’t want the voicemail than do not use the voicemail application that state. Use only playback application to play file as you like.

Yes, I thought to playback function, but we have more than 200 users. Some would like to be able to record a message for it’s own voicemail, some wouldn’t.

Voicemail doesn’t have an option for do not allow to record a message ?

Asterisk provides low level functions. You need to use the dialplan to glue them together and create user level functions. If you want different behaviour for different voicemail users, you will need to use astdb, or another database, to store their preferences, and then look this up after the Dial application returns.