Hey all. My boss asked me to implement the following When DID 713xxxxxxx is dialed send an email to mmosier at xxx.com. with the time date and CID included in the email. I know how to code some but am looking for the best way to do this. Sorry I might have asked this a couple months back. I forgot. Mmosier Houston Respectfully Michael D Mosier Ftoc Certified -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100503/fec5418f/attachment.htm
Untested, just throwing something out off the top of my head... modify to suit... exten => _713.,x,System(/bin/date | /bin/mail -s "${EXTEN}" mmosier at xxx.com) --Tim ----- "mike mosier" <trixboxce at gmail.com> wrote:>Hey all. My boss asked me to implement the following When DID 713xxxxxxx is dialed send an email to mmosier at xxx.com . with the time date and CID included in the email. I know how to code some but am looking for the best way to do this. Sorry I might have asked this a couple months back. I forgot. Mmosier> HoustonRespectfully> Michael D Mosier > Ftoc Certified > -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello 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/20100503/12e3a1e0/attachment.htm
Hello Mike, On 05-04-2010 06:18, mike mosier wrote:> When DID 713xxxxxxx is dialed send an email to mmosier at xxx.com. with the > time date and CID included in the email. I know how to code some but am > looking for the best way to do this. >something like this? exten => _713X.,1,System(/web/html/icq.php <censored UIN> [VoIP] Incoming call, CLID: ${CALLERID(num)}.) exten => _713X.,n,System(echo "Incoming call at `date`." | /bin/mail -s "InCall from ${CALLERID(num)} at `date`." <censored e-mail>) regards adam
wow thanks guys. Ill try it out. Respectfully Michael D Mosier Ftoc Certified On May 4, 2010 1:36 AM, <adamk at 3a.hu> wrote: Hello Mike, On 05-04-2010 06:18, mike mosier wrote:> When DID 713xxxxxxx is dialed send an email to mmosier at x...something like this? exten => _713X.,1,System(/web/html/icq.php <censored UIN> [VoIP] Incoming call, CLID: ${CALLERID(num)}.) exten => _713X.,n,System(echo "Incoming call at `date`." | /bin/mail -s "InCall from ${CALLERID(num)} at `date`." <censored e-mail>) regards adam -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100504/b9389c2f/attachment.htm
whats censored UIN? [VoIP] On Tue, May 4, 2010 at 8:00 AM, mike mosier <trixboxce at gmail.com> wrote:> wow thanks guys. Ill try it out. > > Respectfully > Michael D Mosier > Ftoc Certified > > On May 4, 2010 1:36 AM, <adamk at 3a.hu> wrote: > > Hello Mike, > > > On 05-04-2010 06:18, mike mosier wrote: > > > When DID 713xxxxxxx is dialed send an email to mmosier at x... > > something like this? > > exten => _713X.,1,System(/web/html/icq.php <censored UIN> [VoIP] > Incoming call, CLID: ${CALLERID(num)}.) > exten => _713X.,n,System(echo "Incoming call at `date`." | /bin/mail -s > "InCall from ${CALLERID(num)} at `date`." <censored e-mail>) > > regards > adam > > > -- > _____________________________________________________________________ > > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a... > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100504/f18315f6/attachment.htm
mike mosier wrote:> > Hey all. > > My boss asked me to implement the following > > When DID 713xxxxxxx is dialed send an email to mmosier at xxx.com > <mailto:mmosier at xxx.com>. with the time date and CID included in the > email. I know how to code some but am looking for the best way to do this. > > Sorry I might have asked this a couple months back. I forgot. > > Mmosier > Houston > > Respectfully > Michael D Mosier > Ftoc Certified >Here is the script I am using for email alert. Form Asterisk dialplan: exten => h,1,System(/path/to/the/script/emailnotice.sh "someone at gmail.com" "${CALLERID(num)}" "${CALLERID(name)}" "${DIALSTATUS}" "${VMSTATUS}" "${MYEXTEN}" "${STRFTIME(${EPOCH},,%Y/%m/%d %H:%M)}") =================================================#!/bin/sh #Used for email alerting of incoming calls #$1 email address #$2 callerid num #$3 callerid name #$4 dial status #$5 vm status #$6 extension #$7 datetime if [ $# != 7 ] then exit 1 fi #Store command line args in nice variables EMAIL=$1 CALLERIDNUM=$2 CALLERIDNAME=$3 DIALSTATUS=$4 VMSTATUS=$5 EXTEN=$6 TIMESTAMP=$7 DEBUG=0 #Set to 0 for standard operation. 1 will log inputs and mail commands for debugging. LOGFILE="/var/log/asterisk/IncomingCalls.log" SENDMAIL=1 #Set to 1 if you want it to email the alert. 0 is useful for debugging. EMAILCMD="/usr/sbin/sendmail -t" SUBJECT="Incoming call to ${EXTEN} at ${TIMESTAMP}" #log mail command if [ ${DEBUG} -eq 1 ]; then echo $1 $2 \"$3\" $4 $5 $6 $7>> ${LOGFILE} fi #Check we have an email address if not quit if [ "${EMAIL}" = "" ]; then exit 0 fi if [ ${DIALSTATUS} = "CANCEL" ]; then BODY="Caller - ${CALLERIDNAME} (${CALLERIDNUM}) hung up." elif [ ${DIALSTATUS} = "ANSWER" ]; then BODY="Caller - ${CALLERIDNAME} (${CALLERIDNUM}) was answered by ${EXTEN}." else BODY="[ ${DIALSTATUS} ] ${CALLERIDNAME} (${CALLERIDNUM}) hung up." #check for hangup in vm menu. ex call went to vm and user hung up if [ ${VMSTATUS} = "USEREXIT" ]; then BODY="[ ${DIALSTATUS} ] ${CALLERIDNAME} (${CALLERIDNUM}) hung up on vm." fi #check for hangup in vm menu. ex call went to vm and user hung up if [ ${VMSTATUS} = "FAILED" ]; then BODY="[ ${DIALSTATUS} ] ${CALLERIDNAME} (${CALLERIDNUM}) hung up on vm." fi #if they left a vm we already would get an email. Don't need a 2nd if [ ${VMSTATUS} = "SUCCESS" ]; then exit 0 fi fi #log mail command if [ ${DEBUG} -eq 1 ]; then echo "To: ${EMAIL} Subject: ${SUBJECT} ${BODY}" >> ${LOGFILE} fi #send email if [ ${SENDMAIL} -eq 1 ]; then ${EMAILCMD} <<INLINE From: asterisk at mydomain.com To: ${EMAIL} Subject: ${SUBJECT} ${BODY} INLINE fi exit 0 -- Jian Gao IT Technician SJ Geophysics Ltd. <http://www.sjgeophysics.com> jian.gao at sjgeophysics.com <mailto:jian.gao at sjgeophysics.com> Tel: (604)582-1100
----- Original Message -----> mike mosier wrote: > > > > Hey all. > > > > My boss asked me to implement the following > > > > When DID 713xxxxxxx is dialed send an email to mmosier at xxx.com > > <mailto:mmosier at xxx.com>. with the time date and CID included in the > > email. I know how to code some but am looking for the best way to do > > this. > > > > Sorry I might have asked this a couple months back. I forgot. > > > > Mmosier > > Houston > > > > Respectfully > > Michael D Mosier > > Ftoc Certified > > > > Here is the script I am using for email alert. Form Asterisk dialplan: > exten => h,1,System(/path/to/the/script/emailnotice.sh > "someone at gmail.com" "${CALLERID(num)}" "${CALLERID(name)}" > "${DIALSTATUS}" "${VMSTATUS}" "${MYEXTEN}" > "${STRFTIME(${EPOCH},,%Y/%m/%d %H:%M)}") >you could always use the PHP AGI interface to send the email and log information to a database ? eg. exten => h,1,AGI(sendemailandlog.php) -- Thanks, Phil