[asterisk-users] VM_INFO - stale results

Antony Stone Antony.Stone at asterisk.open.source.it
Wed Nov 7 10:38:33 CST 2018


Hi.

I'm trying to use the VM_INFO function to discover the number of messages in a 
user's mailbox, for reporting purposes outside of Asterisk.

I'm using Asterisk 13.14.1~dfsg-2+deb9u4 on Debian 9 "Stretch".

${VM_INFO(${User}@Voicemail,count,INBOX)} tells me the number of unheard 
messages in the mailbox

${VM_INFO(${User}@Voicemail,count,Old)} tells me the number of heard messages 
left in the mailbox.

So far, so good.

However, if the user dials in to listen to their messages (and therefore the 
dial plan puts them into VoiceMailMain), and deletes some, I find the 
following:

If the user presses # at the menu to exit from the voicemail system, the 
number of messages reported by VM_INFO immediately afterwards in the dial plan 
is correct.

If the user hangs up the call to exit from the voicemail system, the number of 
messages reported by VM_INFO immediately afterwards in the dial plan is 
incorrect, and indicates the number at the start of the session, before the 
user deleted anything.

I've tried adding a 10 second delay between the user hanging up the call 
(which sends the dialplan into the h extension) and checking VM_INFO, but it's 
still incorrect.

What can I do to get the correct number of messages in the mailbox reported 
after the user hangs up the call, the same as I get if they press #?


Thanks,


Antony.

-- 
"In fact I wanted to be John Cleese and it took me some time to realise that 
the job was already taken."

 - Douglas Adams

                                                   Please reply to the list;
                                                         please *don't* CC me.



More information about the asterisk-users mailing list