Voicemail to email - that is the plan, anyway

This is my first swipe at FreePBX and Asterisk so I have a lot to learn. Thanks for any help with this in advance :slight_smile:

I have a ‘relatively’ clean install of FreePBX 13.0.192.9 and postfix installed to relay through google . With help, I’ve managed to get it working with 2 trunks (google) and 2 extensions and now am trying to implement sending email notifications of a voicemail just left.

However, no email goes out. I’ve searched to find if I’m missing something in the configuration but ‘believe’ I have everything. Both extensions have a valid email address to send to and Voicemail->Settings->Email Config has a valid from: email address. Not knowing if a mailcmd entry was necessary or not, I’ve tried without and with ( /usr/sbin/sendmail -v -t -f [email protected] . I can send mail from the command line and freepbx sends mails when I do a backup - but I get nothing from a voicemail and there is no mention of any attempt to send any mail in the mail.log so certainly I’ve missed something BUT when I look at the asterisk console out, I notice that the scripts are exiting in a non-zero state after the voicemail is left. …is this normal or is indicating some other issue besides me simply missing a configuration entry? (edited console out of the entire session for your entertainment)

 -- SIP/202-00000000 is ringing
    -- Nobody picked up in 15000 ms
    -- Executing [s@macro-dial-one:52] ExecIf("Motif/+13222222222-5f17", "0?MacroExit()") in new stack
    -- Executing [s@macro-dial-one:53] ExecIf("Motif/+13222222222-5f17", "0?Set(DIALSTATUS=)") in new stack
    -- Executing [s@macro-dial-one:54] GosubIf("Motif/+13222222222-5f17", "0?s-NOANSWER,1()") in new stack
    -- Executing [s@macro-dial-one:55] MacroExit("Motif/+13222222222-5f17", "") in new stack
    -- Executing [s@macro-exten-vm:17] Set("Motif/+13222222222-5f17", "SV_DIALSTATUS=NOANSWER") in new stack
    -- Executing [s@macro-exten-vm:18] GosubIf("Motif/+13222222222-5f17", "0?docfu,1()") in new stack
    -- Executing [s@macro-exten-vm:19] GosubIf("Motif/+13222222222-5f17", "0?docfb,1()") in new stack
    -- Executing [s@macro-exten-vm:20] Set("Motif/+13222222222-5f17", "DIALSTATUS=NOANSWER") in new stack
    -- Executing [s@macro-exten-vm:21] ExecIf("Motif/+13222222222-5f17", "0?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:22] GotoIf("Motif/+13222222222-5f17", "0?s-NOANSWER,1") in new stack
    -- Executing [s@macro-exten-vm:23] Macro("Motif/+13222222222-5f17", "vm,202,NOANSWER,") in new stack
    -- Executing [s@macro-vm:1] Macro("Motif/+13222222222-5f17", "user-callerid,SKIPTTL") in new stack
    -- Executing [s@macro-user-callerid:1] Set("Motif/+13222222222-5f17", "TOUCH_MONITOR=1498356836.0") in new stack
    -- Executing [s@macro-user-callerid:2] Set("Motif/+13222222222-5f17", "AMPUSER=3222222222") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("Motif/+13222222222-5f17", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("Motif/+13222222222-5f17", "0?Set(REALCALLERIDNUM=3222222222)") in new stack
    -- Executing [s@macro-user-callerid:5] Set("Motif/+13222222222-5f17", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("Motif/+13222222222-5f17", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:7] Set("Motif/+13222222222-5f17", "AMPUSERCIDNAME=") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("Motif/+13222222222-5f17", "1?report") in new stack
    -- Goto (macro-user-callerid,s,15)
    -- Executing [s@macro-user-callerid:15] GotoIf("Motif/+13222222222-5f17", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,29)
    -- Executing [s@macro-user-callerid:29] Set("Motif/+13222222222-5f17", "CALLERID(number)=3222222222") in new stack
    -- Executing [s@macro-user-callerid:30] Set("Motif/+13222222222-5f17", "CALLERID(name)=3222222222") in new stack
    -- Executing [s@macro-user-callerid:31] GotoIf("Motif/+13222222222-5f17", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:32] Set("Motif/+13222222222-5f17", "CDR(cnam)=3222222222") in new stack
    -- Executing [s@macro-user-callerid:33] Set("Motif/+13222222222-5f17", "CDR(cnum)=3222222222") in new stack
    -- Executing [s@macro-user-callerid:34] Set("Motif/+13222222222-5f17", "CHANNEL(language)=en") in new stack
    -- Executing [s@macro-vm:2] Set("Motif/+13222222222-5f17", "VMGAIN=") in new stack
    -- Executing [s@macro-vm:3] Macro("Motif/+13222222222-5f17", "blkvm-check,") in new stack
    -- Executing [s@macro-blkvm-check:1] Set("Motif/+13222222222-5f17", "GOSUB_RETVAL=") in new stack
    -- Executing [s@macro-blkvm-check:2] ExecIf("Motif/+13222222222-5f17", "0?Set(GOSUB_RETVAL=TRUE)") in new stack
    -- Executing [s@macro-blkvm-check:3] MacroExit("Motif/+13222222222-5f17", "") in new stack
    -- Executing [s@macro-vm:4] GotoIf("Motif/+13222222222-5f17", "1?vmx,1") in new stack
    -- Goto (macro-vm,vmx,1)
    -- Executing [vmx@macro-vm:1] Set("Motif/+13222222222-5f17", "MEXTEN=202") in new stack
    -- Executing [vmx@macro-vm:2] Set("Motif/+13222222222-5f17", "MMODE=NOANSWER") in new stack
    -- Executing [vmx@macro-vm:3] Set("Motif/+13222222222-5f17", "RETVM=") in new stack
    -- Executing [vmx@macro-vm:4] Set("Motif/+13222222222-5f17", "MODE=unavail") in new stack
    -- Executing [vmx@macro-vm:5] Macro("Motif/+13222222222-5f17", "get-vmcontext,202") in new stack
    -- Executing [s@macro-get-vmcontext:1] Set("Motif/+13222222222-5f17", "VMCONTEXT=default") in new stack
    -- Executing [s@macro-get-vmcontext:2] GotoIf("Motif/+13222222222-5f17", "0?200:300") in new stack
    -- Goto (macro-get-vmcontext,s,300)
    -- Executing [s@macro-get-vmcontext:300] NoOp("Motif/+13222222222-5f17", "") in new stack
    -- Executing [vmx@macro-vm:6] Set("Motif/+13222222222-5f17", "MODE=unavail") in new stack
    -- Executing [vmx@macro-vm:7] NoOp("Motif/+13222222222-5f17", "MODE IS: unavail") in new stack
    -- Executing [vmx@macro-vm:8] GotoIf("Motif/+13222222222-5f17", "1?chknomsg") in new stack
    -- Goto (macro-vm,vmx,10)
    -- Executing [vmx@macro-vm:10] GotoIf("Motif/+13222222222-5f17", "0?s-NOANSWER,1") in new stack
    -- Executing [vmx@macro-vm:11] GotoIf("Motif/+13222222222-5f17", "1?notdirect") in new stack
    -- Goto (macro-vm,vmx,13)
    -- Executing [vmx@macro-vm:13] NoOp("Motif/+13222222222-5f17", "Checking if ext 202 is enabled: ") in new stack
    -- Executing [vmx@macro-vm:14] GotoIf("Motif/+13222222222-5f17", "1?s-NOANSWER,1") in new stack
    -- Goto (macro-vm,s-NOANSWER,1)
    -- Executing [s-NOANSWER@macro-vm:1] Macro("Motif/+13222222222-5f17", "get-vmcontext,202") in new stack
    -- Executing [s@macro-get-vmcontext:1] Set("Motif/+13222222222-5f17", "VMCONTEXT=default") in new stack
    -- Executing [s@macro-get-vmcontext:2] GotoIf("Motif/+13222222222-5f17", "0?200:300") in new stack
    -- Goto (macro-get-vmcontext,s,300)
    -- Executing [s@macro-get-vmcontext:300] NoOp("Motif/+13222222222-5f17", "") in new stack
    -- Executing [s-NOANSWER@macro-vm:2] VoiceMail("Motif/+13222222222-5f17", "202@default,u") in new stack
    -- <Motif/+13222222222-5f17> Playing 'vm-theperson.ulaw' (language 'en')
    -- <Motif/+13222222222-5f17> Playing 'digits/2.ulaw' (language 'en')
    -- <Motif/+13222222222-5f17> Playing 'digits/0.ulaw' (language 'en')
    -- <Motif/+13222222222-5f17> Playing 'digits/2.ulaw' (language 'en')
    -- <Motif/+13222222222-5f17> Playing 'vm-isunavail.ulaw' (language 'en')
    -- <Motif/+13222222222-5f17> Playing 'vm-intro.ulaw' (language 'en')
    -- <Motif/+13222222222-5f17> Playing 'beep.ulaw' (language 'en')
    -- Recording the message
    -- x=0, open writing:  /var/spool/asterisk/voicemail/default/202/tmp/PV1ERj format: wav, 0x75e19450
    -- User hung up
  == Parsing '/var/spool/asterisk/voicemail/default/202/INBOX/msg0000.txt': Found
  == Parsing '/var/spool/asterisk/voicemail/default/202/INBOX/msg0000.txt': Found
  == Parsing '/var/spool/asterisk/voicemail/default/202/INBOX/msg0000.txt': Found
  == Parsing '/var/spool/asterisk/voicemail/default/202/INBOX/msg0000.txt': Found
  == Parsing '/var/spool/asterisk/voicemail/default/202/INBOX/msg0000.txt': Found
  == Parsing '/var/spool/asterisk/voicemail/default/202/INBOX/msg0000.txt': Found
  == Spawn extension (macro-vm, s-NOANSWER, 2) exited non-zero on 'Motif/+13222222222-5f17' in macro 'vm'
  == Spawn extension (macro-exten-vm, s, 23) exited non-zero on 'Motif/+13222222222-5f17' in macro 'exten-vm'
  == Spawn extension (ext-local, 202, 2) exited non-zero on 'Motif/+13222222222-5f17'
    -- Executing [h@ext-local:1] Macro("Motif/+13222222222-5f17", "hangupcall,") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("Motif/+13222222222-5f17", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("Motif/+13222222222-5f17", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] Hangup("Motif/+13222222222-5f17", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'Motif/+13222222222-5f17' in macro 'hangupcall'
  == Spawn extension (ext-local, h, 1) exited non-zero on 'Motif/+13222222222-5f17'
       > Saved useragent "PolycomVVX-VVX_400-UA/5.2.4.0155" for peer 202

Mark this one solved :slight_smile:

Hi!

You can actually mark it solved yourself…

Under your post the first icon you will see is the one which lets you mark a specific post as the solution to your problem…

It looks like a little checkmark inside a box…

Have a nice day!

Nick

PS: It might be nice to let the others know what was the fix…

1 Like

Aha! So I see I can mark a post as the one that solved the problem…that would mean of course that I would share my oversight (making this a user error) …but I don’t have a problem with that :grinning:

The problem was that the mailcmd was missing the first slash. I had pasted:

usr/sbin/sendmail -v -t -f [email protected]

rather than

**/**usr/sbin/sendmail -v -t -f [email protected]

2 Likes

Hi!

You might want to take a look at this:

Have a nice day!

Nick

1 Like