Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## processcallemail_with_attachment.sh
- echo "Call recording $6 attached " | mutt -s "$1 $2 $3 $4 $5" -a /var/spool/asterisk/monitor/$6 $7
- echo "Call recording $6 attached | mutt -s $1 $2 $3 $4 $5 -a /var/spool/asterisk/monitor/$6" > /tmp/julian.debug
- [root@pbx agi-bin]# ./processcallemail_with_attachment.sh callid callidname dialstatus vmstatus esxten OUT20-20110920-090209-1316527329.27654.wav julian@mydomain.com
- [root@pbx agi-bin]# tail /var/log/maillog
- Sep 24 13:54:34 pbx postfix/pickup[17534]: 678A717905F6: uid=0 from=<root>
- Sep 24 13:54:34 pbx postfix/cleanup[17670]: 678A717905F6: message-id=<20110924185434.GA17663@pbx.mycustomer.com>
- Sep 24 13:54:34 pbx postfix/qmgr[20788]: 678A717905F6: from=<root@pbx.mycustomer.com>, size=853843, nrcpt=1 (queue active)
- Sep 24 13:54:42 pbx postfix/smtp[17672]: 678A717905F6: to=<julian@mydomain.com>, relay=66.103.31.20[66.103.31.20]:25, delay=8.6, delays=0.4/0.01/1.3/7, dsn=2.0.0, status=sent (250 OK id=1R7XMu-0001yt-BT)
- Sep 24 13:54:42 pbx postfix/qmgr[20788]: 678A717905F6: removed
- Mail comes to my box. Here is what the dialplan part looks like:
- [root@pbx ~]# head /etc/asterisk/extensions_custom.conf
- [from-pstn-custom]
- ; these first three lines work, as you can see from the log attached further
- exten => 7746000,1,System(/var/lib/asterisk/agi-bin/processcallemail.sh "julian@mydomain.com" "${CALLERID(num)}" "${CALLERID(name)}" "${DIALSTATUS}" "${VMSTATUS}" "${EXTEN}")
- exten => 7746000,n,Monitor(wav,${STRFTIME(${EPOCH},,%Y-%m-%d)}/${CALLERID(dnid)}-${UNIQUEID},m)
- exten => 7746000,n,Noop(${STRFTIME(${EPOCH},,%Y-%m-%d)}/${CALLERID(dnid)}-${UNIQUEID}.wav)
- exten => h,1,System(/var/lib/asterisk/agi-bin/processcallemail_with_attachment.sh ${CALLERID(num)} ${CALLERID(name)} ${DIALSTATUS} ${VMSTATUS} ${EXTEN} ${STRFTIME(${EPOCH},,%Y-%m-%d)}/${CALLERID(dnid)}-${UNIQUEID}.wav julian@mydomain.com)
- exten => h,n,Noop(Hangup ext noop)
- conversation log:
- -- Executing [7746000@from-pstn:1] System("SIP/att1-00006cac", "/var/lib/asterisk/agi-bin/processcallemail.sh "julian@mydomain.com" "7739577800" "Unavailable" "" "" "7746000"") in new stack
- -- Executing [7746000@from-pstn:2] Monitor("SIP/att1-00006cac", "wav,2011-09-24/7746000-1316890987.28668,m") in new stack
- -- Executing [7746000@from-pstn:3] NoOp("SIP/att1-00006cac", "2011-09-24/7746000-1316890987.28668.wav") in new stack
- -- Executing [7746000@from-pstn:4] Set("SIP/att1-00006cac", "__CALLINGPRES_SV=allowed_not_screened") in new stack
- -- Executing [7746000@from-pstn:5] Set("SIP/att1-00006cac", "CALLERPRES()=allowed_not_screened") in new stack
- -- Executing [7746000@from-pstn:6] Goto("SIP/att1-00006cac", "ivr-3,s,1") in new stack
- -- Goto (ivr-3,s,1)
- -- Executing [s@ivr-3:1] Set("SIP/att1-00006cac", "MSG=custom/11") in new stack
- -- Executing [s@ivr-3:2] Set("SIP/att1-00006cac", "LOOPCOUNT=0") in new stack
- -- Executing [s@ivr-3:3] Set("SIP/att1-00006cac", "__DIR-CONTEXT=") in new stack
- -- Executing [s@ivr-3:4] Set("SIP/att1-00006cac", "_IVR_CONTEXT_ivr-3=") in new stack
- -- Executing [s@ivr-3:5] Set("SIP/att1-00006cac", "_IVR_CONTEXT=ivr-3") in new stack
- -- Executing [s@ivr-3:6] GotoIf("SIP/att1-00006cac", "0?begin") in new stack
- -- Executing [s@ivr-3:7] Answer("SIP/att1-00006cac", "") in new stack
- -- Executing [s@ivr-3:8] Wait("SIP/att1-00006cac", "1") in new stack
- -- Executing [s@ivr-3:9] Set("SIP/att1-00006cac", "TIMEOUT(digit)=3") in new stack
- -- Digit timeout set to 3.000
- -- Executing [s@ivr-3:10] Set("SIP/att1-00006cac", "TIMEOUT(response)=10") in new stack
- -- Response timeout set to 10.000
- -- Executing [s@ivr-3:11] Set("SIP/att1-00006cac", "__IVR_RETVM=") in new stack
- -- Executing [s@ivr-3:12] ExecIf("SIP/att1-00006cac", "1?Background(custom/11)") in new stack
- -- <SIP/att1-00006cac> Playing 'custom/11.slin' (language 'en')
- == Spawn extension (ivr-3, s, 12) exited non-zero on 'SIP/att1-00006cac'
- -- Executing [h@ivr-3:1] Hangup("SIP/att1-00006cac", "") in new stack
- == Spawn extension (ivr-3, h, 1) exited non-zero on 'SIP/att1-00006cac'
- == Using SIP RTP TOS bits 184
- == Using SIP RTP CoS mark 5
- -- Executing [7746000@from-pstn:1] System("SIP/att1-00006cad", "/var/lib/asterisk/agi-bin/processcallemail.sh "julian@mydomain.com" "7739577800" "Unavailable" "" "" "7746000"") in new stack
- -- Executing [7746000@from-pstn:2] Monitor("SIP/att1-00006cad", "wav,2011-09-24/7746000-1316891024.28669,m") in new stack
- -- Executing [7746000@from-pstn:3] NoOp("SIP/att1-00006cad", "2011-09-24/7746000-1316891024.28669.wav") in new stack
- -- Executing [7746000@from-pstn:4] Set("SIP/att1-00006cad", "__CALLINGPRES_SV=allowed_not_screened") in new stack
- -- Executing [7746000@from-pstn:5] Set("SIP/att1-00006cad", "CALLERPRES()=allowed_not_screened") in new stack
- -- Executing [7746000@from-pstn:6] Goto("SIP/att1-00006cad", "ivr-3,s,1") in new stack
- -- Goto (ivr-3,s,1)
- -- Executing [s@ivr-3:1] Set("SIP/att1-00006cad", "MSG=custom/11") in new stack
- -- Executing [s@ivr-3:2] Set("SIP/att1-00006cad", "LOOPCOUNT=0") in new stack
- -- Executing [s@ivr-3:3] Set("SIP/att1-00006cad", "__DIR-CONTEXT=") in new stack
- -- Executing [s@ivr-3:4] Set("SIP/att1-00006cad", "_IVR_CONTEXT_ivr-3=") in new stack
- -- Executing [s@ivr-3:5] Set("SIP/att1-00006cad", "_IVR_CONTEXT=ivr-3") in new stack
- -- Executing [s@ivr-3:6] GotoIf("SIP/att1-00006cad", "0?begin") in new stack
- -- Executing [s@ivr-3:7] Answer("SIP/att1-00006cad", "") in new stack
- -- Executing [s@ivr-3:8] Wait("SIP/att1-00006cad", "1") in new stack
- -- Executing [s@ivr-3:9] Set("SIP/att1-00006cad", "TIMEOUT(digit)=3") in new stack
- -- Digit timeout set to 3.000
- -- Executing [s@ivr-3:10] Set("SIP/att1-00006cad", "TIMEOUT(response)=10") in new stack
- -- Response timeout set to 10.000
- -- Executing [s@ivr-3:11] Set("SIP/att1-00006cad", "__IVR_RETVM=") in new stack
- -- Executing [s@ivr-3:12] ExecIf("SIP/att1-00006cad", "1?Background(custom/11)") in new stack
- -- <SIP/att1-00006cad> Playing 'custom/11.slin' (language 'en')
- -- Executing [s@ivr-3:13] WaitExten("SIP/att1-00006cad", "10,") in new stack
- -- Timeout on SIP/att1-00006cad, going to 't'
- -- Executing [t@ivr-3:1] Goto("SIP/att1-00006cad", "loop,1") in new stack
- -- Goto (ivr-3,loop,1)
- -- Executing [loop@ivr-3:1] Set("SIP/att1-00006cad", "LOOPCOUNT=1") in new stack
- -- Executing [loop@ivr-3:2] GotoIf("SIP/att1-00006cad", "0?hang,1") in new stack
- -- Executing [loop@ivr-3:3] Goto("SIP/att1-00006cad", "ivr-3,s,begin") in new stack
- -- Goto (ivr-3,s,9)
- -- Executing [s@ivr-3:9] Set("SIP/att1-00006cad", "TIMEOUT(digit)=3") in new stack
- -- Digit timeout set to 3.000
- -- Executing [s@ivr-3:10] Set("SIP/att1-00006cad", "TIMEOUT(response)=10") in new stack
- -- Response timeout set to 10.000
- -- Executing [s@ivr-3:11] Set("SIP/att1-00006cad", "__IVR_RETVM=") in new stack
- -- Executing [s@ivr-3:12] ExecIf("SIP/att1-00006cad", "1?Background(custom/11)") in new stack
- -- <SIP/att1-00006cad> Playing 'custom/11.slin' (language 'en')
- == CDR updated on SIP/att1-00006cad
- -- Executing [5@ivr-3:1] Macro("SIP/att1-00006cad", "blkvm-clr,") in new stack
- -- Executing [s@macro-blkvm-clr:1] Set("SIP/att1-00006cad", "SHARED(BLKVM,)=") in new stack
- -- Executing [s@macro-blkvm-clr:2] Set("SIP/att1-00006cad", "GOSUB_RETVAL=") in new stack
- -- Executing [s@macro-blkvm-clr:3] MacroExit("SIP/att1-00006cad", "") in new stack
- -- Executing [5@ivr-3:2] Set("SIP/att1-00006cad", "__NODEST=") in new stack
- -- Executing [5@ivr-3:3] Goto("SIP/att1-00006cad", "tony,s,1") in new stack
- -- Goto (tony,s,1)
- -- Executing [s@tony:1] Answer("SIP/att1-00006cad", "") in new stack
- -- Executing [s@tony:2] Dial("SIP/att1-00006cad", "SIP/18154047083@att1") in new stack
- == Using SIP RTP TOS bits 184
- == Using SIP RTP CoS mark 5
- -- Called 18154047083@att1
- -- SIP/att1-00006cae is making progress passing it to SIP/att1-00006cad
- -- SIP/att1-00006cae is making progress passing it to SIP/att1-00006cad
- -- SIP/att1-00006cae is ringing
- -- SIP/att1-00006cae is making progress passing it to SIP/att1-00006cad
- -- SIP/att1-00006cae answered SIP/att1-00006cad
- == Spawn extension (tony, s, 2) exited non-zero on 'SIP/att1-00006cad'
- So, there was no Noop(Hangup ext noop) runned, so the exten => h,1,Noop(), exten=>h,n,System() didn't work. What's wrong?
Add Comment
Please, Sign In to add comment