AGI
mv processCallEmail.txt processCallEmail.sh mv processCallEmail.sh /var/lib/asterisk/agi-bin/ chmod 755 /var/lib/asterisk/agi-bin/processCallEmail.sh
macro-stdexten
[macro-stdexten]; ; ; Standard extension macro: ; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well ; ${ARG2} - Device(s) to ring ; ${ARG3} - email address to send emails about missed calls to ; exten => s,1,AGI(ldaplookupphone2.agi) exten => s,n,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum exten => s,n,Goto(s-${DIALSTATUS},1) ; Jump based on status NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER) exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain exten => h,1,System(processCallEmail.sh "${ARG3}" "${CALLERID(num)}" "${CALLERID(name) }" "${DIALSTATUS}" "${VMSTATUS}")
Add this line exten =>h,1,System(.............
somewhere
exten => 500,1,Macro(stdexten,500,SIP/${EXTEN},abc@test.com)
Add the email address into the Macro