Asterisk Voicemail

Asterisk Voicemail


  • Password protected
  • Separate away and unavailable greetings
  • Default or custom greetings
  • Multiple mail folders
  • Web interface for checking of voicemail
  • E-mail notification of voicemail with audio file attachment
  • Voicemail forwarding
  • Visual message waiting indicator (MWI)
  • Message waiting stutter dialtone

The number of messages for each voicemailbox is limited to 99 messages. Starting with Asterisk 0.7.1 the system now plays a prompt warning the user that the mailbox is full and cannot record any more messages.

Enhanced voicemail

New features (as of April 28, 2004)
  • Option to have the CID of the caller heard before the voicemail
  • Option to allow an operator to be reached after leaving a voicemail
  • Option to review, rerecord, or save voicemails after leaving them
  • Option to review, rerecord, or save busy, unavailable, and name prompts.
  • Option to allow dialing out from within voicemail
  • Option to allow calling back of the person who left voicemail (with the correctly formatted contexts in extensions.conf)
  • Group voicemail (voicemail broadcast)

VoiceMail contexts.

The context defined in the voicemail.conf corresponds to entries in the channel configuration file, i.e. zapata.conf and sip.conf which require the context to be appended to the mailbox when using VoiceMail2.

Configuration lines for a voicemailbox in voicemail.conf:
210 => 5555,John Smith,

Line in zapata.conf or sip.conf:

The location of saved messages also changes with the context:

VoiceMail includes a time stamp with the message by default.

When listening to a message you'll hear when it was recorded.

Please note

  • Voicemails are saved on the server in all formats specified in voicemail.conf, but only the first format specified is sent as an attachment to the email.
  • The /contrib/scripts directory of /usr/src/asterisk contains a Perl script that can be applied to regularly expire too old voicemail messages

Sending voicemail emails as MP3's

The easiest way to have Asterisk send voicemails as mp3 files is to use the script found on This script even extracts the message number, sender name, sender number, etc. and inserts them as tags into the mp3 file. It even allows you to insert a logo (cover art) for your company into the mp3 file. This scripts also ensure that you can playback voicemail files on android phones! (Format compatability)

Alternatively, you can follow this article Asterisk - Setup voicemail to send email with mp3 attachment to get a detailed explaination how to setup Asterisk to send voicemail by email with mp3 audio attachment. This method uses only bash script and usual linux tools.

Here is another method for sending voicemail as an MP3 using a perl script that works just fine.

note: my <pathto> is /var/lib, some peoples will be /usr/share.
1. ensure "attachfmt=wav" and "format=wav|gsm"
2. Put the below script in: /<pathto>/asterisk/agi-bin/
3. chmod a+rx
4. modify mailcmd=perl /<pathto>/asterisk/agi-bin/
5. install lame if you don't already have it
6. check the path to perl, base64, dos2unix and lame and modify the script and mailcmd as needed. (If you are getting 0kb files, your path to lame is likely wrong.)

open(VOICEMAIL,"|/usr/sbin/sendmail -t");
open(LAMEDEC,"|/usr/bin/dos2unix|/usr/bin/base64 -di|/usr/local/bin/lame --quiet --preset voice - /var/spool/asterisk/tmp/vmout.$$.mp3");
my $inaudio = 0;
loop: while(<>){
    last loop;
  if(/^Content-Type: audio\/x-wav/i){
    $inaudio = 1;
      iloop: while(<>){
        print LAMEDEC $_;
          last iloop;
      print VOICEMAIL "\n";
      print VM "\n";
      open(B64,"/usr/bin/base64 /var/spool/asterisk/tmp/vmout.$$.mp3|");
        print VOICEMAIL $_; 
	print VM $_;	
      print VOICEMAIL "\n";
      print VM "\n";
      $inaudio = 0;
  print VOICEMAIL $_;
  print VM $_;
print VOICEMAIL "\.";
print VM "\.";

#This has to be done in a separate cron type job
#because unlinking at the end of this script is too fast,
#the message has not even gotten piped to send mail yet

attribution: minor modifications to script from user "analognipple" from


Old versions:

See Also

Created by: rgauss, Last modification: Fri 09 of Jan, 2015 (17:07 UTC) by jdmphone
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+