Trigger an outbound email via extensions.conf dialplan?

Greetings,

After fighting with sendmail in CentOS 4.6 for the better part of a day I finally have it up and running.

Is it possible to trigger an email (or a shell script) from inside extensions.conf? If so could you provide an example how to do this?

Oh, and I have searched on this topic and never did find a hit. Just seems like if you can call festival you should be able to call the “mail” command or a shell script that sends an email.

Thanks,

Ike

Hi This is standard Linux. You just need to call the script from the dialplan with a system comand, Then the script does the rest.

There are loads of notes out there, I use a helper scrpt that lets me use it for various things. I cant get a copy now as im busy doing other things but if you hav eno luck I will dig it out in a day or so.

Ian

I use this:

exten => 8888,1,Answer
exten => 8888,2,System(echo "Work has been started for ${CALLERID} at ${DATETIME}. Thank you. Asterisk :)" | mail -s "Work Starting for client ${CALLERIDNAME} ::" me@myaddress.com)
exten => 8888,3,Congestion
exten => 8888,4,Hangup

I used that to keep track of work being done.

That’s pretty cool!

However, my system has one problem. In your code:

exten => 8888,2,System(echo “Work has been started for ${CALLERID} at ${DATETIME}. Thank you. Asterisk :smile:” | mail -s “Work Starting for client ${CALLERIDNAME} ::” me@myaddress.com)

I can not display ${CALLERID} and ${DATETIME} in my msg. I am not sure System() and TrySystem() support variable values or not.

Thanks

I wrote that a while back. The variables have changed. Have a look here: voip-info.org/wiki/view/Asterisk+variables for updated variable information.