Adding more than one email to FreePBX-MissedCalls dialplan created by pitzkey

Good Morning Colleagues
I hope you are doing safe and good .

I have a question regarding FreePBX-MissedCalls dialplan created by pitzkey. Regarding the " to email" , Is it possible to add more than one email ? If applicable , How can i do this ?

Thx in advance.

Best Regards

The ‘mail’ command accepts multiple email addresses separated by spaces:

mail -s "subject" ... etc... [email protected] [email protected]

If you want different message content, you can duplicate the System line with changes to each as needed.

Hi Lorne
Thx for your replay . I don’t mean the mail command but i am talking about FreePBX Missed Calls dialplan below . I need to know how to send the notifications to more than one email.

Best Regards

The dialplan pulls the email address defined for the extension’s voicemail. You can populate that vm email address field in the GUI with multiple addresses separated by commas, and FreePBX will write that out in voicemail.conf as addresses separated by | characters. The mail command won’t be able to deal with them in that format, so after the line that gets the email address, you will need to change pipe(s) to space(s). Not tested:

exten => s,n,Set(email=${IF($["empty${VM_INFO(${EXTTOCALL},email)}" = "empty"][email protected]:${VM_INFO(${EXTTOCALL},email)})})
exten => s,n,Set(email=${STRREPLACE(email,|, )})

@PitzKey I think this would be safe to do in all cases

Hi Lorne
Thanks for your replay . I am using the below configuration to send notification to “[email protected]” .

exten => s,n,Set(email=${IF($[“empty${VM_INFO(${EXTTOCALL},email)}” = “empty”][email protected]:${VM_INFO(${EXTTOCALL},email)})})

Based on your suggestion , What is the modifications required to send notification to both “[email protected]” & “[email protected]” ?

Thx in advance.

Best Regards

Not sure how to make it any clearer. Add multiple email addresses to the vm email address field for the extension separated by commas. Add the additional dialplan line noted above in the correct place and reload.

I wasn’t aware of STRREPLACE, I used once: ${REPLACE(email,|,,)}

I wasn’t aware of REPLACE. How odd that there be two nearly (but not quite) identical functions. With your line, don’t you require a space between the two final commas?

Last time I tested, it worked fine. IIRC it’s in production for ~4 months now.

1 Like

Ack, reading more carefully, I can see how it works. I think this is a change you can permanently add to the dialplan. If the VM_INFO function ever returns an email string with a | character, it will only ever be a separator between multiple addresses.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.