C.57. VMCOUNT()

VMCOUNT(VM-box[@context][|folder])
Returns the number of voice mail messages in the specified mailbox. The default context is default, the default folder is INBOX.
; Query for the number of messages in mailbox 456:
exten => 123,1,Answer()
exten => 123,n,Set(count=${VMCOUNT(456)})
exten => 123,n,Playback(vm-youhave)          ; "You have"
exten => 123,n,GotoIf($[ ${count} = 0 ]?none:new)

exten => 123,10(none),Playback(vm-no)       ; "no"
exten => 123,n,Goto(continue)

exten => 123,20(new),SayNumber($COUNT)      ; count
exten => 123,n,Goto(continue)

exten => 123,30(continue),Playback(vm-INBOX)   ; "new"
exten => 123,n,Playback(vm-messages)         ; "messages"
exten => 123,n,Playback(vm-goodbye)          ; "Goodbye!"
exten => 123,n,Hangup()

Note

Internal help for this application in Asterisk 1.4:
  -= Info about function 'VMCOUNT' =- 

[Syntax]
VMCOUNT(vmbox[@context][|folder])

[Synopsis]
Counts the voicemail in a specified mailbox

[Description]
  context - defaults to "default"
  folder  - defaults to "INBOX"
diff output to internal help in Asterisk 1.2:
- none -