Voicemail details in variables


I’m running Asterisk I need to put voicemail details, including its duration and date, into variables. Does anybody know how to do it? HERE I’ve found some variables that should hold the voicemail information:

[quote]The VoiceMail() application uses the following variables:
${VM_CATEGORY} Sets voicemail category
${VM_NAME} * Full name in voicemail
${VM_DUR} * Voicemail duration
${VM_MSGNUM} * Number of voicemail message in mailbox
${VM_CALLERID} * Voicemail Caller ID (Person leaving vm)
${VM_CIDNAME} * Voicemail Caller ID Name
${VM_CIDNUM} * Voicemail Caller ID Number
${VM_DATE} * Voicemail Date
${VM_MESSAGEFILE} * Path to message left by caller

My dialplan looks sth like that(code of a macro):

... exten => s,n,VoiceMail(${MACRO_EXTEN}@${MACRO_CONTEXT}) exten => s,n,Set(DURATION=${VM_DUR}) exten => s,n,Set(DATE=${VM_DATE}) exten => s,n,Set(FILE=${VM_MESSAGEFILE}) ...

Unfortunatelly the only variable that works is ${VM_MESSAGEFILE}. Does anybody know if it is a bug or it needs to be done other way?

Thanks in advance,