Accessing Voicemail metadata via ARI or any REST method?

Lots of old old pages in a google search on this, wanted to get the current state of things, especially with Asterisk 16.

We are looking to, via an API whether it’s ARI or any other method asterisk offers, to get these details about voice mailboxes:
Length, who the call into voicemail came from, has it already been listened to, etc.

Is there any way to do this currently within Asterisk?
Thanks!
Ryan

There is no such thing for voicemail.

Thanks for the reply. Is there a better-known method to do this, 3rd party? Don’t want to reinvent the wheel, countless people have to have done this before

I was able to get the length, where the call came from - from the mysql cdr which I was already writing to.

For ‘whether it’s been listened to’, ended up doing a bash for loop on /var/spool/asterisk/voicemail/default/*, and doing ls on each INBOX dir with wc -l to count unlistened to messages, and same thing on the “Old” dir for listened to messages. Hope that helps anyone doing something similar.

As for when a live voicemail comes in and is written to, I used “externnotify” in voicemail.conf to run an external bash script to do custom stuff to notify / write to db when a message comes in.

On the voicemail folder there is a txt file for each voicemail ,with some information, I have used PHP to read voicemail information and pass it as web service