Tzafrir Cohen
2012-Jan-08 12:30 UTC
[asterisk-users] cached VMI on manual voicemail update
Hi I use a simple script to enable/disable for voicemail on an extension for testing (attached: test_voicemail). The script only created the txt file, but I don't suppose this should matter. I set up a mailbox. The new message shows fine in 'voicemail show users' (The new user takes 'voicemail reload' for it to be added on the list, but after it has been initially added , it seems to be updated immediately (or by running 'voicemail show users'?). However the voicemail indication to the tested phone (in chan_dahdi, in this case) did not follow suit: it never updates. Even a full 'dahdi restart' is not good enough. Nothing short of a restart of asterisk seems to make it update. Looking further I see that the MWI values are cached: kemeny*CLI> event dump cache MWI Event Type: MWI Cache Unique Keys: --> Mailbox --> Context --- Begin Cache Dump --- Event: MWI Mailbox: 4004 Context: default NewMessages: 1 OldMessages: 0 EntityID: 00:1c:c0:fc:f0:ad --- End Cache Dump --- kemeny*CLI> voicemail show users Context Mbox User Zone NewMsg default 4004 0 1 voicemail users configured. Is there any way to tell Asterisk to flush that cache? Is this considered a bug? Tested on 1.8 (1.8.7.0 and SVN-branch-1.8-r349672). -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir -------------- next part -------------- #!/bin/sh NUM=${2-:4001} vm_base="/var/spool/asterisk/voicemail/default" vm_dir="$vm_base/$NUM/INBOX" setup() { sed -i -e "/^$NUM/d" -e "\$a$NUM => ," /etc/asterisk/voicemail.conf } on() { mkdir -p "$vm_dir" cat <<EOF >"$vm_dir/msg0000.txt" ; ; Message Information file ; [message] origmailbox=$NUM context=from-internal macrocontextexten=s priority=1 callerchan=DAHDI/1-1 callerid="Channel 1" <$NUM> origdate=`date -R` origtime=`date +'%s'` categoryduration=4 EOF } off() { rm -f "$vm_dir/"* } case "$1" in setup | on | off) "$1";; esac
Tzafrir Cohen
2012-Jan-09 21:32 UTC
[asterisk-users] cached VMI on manual voicemail update
On Sun, Jan 08, 2012 at 02:30:03PM +0200, Tzafrir Cohen wrote:> Is there any way to tell Asterisk to flush that cache? Is this > considered a bug?It's a feature. To enable such polls, set: pollmailboxes = yes ;pollfrequency = NN ; seconds Thanks to mjordan on IRC. -- Tzafrir Cohen icq#16849755 jabber:tzafrir.cohen at xorcom.com +972-50-7952406 mailto:tzafrir.cohen at xorcom.com http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir