Microsoft LDAP sync with Voicemail

We have our new FreePBX install set up to sync with our AD, and create a new extension if none already exist for the user.

That part works great, but it doesn’t create a voicemail when it makes the extension. We have to go back and manually set up VM’s.

Doesn’t anyone know a way to auto-provision voicemail accounts and sync with AD?

You are writing that. The voicemail.conf file is one of the only files that is dealt with in “real time”. That means it is parsed and written out when changes are needed or saved.

So you would need to build it out each change somehow

It’s not stored in the database at all?

So I’d basically have to dump a list of users, then recreate the voicemail.conf file and insert the lines needed for each user to have a voicemail?

That’s one way to do it. You can also use the AMI action UpdateConfig so you can just update/append/delete users as needed.

But no, none of this is stored in a database in the PBX. Due to how the voicemail app works and how it has to pull information, the voicemail.conf is not generated like other files, it does not have included files to separate config sections because it can’t support including those files.

All the things you see in the GUI under the extensions/voicemail admin is from the voicemail.conf file be parsed when the GUI is loaded. If you were to go into Voicemail Admin to see your settings and then went and edited/saved voicemail.conf (changed the from email for example), you could refresh the GUI page and instantly see that change and it’s active.

One other wrinkle is that the actual voicemail storage isn’t actually created on the server until it’s needed. So, you can provide the setup for a new voicemail account, but none of the prompts or storage for the actual voice mail messages will be created until they are activated. Sending a call to voicemail or dialing “*98” is usually enough to create the Comedian Mail directories in the PBX.

I’m not sure how it’s a “wrinkle” as what you described is exactly the same thing that would happen if you manage the voicemail via the GUI vs editing the voicemail.conf another way. The folder structure is not created until there is something to put in it. That could either be the greetings, a message or both.

If a call hits the voicemail system on a “new” account, if there are no greetings corresponding with the how the call was sent to voicemail (unavail, busy, temp, greet[aka name]) the system will just playback the generic “The user at (read extension number)”.

Once that message is left, the system creates the <mailbox>/INBOX folders in /var/spool/asterisk/voicemail/<context>. Now if a second call goes to voicemail and the user still hasn’t updated their greetings, the same process will happen since there is no proper greeting in the mailbox folder.

Basically an “activated” voicemail means /var/spool/asterisk/voicemail/<context>/<mailbox> exists. Because I could create a new voicemail account via AMI to voicemail.conf and then issue a mkdir, chmod, etc commands at the system level to create /var/spool/asterisk/voicemail/<context>/<mailbox>/temp.wav and that will playback the temp.wav file the very first time the voicemail is called. If the “Temp Greeting Warn” setting is “yes” then when that user calls into the voicemail for the first time to setup their account they will get the “You have a temporary greeting in place” announcement.

The voicemail app isn’t like the other applications in Asterisk where it loads everything into memory when Asterisk is started. It looks at the voicemail.conf and does things in “real time” as they happen and when they need to happen.

1 Like

That helps a lot and I think I got it.

It looks like the DB does list if the user has their VM enabled, so I’m gonna just create them manually. Then have the DB send an alert when a user is listed with no VM.

That AMI stuff is just to complex for me!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.