login | register
Tue 09 of Feb, 2010 [21:34 UTC]

voip-info.org

History

Asterisk cmd VoiceMail

Created by: oej,Last modification on Fri 17 of Jul, 2009 [05:15 UTC] by voipmiv

Synopsis

Leave a voicemail message in one or more mailboxes.

Description


 VoiceMail([flags]boxnumber[@context][&boxnumber2[@context]][&boxnumber3])
or
 VoiceMail(boxnumber[@context][&boxnumber2[@context]][&boxnumber3],[flags])

Deprecation in 1.4-trunk
As of 1.4-trunk, flags must be passed after the | (pipe). The ability to pass the flags after a comma or before the box number has been removed.
 VoiceMail(boxnumber[@context][&boxnumber2[@context]][&boxnumber3]|[flags])

As of 1.6
As of version 1.6 flags must be passed after the box number seperated by a comma. The usage of the pipe (|) symbol is deprecated. Following format is right for 1.6 and higher (tested on 16th of juli 2009 in version 1.6.1.1).
 VoiceMail(boxnumber[@context][&boxnumber2[@context]][&boxnumber3],[flags])

Records the channel, saving an audio file in a given voicemail boxnumber, which must be configured in voicemail.conf. The boxnumber may be preceeded by one or more flags or these may be specified as the second argument:

  • s: The letter s, if present, causes the instructions ("Please leave your message after the tone. When done, hang up, or press the pound key.") to be skipped.

  • u: The letter u, if present, causes the unavailable message to be played. By default, the message says, "The person at extension ... 1234 ... is unavailable," but the mailbox owner may record their own unavailable message with the VoicemailMain command.

  • b: The letter b, if present, causes the busy message to be played. By default, the message says, "The person at extension ... 1234 ... is busy."

  • g(#): (Only when specifying the flags as the second argument) Adjust the gain of the recording. The # is an integer representing the amount of gain in decibels. (This actually sets a channel option to increase the RX gain, this option is unfortunately only supported on Zap, see the volgain voicemail.conf option to have asterisk call sox to adjust the gain on voicemails sent as email attachements)

You may not specify both u and b flags together. You may, however, combine them with s, giving six possibiities:
  1. s: Play nothing.
  2. (no flags): Play instructions.
  3. su: Play unavailable message.
  4. u: Play unavailable message, then instructions.
  5. sb: Play busy message.
  6. b: Play busy message, then instructions.
In all cases, the beep.gsm file will also be played, prior to starting to record.

This application will set the following channel variable upon completion:
VMSTATUS - This indicates the status of the execution of the VoiceMail application. The possible values are:
SUCCESS | USEREXIT | FAILED

The voicemail messages will be saved into the inbox directory for that voicemail boxnumber:
  • /var/spool/asterisk/voicemail/context/boxnumber/INBOX/

If the caller presses 0 (zero) during the announcement, and the option 'operator=yes' is set in voicemail.conf either in the general section or for this mailbox then he will be moved to extension 'o' (as in "Out") in the current voicemail context. This could be used as an escape for a receptionist. If you don't want it, just configure extension o to go back to voicemail, or configure operator=no, otherwise the call will be hangup due to the fact that extension 'o' doesn't exist.

Also. during the prompt if the caller presses:
 '*' - the call jumps to extension 'a' in the current voicemail context. 
    Example:
    Exten => a, 1, VoicemailMain(@default)
    Exten => a, 2, Hangup
 '#' - the greeting and/or instructions are stopped and recording starts immediately.


NOTE: The below information is not correct in version 1.2.x. The a and o extensions must exist within the current context.

When using the zero '0' and star '*' it's important to note that the context you placed the application voicemail in is irrelvant, it's the context for the voicemail box that we're looking for in the dialplan for the jump to the 'a' or 'o' extention.
I tested this using a macro to call voicemail and pressing '0' and/or '*' first jumped back to the macro that called voicemail, to look for 'o' and/or 'a' in that macro, if it failed it jumpted to the context defined in voicemail.conf. I'm running CVS version 1.07

If the requested mailbox does not exist, and there exists a priority n+101, then that priority will be taken next.

If, during the recording the caller presses:
 '#' - or the defined silence limit is exceeded, recording is stopped and the call continues at priority n+1. 

Be sure you do something with the caller after they come back from Voicemail(), at the very least:

...
exten => somewhere,5,Playback(Goodbye)
exten => somewhere,6,Hangup

Examples


   Voicemail(1)
   Voicemail(b1234@default)
   Voicemail(b1234&1704@home)
   Voicemail(su${EXTEN})

Old version:

See also



Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ


Comments

Comments Filter
222

333Deprecation in 1.4-trunk

by lidocaineus, Thursday 14 of May, 2009 [19:16:16 UTC]
Is this part even accurate at all? 1.6 doesn't use pipes - it uses commas. If anything, this seems backwards. The only part that's accurate is the part that mentions you can't put flags before the box number.
222

333pipe flags into voicemail command, which versions?

by lingolep, Tuesday 25 of March, 2008 [22:24:30 UTC]
I'm not sure if there is a problem with Asterisk 1.4.18.1 and the syntax for piping commands such as Voicemail(2233,u) for an unavailable box, or Voicemail(2233|u) for same using the more recent syntax. In my case this might have been related to leaving a jump command in my Dial statement, but basically I had much better success getting a Voicemail greeting to come up by only specifying the box number and leaving all commas, pipes, and options unspecified.
222

333problem with app_voicemail.c in asterisk-1.4.1

by orion, Saturday 17 of March, 2007 [21:16:18 UTC]
Dear list members,

I've a problem with app_voicemail.c in version 1.2.15. I was trying to configure voicemailbox with mysql realtime, but I can't get the playing of vm-intro, just the beep.

Best regards,
Orion
222

333problem with app_voicemail.c in asterisk-1.4.1

by orion, Saturday 17 of March, 2007 [21:05:43 UTC]
Dear list members,

I've a problem with app_voicemail.c in version 1.2.15. I was trying to configure voicemailbox with mysql realtime, but I can't get the playing of vm-intro, just the beep.

Best regards,
Orion
222

333new syntax

by demo, Wednesday 16 of August, 2006 [14:07:21 UTC]
I have my boxnumber and extension that aren't numbers but names.

Using this sintax :
Voicemail(u${MACRO_EXTEN})

my ${MACRO_EXTEN} will be jhon.doe or smith.agent .

So if the boxnumber start with the letter s that macro will not work, 'smith.agent' will become 'mith.agent'

— Executing VoiceMail("SIP/jhon.doe-c4a4", "usmith.agent ") in new stack
Aug 16 15:22:19 WARNING30241: app_voicemail.c:2410 leave_voicemail: No entry in voicemail config file for 'mith.agent '

To fix use the new syntax :
VoiceMail(mailbox@context[&mailbox@context]...[|options])
In my case
Voicemail(${MACRO_EXTEN}|u)



222

333Re: 'a' extension in current context

by ajc, Tuesday 15 of August, 2006 [14:28:18 UTC]
sparcusa: the trick to making the 'dial *' function work is that you have to define extension 'a' in the context from which the caller arrived at voicemail in the first place. If you're using an upstream SIP provider, then extension 'a' has to be defined in the context that accepts incoming calls. If you're using a Digium card, then extension 'a' has to be defined in the context that accepts calls from there. The same holds true for extension 'o' if you want to hand off calls to an operator (or automated attendant).
222

333jump to other context without specifying mailbox

by grin, Thursday 15 of June, 2006 [19:47:13 UTC]
I thought (by mistake) that you can actually use
VoiceMail([flags][boxnumber][@context])
as
VoiceMail(@nondefault)
and let the caller to select the mailbox number. Seems you cannot. So how to let caller to enter mailbo in a nondefault context?
222

333drop to voicemailmain

by dgorski, Friday 14 of October, 2005 [17:04:48 UTC]

Use a macro:

[macro-sip-vm]
exten => s,1,Dial(SIP/${MACRO_EXTEN})
exten => s,2,Voicemail(u${MACRO_EXTEN})
exten => s,3,Hangup() ; I always add hangup everywhere
exten => s,102,Voicemail(b${MACRO_EXTEN})
exten => s,103,Hangup()
exten => a,1,VoiceMailMain(${MACRO_EXTEN})
exten => a,2,Hangup()

[other-context]
exten => 1234,1,Macro(sip-vm)
exten => 1234,2,Hangup()



222

333'a' extension in current context

by sparcusa, Thursday 15 of September, 2005 [02:56:18 UTC]
"Also. during the prompt if the caller presses:
'*' - the call jumps to extension 'a' in the current voicemail context. 
'#' - the greeting and/or instructions are stopped and recording starts immediately."

Anyone know what the 'a' extension refers too? I'm trying to allow a caller to call his own mailbox and interrupt the announcement with '*' and go to VoiceMailmain to access his messages. This avoids the need for a dedicated access number.

Anyone know how to do that?


222

333context?

by , Monday 14 of June, 2004 [18:25:41 UTC]
How about the context? Shouldn't the syntax be VoiceMail(flagsboxnumber,context)? Or is this just a VoiceMail2 thing?