Custom DND Playback before going to voicemail

I have managed to configure custom DND states so that they work on the flash panel, on the Grandstream GXP-2010 phones with the company’s logo and all other goodies.

The task now is to actually get the sound file to play back to someone calling an extension that has set their DND on.

For example, I dial *7803 which puts my phone on “In a Meeting”. Right now it plays back to the person, “In a Meeting” and then once I hang up the phone, the screen refreshes and says “In a Meeting.” Now when someone calls me, I want it to play back that same in-a-meeting.wav file then go to the voicemail. Obviously I only want this to be from internal calls. External calls would just go to the voicemail message.

Anyone have any suggestions, this has been squeezing my brain for the last two weeks.

It seems to me that it’d be inside the dialparties.agi that this should go. Just a simple check against the database, I have a dnd_state(0 or 1 for off or on) and dndsm_state (01-20 for the different dnd codes) that I use for the xml file to generate what dnd state someone is on. So I would need dialparties.agi or wherever else it should be, to read out of the database the DND state and play back the proper sound. Ultimately it’d be cool as well to be able to do a dynamic DND (like “Out Of Office until {digits}”) But I can figure that one out later.

This is something I wish (and I’m sure others out there would like the same) would be in freepbx 2.6 by default. I could see a lot of companies wanting a custom Do Not Disturb status that works this way. Our old PBX has a system in place where when you call someone that is on DND, it displays on the phone itself. I know this to be impossible with the way the Grandstream phone works, which is why I am trying to get it to work this way.

Thank you for any possible help.