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.
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?