Voicemail attachment mails are not sent

Hello, I have this problem on just one FreePBX system, out of hundreds. The system just doesn’t seem to send voice attachments via email.

Everything is configured as usual, if I use the “mail” command from the command line it works, but attachments don’t seem to be sent at all.

This is a sample of what I get on the console, from the beep onwards:

-- <SIP/CI_IN_2-00004823> Playing 'beep.ulaw' (language 'it') -- Recording the message -- x=0, open writing: /var/spool/asterisk/voicemail/default/99/tmp/Y2lqPI format: wav, 0x646328f0 -- User hung up == Parsing '/var/spool/asterisk/voicemail/default/99/INBOX/msg0100.txt': Found == Parsing '/var/spool/asterisk/voicemail/default/99/INBOX/msg0100.txt': Found == Parsing '/var/spool/asterisk/voicemail/default/99/INBOX/msg0100.txt': Found == Spawn extension (macro-vm, s-NOMESSAGE, 3) exited non-zero on 'SIP/CI_IN_2-00004823' in macro 'vm' == Spawn extension (ext-local, vms99, 1) exited non-zero on 'SIP/CI_IN_2-00004823' -- Executing [h@ext-local:1] Macro("SIP/CI_IN_2-00004823", "hangupcall,") in new stack -- Executing [s@macro-hangupcall:1] GotoIf("SIP/CI_IN_2-00004823", "1?theend") in new stack -- Goto (macro-hangupcall,s,3) -- Executing [s@macro-hangupcall:3] ExecIf("SIP/CI_IN_2-00004823", "0?Set(CDR(recordingfile)=)") in new stack -- Executing [s@macro-hangupcall:4] NoOp("SIP/CI_IN_2-00004823", " montior file= ") in new stack -- Executing [s@macro-hangupcall:5] GotoIf("SIP/CI_IN_2-00004823", "1?skipagi") in new stack -- Goto (macro-hangupcall,s,7) -- Executing [s@macro-hangupcall:7] Hangup("SIP/CI_IN_2-00004823", "") in new stack == Spawn extension (macro-hangupcall, s, 7) exited non-zero on 'SIP/CI_IN_2-00004823' in macro 'hangupcall' == Spawn extension (ext-local, h, 1) exited non-zero on 'SIP/CI_IN_2-00004823'

Does anybody have ideas? Thanks a lot.

Have you verified that the system has plenty of free disk space? If there’s not enough free disk space, it won’t be able to write the files, so won’t be able to attach them.

I’ve also seen this happen after ASTDB became corrupt, but that seems far less likely.

Yes, but it’s almost empty. Anyway, I think the problem is the old age of this system (RasPBX from ages ago). It doesn’t update, has problem with repositories, old versions of everything and so on.

But I fixed it bypassing FreePBX: I created a script which browses the folders where voicemail files are saved, sends the wav via mail as attachment with some info extracted from the txt file, moves the files in a subfolder and deletes them after 3 months. Seems to work fine with cron.

A long time ago I had similar problems

using write_close on /var/spool/asterisk/voicemail (monitor)