Asterisk :Customize the email notification message

The template for the notification email is stored in the ${emailbody} variable, defined in voicemail.conf or one of its includes. You just have to define it. Feel free to mix in any of these system variables while you’re at it:

VM_NAME

The name of the subscriber for whom the message was left

VM_DUR

The duration, in seconds, of the message

VM_MSGNUM

The number of the message relative to the subscriber’s mailbox

VM_MAILBOX

The mailbox number of the subscriber

VM_CALLERID

The caller ID string for the caller who left the message

VM_DATE

The date and time the message was left, relative to the time zone specified in voicemail.conf for this subscriber

Consider the following email body declaration:

*************************************************************************************************

    emailbody=Hello ${VM_NAME},nnThere is a new voice mail message in mailbox number ${
VM_MAILBOX}. It was left on ${VM_DATE} from ${VM_CALLERID}. To listen to this message,
dial 1000 from your desk phone or from an outside phone.
    nnThanks,nThe Kartook Voicemail Test System

*************************************************************************************************

This message would appear more or less as follows, when used to send a voice mail notification:

Hello kartook,

    There is a new voicemail message in mailbox number 7200. It was left on 3/23/2009
12:42:42 from (440) 111-1111. To listen to this message, dial 1000 from your desk phone
or from an outside phone.

    Thanks,
    The Kartook Voicemail Test System

The n token, common in Unix, starts a new line. If the recorded message were actually attached to the email, we would need to use a different message template, indicating that.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.