I have looked around with no luck. Does anyone know of a way to send an email from the dialplan. The system that I am working on has none thing to do with VoiceMail. This is something like the SMS command but using sending email I am working on a prepaid alarm dispatch program for Asterisk if anyone has any input please let me know. I will be more than happy to write the code as Open Source for others to use code. With help from the list. -- Best regards, Al Bochter Bochter Services http://www.BochterServices.com/?t=Email
Al Bochter wrote:> I have looked around with no luck. > > Does anyone know of a way to send an email from the dialplan. > The system that I am working on has none thing to do with VoiceMail. > > This is something like the SMS command but using sending email > > I am working on a prepaid alarm dispatch program for Asterisk if > anyone has any input please let me know. > I will be more than happy to write the code as Open Source for others > to use code. With help from the list. >I think you need an AGI program, or just a system call to an external script.
Exten => alarm,1,System(/usr/local/bin/sendalarm.sh|email@address.com) Or Exten => alarm,1,AGI(sendalarm) /usr/local/bin/sendalarm #!/bin/sh Mail -s "Alarm condition on PBX" $1 < /dev/null> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Al Bochter > Sent: Sunday, February 25, 2007 9:20 PM > To: asterisk-users@lists.digium.com > Subject: [asterisk-users] Sending Email From the dialplan > > I have looked around with no luck. > > Does anyone know of a way to send an email from the dialplan. > The system that I am working on has none thing to do with VoiceMail. > > This is something like the SMS command but using sending email > > I am working on a prepaid alarm dispatch program for Asterisk ifanyone> has any input please let me know. > I will be more than happy to write the code as Open Source for othersto> use code. With help from the list. > > -- > Best regards, > > Al Bochter > Bochter Services > http://www.BochterServices.com/?t=Email > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Al Bochter wrote:> Does anyone know of a way to send an email from the dialplan.Use System()/TrySystem() or AGI() to execute a script in whatever language you like. Regards, Philipp -- amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de Let's use IT to solve problems and not to create new ones. Asterisk -> http://www.das-asterisk-buch.de Gesch?ftsf?hrer: Stefan Wintermeyer Handelsregister: Neuwied B 14998
----- Original Message ----- From: "Al Bochter" <Al.Bochter@bochterservices.com> To: <asterisk-users@lists.digium.com> Sent: Monday, February 26, 2007 4:20 AM Subject: [asterisk-users] Sending Email From the dialplan>I have looked around with no luck. > > Does anyone know of a way to send an email from the dialplan. > The system that I am working on has none thing to do with VoiceMail. > > This is something like the SMS command but using sending email > > I am working on a prepaid alarm dispatch program for Asterisk if anyone > has any input please let me know. > I will be more than happy to write the code as Open Source for others to > use code. With help from the list.Al try this: exten => 1234,1,Answer exten => 1234,2,System(echo "Email Body" | mail -s "SUBJECT" me@mydomain.com)
----- Original Message ----- From: "Al Bochter" <Al.Bochter@bochterservices.com> To: <asterisk-users@lists.digium.com> Sent: Monday, February 26, 2007 4:20 AM Subject: [asterisk-users] Sending Email From the dialplan>I have looked around with no luck. > > Does anyone know of a way to send an email from the dialplan. > The system that I am working on has none thing to do with VoiceMail. > > This is something like the SMS command but using sending email > > I am working on a prepaid alarm dispatch program for Asterisk if anyone > has any input please let me know. > I will be more than happy to write the code as Open Source for others to > use code. With help from the list. >Also I forgot to mention that you can use variables like: exten => 1234,2,System(echo "${CALLERID}" | mail -s "Caller ID Info" me@mydomain.com)
I use mime-construct along with the System command - works great. On 2/26/07, Dovid B <asteriskusers@dovid.net> wrote:> > > ----- Original Message ----- > From: "Al Bochter" <Al.Bochter@bochterservices.com> > To: <asterisk-users@lists.digium.com> > Sent: Monday, February 26, 2007 4:20 AM > Subject: [asterisk-users] Sending Email From the dialplan > > > >I have looked around with no luck. > > > > Does anyone know of a way to send an email from the dialplan. > > The system that I am working on has none thing to do with VoiceMail. > > > > This is something like the SMS command but using sending email > > > > I am working on a prepaid alarm dispatch program for Asterisk if anyone > > has any input please let me know. > > I will be more than happy to write the code as Open Source for others to > > use code. With help from the list. > > > > Also I forgot to mention that you can use variables like: > exten => 1234,2,System(echo "${CALLERID}" | mail -s "Caller ID Info" > me@mydomain.com) > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070225/879b08b4/attachment.htm
Joanna Liza Mariazeta
2007-Feb-26 03:44 UTC
[asterisk-users] Sending Email From the dialplan
Hi Al, We have different email contents and subject depending in the action that the customer had taken, since our service is a Prepaid card. What I did, was to use an AGI to have this flexibility. After getting the caller id and querying it in the DB, I will then construct the email that will be sent to the customer. [nihonggo-temporary-registration] exten => readnum,1,Set(REGPHONE=${CALLERIDNUM}) exten => 2,1,AGI(preRegist.agi,${REGPHONE}) exten => 2,2,AGI(sendEMAILnotification.agi,${REGPHONE}) AGI script.. sub mailSend { my ($subj, $body) = @_; my(@da, @day, @mon, $datetime, $expTO, $mail, $head); @da = localtime(time); @day = qw(Sun Mon Tue Wed Thu Fri Sat); @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); $datetime = sprintf "%s, %02d %s %d %02d:%02d:%02d +0900", ($day[$da[6]], $da[3]*1, $mon[$da[4]], $da[5]+1900, $da[2]*1, $da[1]*1, $da[0]*1); $body = Jcode->new($body)->h2z->jis; $head = "Return-Path: <$m_RETPATH>\n"; $expTO = join(",\n ", @m_MAILTO); $head .= "To: $expTO\n"; $head .= "From: $m_FROM\n"; $head .= "Date: $datetime\n"; $head .= "Content-type: text/plain; charset=iso-2022-jp\n"; $head .= "Subject: $subj\n"; $head .= "\n"; $head = &mimeencode($head); $mail = "$head$body"; if (open (OUT, "|$QIPATH")) { # qmail-inject $mail =~ s/%/%%/g; printf OUT "$mail"; close (OUT); } } Hope that helps. Best Regards, Joanna www.mariazeta.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070226/350de5b6/attachment.htm