FYI No voicemail were send via mail

GI-Tech

New Member
Joined
Sep 1, 2020
Messages
11
Reaction score
3
Hi folks,

my IncrediblePBX is running fantastic, but now there is a problem I can't fix so far.

I changed my iPBX-D 2027 to send mails via msmtp and my mail accout.
My mail.rc is configured like this:
Bash:
set mta=/usr/bin/msmtp
set sendmail="usr/bin/msmtp"

That works perfekt on the bash.

My voicemail.conf has the entry
Code:
mailcmd=/usr/local/sbin/sendmailmp3

All voicemails are stored in the iPBX, I can access them via phone but no email is send.

The output of asterisks after talking to the voicemail is telling me this:
Code:
-- <PJSIP/provider> Playing 'beep.g722' (language 'de_DE')
-- Recording the message
-- x=0, open writing:  /var/spool/asterisk/voicemail/default/100/tmp/bxYuQz format: wav, 0x7f7d5c01a990
-- x=1, open writing:  /var/spool/asterisk/voicemail/default/100/tmp/bxYuQz format: wav49, 0x7f7d5c00e560
-- User hung up
== Spawn extension (macro-vm, s-NOMESSAGE, 3) exited non-zero on 'PJSIP/provider' in macro 'vm'
== Spawn extension (ext-local, vms100, 1) exited non-zero on 'PJSIP/provider'
-- Executing [h@ext-local:1] Macro("PJSIP/provider", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("PJSIP/provider", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("PJSIP/provider", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:4] Hangup("PJSIP/provider", "") in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'PJSIP/provider' in macro 'hangupcall'
== Spawn extension (ext-local, h, 1) exited non-zero on 'PJSIP/provider'

Can you help me to understand what is happening and/or how to fix?

Thanks!

Edit:
In addition: my extensions_additional.conf is untouched...

Code:
[macro-hangupcall]
include => macro-hangupcall-custom
exten => s,1(start),GotoIf($["${USE_CONFIRMATION}"="" | "${RINGGROUP_INDEX}"="" | "${CHANNEL}"!="${UNIQCHAN}"]?theend)
exten => s,n(delrgi),Noop(Deleting: RG/${RINGGROUP_INDEX}/${CHANNEL} ${DB_DELETE(RG/${RINGGROUP_INDEX}/${CHANNEL})})
exten => s,n(theend),ExecIf($["${ONETOUCH_RECFILE}"!="" & "${CDR(recordingfile)}"=""]?Set(CDR(recordingfile)=${ONETOUCH_RECFILE}))
exten => s,n(hangup),Hangup
exten => s,n,MacroExit()

;--== end of [macro-hangupcall] ==--;
 
Last edited:
I changed my iPBX-D 2027 to send mails via msmtp and my mail accout.
My mail.rc is configured like this:
Well you seem to have wandered a bit off the reservation, and you are trying to re-invent the voicemail to email, or whatever.
Assuming you are following the tutorial found on the Products page of the Wiki, see Incredible PBX 2027 for Debian 11 and there is particular reference to using Gmail as a Smarthost for sendmail in the section headed

'Next Steps with Incredible PBX 2027'​

If you trouble to read the script '/root/enable-gmail-smarthost-for-sendmail' at line 4 it states or
echo "Gmail SmartHost is already installed."
This setup is fully prescribed and works to route your email through your gmail account to whatever email server want to collect your mail from.

There should be a script on your Debian something server which needed to be run before you decided to change things. It is generally better to stick with the tutorials, that you can find on the Incredible Tiki Wiki in particular the Issues of Interest
Use the following script to do what it says. There are good reasons why those here tend to stick with what works.
Bash:
/root/enable-gmail-smarthost-for-sendmail

When you insist on wandering from the reservation so to speak - it means you will be on your own, unless someone can understand what you are doing and comes to the rescue.
 
Last edited:
Well you seem to have wandered a bit off the reservation, and you are trying to re-invent the voicemail to email, or whatever.
Assuming you are following the tutorial found on the Products page of the Wiki, see Incredible PBX 2027 for Debian 11 and there is particular reference to using Gmail as a Smarthost for sendmail in the section headed

'Next Steps with Incredible PBX 2027'​

If you trouble to read the script '/root/enable-gmail-smarthost-for-sendmail' at line 4 it states or
echo "Gmail SmartHost is already installed."
This setup is fully prescribed and works to route your email through your gmail account to whatever email server want to collect your mail from.

There should be a script on your Debian something server which needed to be run before you decided to change things. It is generally better to stick with the tutorials, that you can find on the Incredible Tiki Wiki in particular the Issues of Interest
Use the following script to do what it says. There are good reasons why those here tend to stick with what works.
Bash:
/root/enable-gmail-smarthost-for-sendmail

When you insist on wandering from the reservation so to speak - it means you will be on your own, unless someone can understand what you are doing and comes to the rescue.
If you obtain the credentials for IBM Watson platform you can edit the text file that you mentioned at /usr/local/sbin/sendmailmp3 and plug in your shiny new API-KEY to enable the voicemail transcription. I have not checked if Watson supports voicemail to DE
 
@GI-Tech

Look in the /var/logs path and see what's in your mail log ..

Then in your messages log --

You may find your answers i one or the other -
 
Have you made sure that your mail works fine from your Debian CLI? That's the first step - keep it simple and make things work properly from outside FreePBX before you go inside.
 
@GI-Tech

Look in the /var/logs path and see what's in your mail log ..

Then in your messages log --

You may find your answers i one or the other -
That is where die "magic" happens... No logs, nothing indicating an error...


Have you made sure that your mail works fine from your Debian CLI? That's the first step - keep it simple and make things work properly from outside FreePBX before you go inside.
For sure, that's what I tried first... no problems at all.



Assuming you are following the tutorial found on the Products page of the Wiki, see Incredible PBX 2027 for Debian 11 and there is particular reference to using Gmail as a Smarthost for sendmail in the section headed

[...]​

Use the following script to do what it says. There are good reasons why those here tend to stick with what works.
The script didn't work since I can't use gmail and have to use a different smtp-server - so modifications have to be made anyways.

But before doing so I took a firm look to the script which does nothing "different".
The script just configures sendmail, which is replaced in my setup to msmtp. The pure function test on the script is
Code:
echo "echo \"test\" | mail -s testmessage [email protected]"
This test works for me from cli just fine like mentioned above. (I just replaced sendmail with some other...)

And that's where my understanding ends...
Where can I find logs on which action is called through asterisk?
Code:
exited non-zero
implies for me that there is an error. But which since all my mail logs and asterisk logs or the console does not show anything.

When and where is the voicemail.conf file called? Is is called?


Edit:
I forgot to mention that mails from the usermanager, security etc. work just fine. Only voicemail isn't working...
 
Last edited:
If you obtain the credentials for IBM Watson platform you can edit the text file that you mentioned at /usr/local/sbin/sendmailmp3 and plug in your shiny new API-KEY to enable the voicemail transcription. I have not checked if Watson supports voicemail to DE
Just saw your comment above:
I have no watson STT functions in use or even want to use it, it's all left default...

But even if I change the voicemail.conf mailcmd to /usr/sbin/sendmail there is no success...
 
Just saw your comment above:
I have no watson STT functions in use or even want to use it, it's all left default...

But even if I change the voicemail.conf mailcmd to /usr/sbin/sendmail there is no success...
what do you get if you do the code below in the Linux CLI? On my (debian like, ubuntu I get the commented out result below with sendmail showing as installed and msmtp is not installed.
Code:
apt list sendmail msmtp
# Listing... Done
# msmtp/jammy 1.8.16-1 amd64
# sendmail/jammy,now 8.15.2-22ubuntu3 all [installed]
The suggested wisdom is to do a full ./incrediblebackup prior to changing the vanilla install. Sorry if that is sort of sounds like famous last words, but if you installed msmtp it will have altered the sendmail setup else uninstalled it.
 
I got this listing with uninstalled sendmail
Bash:
apt list sendmail msmtp
Listing... Done
msmtp/stable,now 1.8.11-2.1 amd64 [installed]
sendmail/stable 8.15.2-22 all


But I don't think the error is through the mtp client used... I guess there is something wrong within the asterisk conf...

I just noticed that the voicemail.conf has the following default entries:
Bash:
[default]
100=,main,[email protected],,attach=yes|saycid=no|envelope=no|delete=no
21=,ceo,[email protected],,attach=yes|saycid=no|envelope=no|delete=no
can you confirm, that the "=" is correct? shouldn't it be "=>"?

Do you know where the settings from voicemail.conf were called? And where are those created? Every fwconsole reload the file is overwritten...
 
msmtp/stable,now 1.8.11-2.1 amd64 [installed] sendmail/stable 8.15.2-22 all
You could try the following and see how you go.
Bash:
cd ~/
apt remove -y msmtp
apt update && apt upgrade
apt install -y sendmail
#get your credentials for your gmail.com account as the tutorial
/root/enable-gmail-smarthost-for-sendmail

echo 'echo "test email message body" | mail -s "testmessage subject" /etc/hostname [email protected]' > send-testmessage
chmod +x send-testmessage
# edit to customise  /root/send-testmessage
# and ensure you use your useratgmail address
./send-testmessage
Otherwise you could start over; but follow the tutorial to the letter.
That way you can be sure that your incrediblePBX won't choke when you login as root and automatic updates are automatically run.
Regards
 
Last edited:
From the Asterisk CLI

Code:
core set debug 10 app_voicemail.so

Leave a voicemail, it will output all the details for attaching and emailing the notification and message along with any issues that might happen. When you're done remember to do

Code:
core set debug 0 app_voicemail.so
 

Members online

No members online now.

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top