Find out extension e-mail in dialplan. [RESOLVED]

Is there a way to find out an extension email through dialplan? A variable, function?

I mean, something like the example below:

exten => 1234,1,NoOp("Function email")
exten => 1234,n,ReadExten(EXTENSION)
exten => 1234,n,NoOp(Extension e-mail is ${ExtensionEmail(${EXTENSION})} ;<== EXAMPLE
exten => 1234,n,HangUp()


Find it out from what ? where have you stored it ? if its in the voicemail.conf then you will have to make a system call to get it , if you have stored it in a db then you wil need to get it from there. of if you have set it as a variable in the extension you will need to get it by calling that variable.

Well, thats the question.

I have the emails stored on voicemail.conf, but the only way I know to retrieve it is using AGI script, as the “System” dialplan command cant read the command output (at least not in asterisk 1.6) and the e-mails in voicemail.conf are not stored in astdb.

So i want to know if there are simpler alternatives than AGI, like a function or a variable?

I ended up using AGI as it was simple enought, although it wasn’t what I was originally looking for.

Thank you!

It looks like in Asterisk 13 you can do this with the VM_INFO Function FYI. … on_VM_INFO