Voicemail notifications to users email

Hello…
I am using Asterisk-13 and voicemails to emails are not working.
-I have enabled the IMAP voicemail storage and using POSTFIX MTA which is running perfectly and able to send emails from the command line using “echo” cmd
-I have configured the voicemail.conf and added the mailcmd=/usr/sbin/postfix, also given user email id in default context in my voicemail.conf.

here is the voicemail.conf file
;
; Voicemail Configuration
;

; ********* NOTICE ************************************************************
;
; NOTE: Asterisk has to edit this file to change a user’s password. This does
; not currently work with the "#include " directive for Asterisk
; configuration files, nor when using realtime static configuration.
; Do not use them with this configuration file.
;
; NOTE: Mailboxes defined by app_voicemail MUST be referenced by the rest
; of the system as mailbox@context. The rest of the system cannot add
; @default to mailbox identifiers for app_voicemail that do not specify a
; context any longer. It is a mailbox identifier format that should only
; be interpreted by app_voicemail.
;
; ********* NOTICE ************************************************************

[general]
; Formats for writing Voicemail. Note that when using IMAP storage for
; voicemail, only the first format specified will be used.
;format=g723sf|wav49|wav
;format=wav49|gsm|wav
format=wav

;
; WARNING:
; If you change the list of formats that you record voicemail in
; when you have mailboxes that contain messages, you MUST absolutely
; manually go through those mailboxes and convert/delete/add the
; the message files so that they appear to have been stored using
; your new format list. If you don’t do this, very unpleasant
; things may happen to your users while they are retrieving and
; manipulating their voicemail.
;
; In other words: don’t change the format list on a production system
; unless you are VERY sure that you know what you are doing and are
; prepared for the consequences.
;
; Who the e-mail notification should appear to come from
;serveremail=asterisk@linux-support.net
serveremail=uzma.anjum@atriait.com

; Should the email contain the voicemail as an attachment
attach=yes

; Maximum number of messages per folder. If not specified, a default value
; (100) is used. Maximum value for this option is 9999. If set to 0, a
; mailbox will be greetings-only.

maxmsg=1000

; Maximum length of a voicemail message in seconds
;maxsecs=180
; Minimum length of a voicemail message in seconds for the message to be kept
; The default is no minimum.
;
minsecs=3

; Maximum length of greetings in seconds
;maxgreet=60
; How many milliseconds to skip forward/back when rew/ff in message playback

skipms=3000

; How many seconds of silence before we end the recording

;maxsilence=10

; Silence threshold (what we consider silence: the lower, the more sensitive)
silencethreshold=128

; Max number of failed login attempts

maxlogins=3

;
; Move heard messages to the ‘Old’ folder automagically. Defaults to on.
;moveheard=yes
;
; Forward an urgent message as an urgent message. Defaults to no so
; sender can set the urgency on the envelope of the forwarded message.
;forward_urgent_auto=no
;
; User context is where entries from users.conf are registered. The
; default value is ‘default’
;
userscontext=default
;
; If you need to have an external program, i.e. /usr/bin/myapp
; called when a voicemail is left, delivered, or your voicemailbox
; is checked, uncomment this.
;externnotify=/usr/bin/myapp
;externnotify=/home/halo/bin/VMMWI

; If you would also like to enable SMDI notification then set smdienable to yes.
; You will also need to make sure smdiport is set to a valid port as specified in
; smdi.conf.
;smdienable=yes
;smdiport=/dev/ttyS0

; If you need to have an external program, i.e. /usr/bin/myapp
; called when a voicemail password is changed, uncomment this. The
; arguments passed to the application are:
; Note: If this is set, the password will NOT be changed in voicemail.conf
; If you would like to also change the password in voicemail.conf, use
; the externpassnotify option below instead.
;externpass=/usr/bin/myapp
;externpassnotify=/usr/bin/myapp

; If you would like to have an external program called when a user changes the
; voicemail password for the purpose of doing validation on the new password,
; then use this option. The script can decide whether or not the new password
; meets minimum password strength requirements before the Voicemail application
; accepts the password. If the script decides that the password is not acceptable,
; the user will be informed that the new password does not meet minimum password
; requirements, and they will be asked to enter another password.
;
; The arguments passed to this script are .
;
; The script should print “VALID” to stdout to indicate that the new password
; is acceptable. If the password is considered too weak, the script should print
; “INVALID” to stdout.
;
; There is an example script in the contrib/scripts/ directory, voicemailpwcheck.py,
; which implements some basic password checking, and can be used as a starting point
; for use with this option.
;
;externpasscheck=/usr/local/bin/voicemailpwcheck.py

; For the directory, you can override the intro file if you want
directoryintro=dir-intro
; The character set for voicemail messages can be specified here
;default: ISO-8859-1
charset=UTF-8
; The ADSI feature descriptor number to download to
;adsifdn=0000000F
; The ADSI security lock code
;adsisec=9BDBF7AC
; The ADSI voicemail application version number.
;adsiver=1
; Skip the “[PBX]:” string from the message title
pbxskip=yes
; Change the From: string
;
;fromstring=The Asterisk PBX
fromstring=Asterisk PBX voicemail
; Permit finding entries for forward/compose from the directory
usedirectory=yes
; Voicemail can be stored in a database using the ODBC driver.
; The value of odbcstorage is the database connection configured
; in res_odbc.conf.
;odbcstorage=asterisk
; The default table for ODBC voicemail storage is voicemessages.
;odbctable=voicemessages
;
; Change the from, body and/or subject, variables:
; VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_CIDNUM,
; VM_CIDNAME, VM_DATE
; Additionally, on forwarded messages, you have the variables:
; ORIG_VM_CALLERID, ORIG_VM_CIDNUM, ORIG_VM_CIDNAME, ORIG_VM_DATE
; You can select between two variables by using dialplan functions, e.g.
; ${IF(${ISNULL(${ORIG_VM_DATE})}?${VM_DATE}:${ORIG_VM_DATE})}
;
; Note: The emailbody config row can only be up to 512 characters due to a
; limitation in the Asterisk configuration subsystem.

emailsubject=[PBX]: New message ${VM_MSGNUM} in mailbox ${VM_MAILBOX}

; The following definition is very close to the default, but the default shows
; just the CIDNAME, if it is not null, otherwise just the CIDNUM, or “an unknown
; caller”, if they are both null.
emailbody=Dear ${VM_NAME}:\n\n\tjust wanted to let you know you were just left a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE}, so you might\nwant to check it when you get a chance. Thanks!\n\n\t\t\t\t–Asterisk\n
;
; Note: ${IF()} strips spacing at the beginning and end of its true and false
; values, so a newline cannot be placed at either location. The word ‘so’ is
; therefore duplicated, in order for the newline to be interpreted correctly.
emailbody=Dear ${VM_NAME}:\n\n\tjust wanted to let you know you were just ${IF($["${VM_CIDNUM}" = “${ORIG_VM_CIDNUM}”]?left:forwarded)} a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from ${VM_CALLERID}, on ${VM_DATE},\n${IF($["${VM_CIDNUM}" = “${ORIG_VM_CIDNUM}”]?so:(originally sent by ${ORIG_VM_CALLERID} on ${ORIG_VM_DATE})\nso)} you might want to check it when you get a chance. Thanks!\n\n\t\t\t\t–Asterisk\n
;
; You can also change the Pager From: string, the pager body and/or subject.
; The above defined variables also can be used here
;pagerfromstring=The Asterisk PBX
;pagersubject=New VM
;pagerbody=New ${VM_DUR} long msg in box ${VM_MAILBOX}\nfrom ${VM_CALLERID}, on ${VM_DATE}
;
; Set the date format on outgoing mails. Valid arguments can be found on the
; strftime(3) man page
;
; Default
emaildateformat=%A, %B %d, %Y at %r
; 24h date format
;emaildateformat=%A, %d %B %Y at %H:%M:%S
;
; Default for pager use
pagerdateformat=%A, %B %d, %Y at %r
; Short 24h date format for pager use
;pagerdateformat=%T %D
;
; Using the mailcmd option, you can specify what command is called for
; outbound E-mail. The default is shown below.
;

mailcmd=/usr/sbin/postfix
;
pollmailboxes=no ; If mailboxes are changed anywhere outside of app_voicemail,
; ; then this option must be enabled for MWI to work. This
; ; enables polling mailboxes for changes. Normally, it will
; ; expect that changes are only made when someone called in
; ; to one of the voicemail applications.
; ; Examples of situations that would require this option are
; ; web interfaces to voicemail or an email client in the case
; ; of using IMAP storage.
; ; Default: no
pollfreq=30 ; If the “pollmailboxes” option is enabled, this option
; ; sets the polling frequency. The default is once every
; ; 30 seconds.
;

; -----------------------------------------------------------------------------
; IMAP configuration settings only
; These settings are only applicable when Asterisk is compiled with IMAP support.
;

imapgreetings=yes ; If using IMAP storage, specify whether voicemail greetings
; should be stored via IMAP. If no, then greetings are stored
; as if IMAP storage were not enabled.
greetingsfolder=INBOX ; If imapgreetings=yes, then specify which folder to store
; your greetings in. If you do not specify a folder, then INBOX
; will be used
imapparentfolder=INBOX ; Some IMAP server implementations store folders under INBOX
; instead of using a top level folder (ex. INBOX/Friends). In
; this case, user imapparentfolder to set the parent folder. For
; example, Cyrus IMAP does NOT use INBOX as the parent. Default
; is to have no parent folder set.
imapserver=imap.gmail.com ; The address of the IMAP server
imapport=993 ; The port of the IMAP server
imapflags=ssl ; Optional flags to pass to the IMAP server in the IMAP mailbox
; name. For example, setting this to ‘ssl’ will enable OpenSSL
; encryption, assuming the IMAP libraries were compiled with
; OpenSSL support.
imapfolder=Inbox ; The folder in which to store voicemail messages on the IMAP
; server. By default, they are stored in INBOX.
authuser=uzma.xxxxx@xxxx.com ; The master user to use for connecting to the IMAP server, if
; the server is configured with a single user that has access to
; all mailboxes
authpassword=XXXXX123 ; The password for the authuser, if used
;imapopentimeout=60 ; The TCP open timeout (in seconds)
;imapclosetimeout=60 ; The TCP close timeout (in seconds)
;imapreadtimeout=60 ; The TCP read timeout (in seconds)
;imapwritetimeout=60 ; The TCP write timeout (in seconds)

; -----------------------------------------------------------------------------
;

; Each mailbox is listed in the form =,,,<pager_email>,
; If email is specified, a message will be sent when a voicemail is received, to
; the given mailbox, for each address listed (separated by |, ex. alice@foo.com|bob@foo.com).
; If pager is specified, a message will be sent there as well. If the password
; is prefixed by ‘-’, then it is considered to be unchangeable.
;
; Advanced options example is extension 4069
; NOTE: All options can be expressed globally in the general section, and
; overridden in the per-mailbox settings, unless listed otherwise.
;
tz=central ; Timezone from zonemessages below. Irrelevant if envelope=no.
locale=de_DE.UTF-8 ; set the locale for generation of the date/time strings (make
; sure the locales are installed in your operating system; e.g
; on Debian Linux you can use “dpkg-reconfigure locales”).
; If you use UTF-8 locales, make sure to set the “charset” option
; to UTF-8 too. If you mix different locales for different users
; you should avoid words in the emaildateformat specification, e.g.:
; emaildateformat=%A, %d %B %Y, %H:%M:%S
attach=yes ; Attach the voicemail to the notification email NOT the pager email
attachfmt=wav ; Which format to attach to the email. Normally this is the
; first format specified in the format parameter above, but this
; option lets you customize the format sent to particular mailboxes.
; Useful if Windows users want wav49, but Linux users want gsm.
; [per-mailbox only]
saycid=yes ; Say the caller id information before the message. If not described,
; or set to no, it will be in the envelope. When enabled, if a recorded file
; with the same name as the caller id exists in
; /recordings/callerids, then that file will be played as a name
; rather than saying each digit as a phone number.
; cidinternalcontexts=intern ; Internal Context for Name Playback instead of
; extension digits when saying caller id.
; sayduration=no ; Turn on/off the duration information before the message. [ON by default]
; saydurationm=2 ; Specify the minimum duration to say. Default is 2 minutes
; dialout=fromvm ; Context to dial out from [option 4 from mailbox’s advanced menu].
; If not specified, option 4 will not be listed and dialing out
; from within VoiceMailMain() will not be permitted.
sendvoicemail=yes ; Allow the user to compose and send a voicemail while inside
; VoiceMailMain() [option 5 from mailbox’s advanced menu].
; If set to ‘no’, option 5 will not be listed.
searchcontexts=yes ; Current default behavior is to search only the default context
; if one is not specified. The older behavior was to search all contexts.
; This option restores the old behavior [DEFAULT=no]
; Note: If you have this option enabled, then you will be required to have
; unique mailbox names across all contexts. Otherwise, an ambiguity is created
; since it is impossible to know which mailbox to retrieve when one is requested.
; callback=fromvm ; Context to call back from
; if not listed, calling the sender back will not be permitted
exitcontext=fromvm ; Context to go to on user exit such as * or 0
; The default is the current context.
review=yes ; Allow sender to review/rerecord their message before saving it [OFF by default
; operator=yes ; Allow sender to hit 0 before/after/during leaving a voicemail to
; reach an operator. This option REQUIRES an ‘o’ extension in the
; same context (or in exitcontext, if set), as that is where the
; 0 key will send you. [OFF by default]
envelope=yes ; Turn on/off envelope playback before message playback. [ON by default]
; This does NOT affect option 3,3 from the advanced options menu
delete=yes ; After notification, the voicemail is deleted from the server. [per-mailbox only]
; This is intended for use with users who wish to receive their
; voicemail ONLY by email. Note: “deletevoicemail” is provided as an
; equivalent option for Realtime configuration.
; alias=Bongo ; Use this additional string for comparison while looking
; for a match in the Directory application. This option
; may be specified multiple times to specify additional
; strings [per-mailbox only]
; volgain=0.0 ; Emails bearing the voicemail may arrive in a volume too
; quiet to be heard. This parameter allows you to specify how
; much gain to add to the message when sending a voicemail.
; NOTE: sox must be installed for this option to work.
; nextaftercmd=yes ; Skips to the next message after hitting 7 or 9 to delete/save current message.
; forcename=yes ; Forces a new user to record their name. A new user is
; determined by the password being the same as
; the mailbox number. The default is “no”.
; forcegreetings=no ; This is the same as forcename, except for recording
; greetings. The default is “no”.
; hidefromdir=yes ; Hide this mailbox from the directory produced by app_directory
; The default is “no”.
; tempgreetwarn=yes ; Remind the user that their temporary greeting is set

; passwordlocation=spooldir
; Usually the voicemail password (vmsecret) is stored in
; this configuration file. By setting this option you can
; specify where Asterisk should read/write the vmsecret.
; Supported options:
; voicemail.conf:
; This is the default option. The secret is read from
; and written to voicemail.conf (or users.conf).
; spooldir:
; The secret is stored in a separate file in the user’s
; voicemail spool directory in a file named secret.conf.
; Please ensure that normal Linux users are not
; permitted to access Asterisk’s spool directory as the
; secret is stored in plain text. If a secret is not
; found in this directory, the password in
; voicemail.conf (or users.conf) will be used.
; Note that this option does not affect password storage for
; realtime users, which are still stored in the realtime
; backend.
; messagewrap=no ; Enable next/last message to wrap around to
; first (from last) and last (from first) message
; The default is “no”.
; minpassword=0 ; Enforce minimum password length

; vm-password=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: “password”
; vm-newpassword=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: “Please enter your new password followed by
; the pound key.”
; vm-passchanged=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: “Your password has been changed.”
; vm-reenterpassword=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: “Please re-enter your password followed by
; the pound key”
; vm-mismatch=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: “The passwords you entered and re-entered
; did not match.”
; vm-invalid-password=custom_sound
; Customize which sound file is used instead of the default
; prompt that says: …
; vm-pls-try-again=custom_sound
; Customize which sound file is used instead of the
; default prompt that says “Please try again.”
; vm-prepend-timeout=custom_sound
; Customize which sound file is used when the user
; times out while recording a prepend message instead
; of the default prompt that says “then press pound”
; note that this will currently follow vm-pls-try-again.
; this behavior is subject to change in the near future.
; listen-control-forward-key=# ; Customize the key that fast-forwards message playback
; listen-control-reverse-key=* ; Customize the key that rewinds message playback
; listen-control-pause-key=0 ; Customize the key that pauses/unpauses message playback
; listen-control-restart-key=2 ; Customize the key that restarts message playback
; listen-control-stop-key=13456789 ; Customize the keys that interrupt message playback, probably all keys not set above

; Maximum number of messages allowed in the ‘Deleted’ folder. If set to 0
; or no then no deleted messages will be moved. If non-zero (max 9999) then up
; to this number of messages will be automagically saved when they are
; ‘deleted’ on a FIFO basis.
; defaults to being off
; backupdeleted=100

[zonemessages]
; Users may be located in different timezones, or may have different
; message announcements for their introductory message when they enter
; the voicemail system. Set the message and the timezone each user
; hears here. Set the user into one of these zones with the tz= attribute
; in the options field of the mailbox. Of course, language substitution
; still applies here so you may have several directory trees that have
; alternate language choices.
;
; Look in /usr/share/zoneinfo/ for names of timezones.
; Look at the manual page for strftime for a quick tutorial on how the
; variable substitution is done on the values below.
;
; Supported values:
; ‘filename’ filename of a soundfile (single ticks around the filename
; required)
; ${VAR} variable substitution
; A or a Day of week (Saturday, Sunday, …)
; B or b or h Month name (January, February, …)
; d or e numeric day of month (first, second, …, thirty-first)
; Y Year
; I or l Hour, 12 hour clock
; H Hour, 24 hour clock (single digit hours preceded by “oh”)
; k Hour, 24 hour clock (single digit hours NOT preceded by “oh”)
; M Minute, with 00 pronounced as “o’clock”
; N Minute, with 00 pronounced as “hundred” (US military time)
; P or p AM or PM
; Q “today”, “yesterday” or ABdY
; (*note: not standard strftime value)
; q “” (for today), “yesterday”, weekday, or ABdY
; (*note: not standard strftime value)
; R 24 hour time, including minute
;
eastern=America/New_York|‘vm-received’ Q ‘digits/at’ IMp
central=America/Chicago|‘vm-received’ Q ‘digits/at’ IMp
central24=America/Chicago|‘vm-received’ q ‘digits/at’ H N 'hours’
military=Zulu|‘vm-received’ q ‘digits/at’ H N ‘hours’ 'phonetic/z_p’
european=Europe/Copenhagen|‘vm-received’ a d b ‘digits/at’ HM

[default]
; Note: The rest of the system must reference mailboxes defined here as mailbox@default.
;4200 => 9855,Mark Spencer,markster@linux-support.net,mypager@digium.com,attach=no|serveremail=myaddy@digium.com|tz=central|maxmsg=10
;4110 => 3443,Rob Flynn,rflynn@blueridge.net
;4235 => 1234,Jim Holmes,jim@astricon.ips,Tz=european
;191 => 1234,uanjum,uzma.anjum@atriait.com
;988 => 123456,uzmatest-uzmaanju,uzmaanjum050@gmail.com,|tz=central|attach=yes|saycid=yes|dialout=fromvm|callback=fromvm|review=yes|operator=yes|envelope=yes|moveheard=yes|sayduration=yes|saydurationm=1
211 => 123456,test-final,useremail@gmail.com,example@ihalo.io,attach=yes|delete=1
133 => 123456,ucase-voicetest,useremail@xxxxx.com,attach=yes
144 => 123456,144,examplemail@xxxxx.com,useremail@xxxx.io,attach=yes
1123 => 123456,uzmaa-ihalo,uzma@xxxx.io,attach=yes
987 => 123456,testvm-halov,keerthi.priya@ihalo.io,attach=yes
9966 => 123456,ktt-ihalo,uzma@ihalo.io,attach=yes
;177 => 123456,vm-test,uzmaanjum050@gmail.com,attach=yes
177 => 177,uzmaanjum,attach=no|imapuser=uzmaanjum050@gmail.com|imappassword=anjum@007
188 => 123456,nm-test,uzmaanjum050@gmail.com,attach=yes
124 => 123456,vmail-final,uzmaanjum050@gmail.com,delete=1|emailsubject=you have a new voicemail.|emailbody=click on the attachment to listen.
887 => 123456,sand-ihalodevelopers,useremail@ihalo.io,attach=yes

;
; Mailboxes may be organized into multiple contexts for
; voicemail virtualhosting
;

[other]
;The intro can be customized on a per-context basis
;directoryintro=dir-company2
1234 => 5678,Company2 User,root@localhost

; example for our acme compartmentalized company
;
; Pete telecommutes from Chicago, so we’ll customize timestamps for him.
;
;[acme]
;111 => 7383,Pete,pete@acme-widgets.com,tz=central
;112 => 6262,Nancy,nancy@acme-widgets.com
;

;[context_vm]
;199 => 1234,anjum-voicet,uzmaanjum050@gmail.com

; ---------------------------------------------------------------------------
; IMAP user settings and overrides. These are only applicable when Asterisk is
; compiled with IMAP support.
;
imapuser=uzma.anjum ; The IMAP username of the mailbox to access
imappassword=password ; The IMAP password of the user
imapvmshareid=xxxx ; A shared mailbox ID to use for the IMAP mailbox
; login, as opposed to the mailbox dialed
imapfolder=inbox ; Overrides the global imapfolder setting
imapserver=imap.gmail.com ; Overrides the global imapserver setting
imapport=993 ; Overrides the global imapport setting
imapflags=ssl ; Overrides the global imapflags setting

;
;[imapvm]
;4324 => 7764,Ellis Redding,red@buxton.us,imapuser=eredding|imappassword=g3tbusy|imapfolder=notinbox
;4325 => 2392,Andrew Dufresne,andy@dufresne.info,imapuser=adufresne|imappassword=rockh@mmer

But, still voicemails are not being sent as emails.
Please someone help me in this.
Thanks in advance

Check your mail log, see what happens there…

If nothing happens then the email action is not called correctly.

1 Like

Thanks for the reply.
I have checked the mail log from /var/log/syslog which gives me postfix
logs as given below.

postfix/cleanup[28416]: AFF3845B61:
message-id=20180306084707.AFF3845B61@example.localdomain
postfix/qmgr[28407]: AFF3845B61: from=root@example.localdomain, size=450,
nrcpt=1 (queue active)
postfix/smtp[28418]: AFF3845B61: to=uzmaanjum050@gmail.com, relay=
smtp.gmail.com[173.194.205.108]:25, delay=1.7, delays=0.02/0.04/0.4/1.3,
dsn=2.0.0, status=sent (250 2.0.0 OK 1520326029 k11sm8027709qtb.90 - gsmtp)
postfix/qmgr[28407]: AFF3845B61: removed

And when a leave a voicemail the asterisk CLI shows as below

ERROR[1656][C-00000835]: chan_sip.c:26271 handle_request_invite:
*******************Redirecting number:(null)
– Executing [ivr-0-test@public:1] Switch(“SIP/107.xxx.xx.xx-0000083e”,
"") in new stack
NOTICE[1778][C-00000835]: app_switch.c:82 switch_exec: [switch_exec]
FROMDOMAIN:107.xxx.xx.xx, EXTEN:ivr account_name:test
– Executing [ivr-0-test@public:21]
Answer(“SIP/107.xxx.xx.xx-0000083e”, “”) in new stack
– Executing [ivr-0-test@public:22]
Autoattendant(“SIP/107.xxx.xx.xx-0000083e”,
"/home/halo/asterisk/var/lib/asterisk/sounds/en/custom/accivrdefault") in
new stack
– <SIP/107.xxx.xx.xx-0000083e> Playing
’/home/halo/asterisk/var/lib/asterisk/sounds/en/custom/accivrdefault.gsm’
(language ‘en’)
NOTICE[1778][C-00000835]: app_getivrexten.c:175 autoattendent_exec:
Routing to Exten : 188
– Executing [188-test@extenbridge:1]
Dial(“SIP/107.xxx.xx.xx-0000083e”, “SIP/188-test@107.xxx.xx.xx:1008, 20”)
in new stack
== Using SIP RTP CoS mark 5
– Called SIP/188-test@107.170.69.191:1008
– SIP/107.170.69.191:1008-0000083f is ringing
– SIP/107.170.69.191:1008-0000083f is ringing
– Got SIP response 486 “Busy here” back from 107.xxx.xx.xxx:xxxx
– SIP/107.xxx.xx.xxx:xxxx-0000083f is busy
== Everyone is busy/congested at this time (1:1/0/0)
– Executing [188-test@extenbridge:2]
VoiceMail(“SIP/107.xxx.xx.xxx-0000083e”, “188-test,u”) in new stack
NOTICE[1778][C-00000835]: app_voicemail.c:1742 find_vm_user: query:select
u.max_voicemails,u.password,a.id from account_info a, users u where
a.id=u.account_id
and u.extension=188 and replace(a.name,’.’,’-’)=‘test’
[Mar 6 09:44:47] ERROR[1778][C-00000835]: app_voicemail.c:1781
find_vm_user: user_found : 1, context:test, mailbox:188, max_voicemails:25
– <SIP/107.xxx.xx.xxx-0000083e> Playing ‘vm-theperson.gsm’ (language
’en’)
– <SIP/ 107.xxx.xx.xxx -0000083e> Playing ‘digits/1.gsm’ (language
’en’)
– <SIP/107.xxx.xx.xxx -0000083e> Playing ‘digits/8.gsm’ (language ‘en’)
– <SIP/ 107.xxx.xx.xxx -0000083e> Playing ‘digits/8.gsm’ (language
’en’)
– <SIP/ 107.xxx.xx.xxx -0000083e> Playing ‘vm-isunavail.gsm’ (language
’en’)
– <SIP/ 107.xxx.xx.xxx -0000083e> Playing ‘vm-intro.gsm’ (language
’en’)
– <SIP/ 107.xxx.xx.xxx -0000083e> Playing ‘beep.gsm’ (language ‘en’)
– Recording the message
– x=0, open writing:
/home/halo/asterisk/var/spool/asterisk/voicemail/test/188/tmp/qISsWv
format: wav, 0x7f9a28087d48
– User hung up
== Spawn extension (extenbridge, 188-test, 2) exited non-zero on ‘SIP/
107.xxx.xx.xxx -0000083e’
– Executing [h@extenbridge:1] Hangup(“SIP/ 107.xxx.xx.xxx -0000083e”,
"") in new stack
== Spawn extension (extenbridge, h, 1) exited non-zero on ‘SIP/
107.xxx.xx.xxx -0000083e’

But that is not sent as email to users.
Please help.Thank you

You have to check if the email that should be send by asterisk is in the mail log file…
In the voicemail conf you have 188 => 123456,nm-test,uzmaanjum050@gmail.com,attach=yes

The mail log shows that an email is send to uzmaanjum050@gmail.com, is this the email that is send by Asterisk? If not then you have to start troubleshooting with the voicemail.conf.

Test the configured mail command from cli, see if that works…(/usr/sbin/postfix), work form there…

It looks like your Postfix is not configured properly, example.localdomain is not a valid DNS name.

You need to properly configure your server’s host & domain in postfix or you may get your mail rejected upstream.

Actually, I am new to asterisk and please correct me if I get anything wrong.

I have checked the asterisk mail log from /var/log/asterisk/messages and also from the console and I can see nothing more than this in logs

[Mar 7 11:03:10] ERROR[31531][C-00000003] chan_sip.c: *******************Redirecting number:(null)
[Mar 7 11:03:10] NOTICE[15198][C-00000003] app_switch.c: [switch_exec] FROMDOMAIN:107.170.69.191, EXTEN:ivr account_name:test
[Mar 7 11:03:18] NOTICE[15198][C-00000003] app_getivrexten.c: Routing to Exten : 188
[Mar 7 11:03:35] NOTICE[15198][C-00000003] app_voicemail.c: query:select u.max_voicemails,u.password,a.id from account_info a, users u where a.id=u.account_id and u.extension=188 and replace(a.name,’.’,’-’)=‘test’
[Mar 7 11:03:35] ERROR[15198][C-00000003] app_voicemail.c: user_found : 1, context:test, mailbox:188, max_voicemails:25

And configured postfix, tested the mail command (/usr/sbin/postfix) from cli and it is working, tested using the command mail also from there.this is how it is showing after mail sent from cli.

postfix/pickup[31276]:6080245C02: uid=0 from=root@halo-dev-ubuntu-512mb-nyc2-01.localdomain.com
postfix/cleanup[7216]: 6080245C02: message-id=20180307104957.6080245C02@halo-dev-ubuntu-512mb-nyc2-01.localdomain
postfix/qmgr[31278]: 6080245C02: from=root@halo-dev-ubuntu-512mb-nyc2-01.localdomain.com, size=426, nrcpt=1 (queue active)
postfix/smtp[7218]: 6080245C02: to=uzmaanjum050@gmail.com, relay=smtp.gmail.com[173.194.206.109]:25, delay=1.2, delays=0.01/0/0.35/0.84, dsn=2.0.0, status=sent (250 2.0.0 OK 1520419798 u37sm11910895qtj.33 - gsmtp)
postfix/qmgr[31278]: 6080245C02: removed

I am not getting where can it be wrong,please help.

The postfix log shows that the message being logged was sent successfully. If that is your message, you need to look closer to the recipient.

Hello.thanks for ur reply.
The postfix logs are showing the message as sent…that email is sent from the command line and it has reached the Email address.But whenever I leave the voicemail from asterisk, I don’t get notified of emails even I have the mail cmd (/usr/sbin/postfix) in voicemail.conf…and also not showing any such logs from asterisks side on voicemail emails.