Guest User

Untitled

a guest
Jan 16th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.38 KB | None | 0 0
  1. ## processcallemail_with_attachment.sh
  2. echo "Call recording $6 attached " | mutt -s "$1 $2 $3 $4 $5" -a /var/spool/asterisk/monitor/$6 $7
  3. echo "Call recording $6 attached | mutt -s $1 $2 $3 $4 $5 -a /var/spool/asterisk/monitor/$6" > /tmp/julian.debug
  4.  
  5. [root@pbx agi-bin]# ./processcallemail_with_attachment.sh callid callidname dialstatus vmstatus esxten OUT20-20110920-090209-1316527329.27654.wav julian@mydomain.com
  6. [root@pbx agi-bin]# tail /var/log/maillog
  7.  
  8. Sep 24 13:54:34 pbx postfix/pickup[17534]: 678A717905F6: uid=0 from=<root>
  9. Sep 24 13:54:34 pbx postfix/cleanup[17670]: 678A717905F6: message-id=<20110924185434.GA17663@pbx.mycustomer.com>
  10. Sep 24 13:54:34 pbx postfix/qmgr[20788]: 678A717905F6: from=<root@pbx.mycustomer.com>, size=853843, nrcpt=1 (queue active)
  11. 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)
  12. Sep 24 13:54:42 pbx postfix/qmgr[20788]: 678A717905F6: removed
  13.  
  14. Mail comes to my box. Here is what the dialplan part looks like:
  15.  
  16. [root@pbx ~]# head /etc/asterisk/extensions_custom.conf
  17. [from-pstn-custom]
  18. ; these first three lines work, as you can see from the log attached further
  19. exten => 7746000,1,System(/var/lib/asterisk/agi-bin/processcallemail.sh "julian@mydomain.com" "${CALLERID(num)}" "${CALLERID(name)}" "${DIALSTATUS}" "${VMSTATUS}" "${EXTEN}")
  20. exten => 7746000,n,Monitor(wav,${STRFTIME(${EPOCH},,%Y-%m-%d)}/${CALLERID(dnid)}-${UNIQUEID},m)
  21. exten => 7746000,n,Noop(${STRFTIME(${EPOCH},,%Y-%m-%d)}/${CALLERID(dnid)}-${UNIQUEID}.wav)
  22. 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)
  23. exten => h,n,Noop(Hangup ext noop)
  24.  
  25. conversation log:
  26.  
  27. -- 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
  28. -- Executing [7746000@from-pstn:2] Monitor("SIP/att1-00006cac", "wav,2011-09-24/7746000-1316890987.28668,m") in new stack
  29. -- Executing [7746000@from-pstn:3] NoOp("SIP/att1-00006cac", "2011-09-24/7746000-1316890987.28668.wav") in new stack
  30. -- Executing [7746000@from-pstn:4] Set("SIP/att1-00006cac", "__CALLINGPRES_SV=allowed_not_screened") in new stack
  31. -- Executing [7746000@from-pstn:5] Set("SIP/att1-00006cac", "CALLERPRES()=allowed_not_screened") in new stack
  32. -- Executing [7746000@from-pstn:6] Goto("SIP/att1-00006cac", "ivr-3,s,1") in new stack
  33. -- Goto (ivr-3,s,1)
  34. -- Executing [s@ivr-3:1] Set("SIP/att1-00006cac", "MSG=custom/11") in new stack
  35. -- Executing [s@ivr-3:2] Set("SIP/att1-00006cac", "LOOPCOUNT=0") in new stack
  36. -- Executing [s@ivr-3:3] Set("SIP/att1-00006cac", "__DIR-CONTEXT=") in new stack
  37. -- Executing [s@ivr-3:4] Set("SIP/att1-00006cac", "_IVR_CONTEXT_ivr-3=") in new stack
  38. -- Executing [s@ivr-3:5] Set("SIP/att1-00006cac", "_IVR_CONTEXT=ivr-3") in new stack
  39. -- Executing [s@ivr-3:6] GotoIf("SIP/att1-00006cac", "0?begin") in new stack
  40. -- Executing [s@ivr-3:7] Answer("SIP/att1-00006cac", "") in new stack
  41. -- Executing [s@ivr-3:8] Wait("SIP/att1-00006cac", "1") in new stack
  42. -- Executing [s@ivr-3:9] Set("SIP/att1-00006cac", "TIMEOUT(digit)=3") in new stack
  43. -- Digit timeout set to 3.000
  44. -- Executing [s@ivr-3:10] Set("SIP/att1-00006cac", "TIMEOUT(response)=10") in new stack
  45. -- Response timeout set to 10.000
  46. -- Executing [s@ivr-3:11] Set("SIP/att1-00006cac", "__IVR_RETVM=") in new stack
  47. -- Executing [s@ivr-3:12] ExecIf("SIP/att1-00006cac", "1?Background(custom/11)") in new stack
  48. -- <SIP/att1-00006cac> Playing 'custom/11.slin' (language 'en')
  49. == Spawn extension (ivr-3, s, 12) exited non-zero on 'SIP/att1-00006cac'
  50. -- Executing [h@ivr-3:1] Hangup("SIP/att1-00006cac", "") in new stack
  51. == Spawn extension (ivr-3, h, 1) exited non-zero on 'SIP/att1-00006cac'
  52. == Using SIP RTP TOS bits 184
  53. == Using SIP RTP CoS mark 5
  54. -- 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
  55. -- Executing [7746000@from-pstn:2] Monitor("SIP/att1-00006cad", "wav,2011-09-24/7746000-1316891024.28669,m") in new stack
  56. -- Executing [7746000@from-pstn:3] NoOp("SIP/att1-00006cad", "2011-09-24/7746000-1316891024.28669.wav") in new stack
  57. -- Executing [7746000@from-pstn:4] Set("SIP/att1-00006cad", "__CALLINGPRES_SV=allowed_not_screened") in new stack
  58. -- Executing [7746000@from-pstn:5] Set("SIP/att1-00006cad", "CALLERPRES()=allowed_not_screened") in new stack
  59. -- Executing [7746000@from-pstn:6] Goto("SIP/att1-00006cad", "ivr-3,s,1") in new stack
  60. -- Goto (ivr-3,s,1)
  61. -- Executing [s@ivr-3:1] Set("SIP/att1-00006cad", "MSG=custom/11") in new stack
  62. -- Executing [s@ivr-3:2] Set("SIP/att1-00006cad", "LOOPCOUNT=0") in new stack
  63. -- Executing [s@ivr-3:3] Set("SIP/att1-00006cad", "__DIR-CONTEXT=") in new stack
  64. -- Executing [s@ivr-3:4] Set("SIP/att1-00006cad", "_IVR_CONTEXT_ivr-3=") in new stack
  65. -- Executing [s@ivr-3:5] Set("SIP/att1-00006cad", "_IVR_CONTEXT=ivr-3") in new stack
  66. -- Executing [s@ivr-3:6] GotoIf("SIP/att1-00006cad", "0?begin") in new stack
  67. -- Executing [s@ivr-3:7] Answer("SIP/att1-00006cad", "") in new stack
  68. -- Executing [s@ivr-3:8] Wait("SIP/att1-00006cad", "1") in new stack
  69. -- Executing [s@ivr-3:9] Set("SIP/att1-00006cad", "TIMEOUT(digit)=3") in new stack
  70. -- Digit timeout set to 3.000
  71. -- Executing [s@ivr-3:10] Set("SIP/att1-00006cad", "TIMEOUT(response)=10") in new stack
  72. -- Response timeout set to 10.000
  73. -- Executing [s@ivr-3:11] Set("SIP/att1-00006cad", "__IVR_RETVM=") in new stack
  74. -- Executing [s@ivr-3:12] ExecIf("SIP/att1-00006cad", "1?Background(custom/11)") in new stack
  75. -- <SIP/att1-00006cad> Playing 'custom/11.slin' (language 'en')
  76. -- Executing [s@ivr-3:13] WaitExten("SIP/att1-00006cad", "10,") in new stack
  77. -- Timeout on SIP/att1-00006cad, going to 't'
  78. -- Executing [t@ivr-3:1] Goto("SIP/att1-00006cad", "loop,1") in new stack
  79. -- Goto (ivr-3,loop,1)
  80. -- Executing [loop@ivr-3:1] Set("SIP/att1-00006cad", "LOOPCOUNT=1") in new stack
  81. -- Executing [loop@ivr-3:2] GotoIf("SIP/att1-00006cad", "0?hang,1") in new stack
  82. -- Executing [loop@ivr-3:3] Goto("SIP/att1-00006cad", "ivr-3,s,begin") in new stack
  83. -- Goto (ivr-3,s,9)
  84. -- Executing [s@ivr-3:9] Set("SIP/att1-00006cad", "TIMEOUT(digit)=3") in new stack
  85. -- Digit timeout set to 3.000
  86. -- Executing [s@ivr-3:10] Set("SIP/att1-00006cad", "TIMEOUT(response)=10") in new stack
  87. -- Response timeout set to 10.000
  88. -- Executing [s@ivr-3:11] Set("SIP/att1-00006cad", "__IVR_RETVM=") in new stack
  89. -- Executing [s@ivr-3:12] ExecIf("SIP/att1-00006cad", "1?Background(custom/11)") in new stack
  90. -- <SIP/att1-00006cad> Playing 'custom/11.slin' (language 'en')
  91. == CDR updated on SIP/att1-00006cad
  92. -- Executing [5@ivr-3:1] Macro("SIP/att1-00006cad", "blkvm-clr,") in new stack
  93. -- Executing [s@macro-blkvm-clr:1] Set("SIP/att1-00006cad", "SHARED(BLKVM,)=") in new stack
  94. -- Executing [s@macro-blkvm-clr:2] Set("SIP/att1-00006cad", "GOSUB_RETVAL=") in new stack
  95. -- Executing [s@macro-blkvm-clr:3] MacroExit("SIP/att1-00006cad", "") in new stack
  96. -- Executing [5@ivr-3:2] Set("SIP/att1-00006cad", "__NODEST=") in new stack
  97. -- Executing [5@ivr-3:3] Goto("SIP/att1-00006cad", "tony,s,1") in new stack
  98. -- Goto (tony,s,1)
  99. -- Executing [s@tony:1] Answer("SIP/att1-00006cad", "") in new stack
  100. -- Executing [s@tony:2] Dial("SIP/att1-00006cad", "SIP/18154047083@att1") in new stack
  101. == Using SIP RTP TOS bits 184
  102. == Using SIP RTP CoS mark 5
  103. -- Called 18154047083@att1
  104. -- SIP/att1-00006cae is making progress passing it to SIP/att1-00006cad
  105. -- SIP/att1-00006cae is making progress passing it to SIP/att1-00006cad
  106. -- SIP/att1-00006cae is ringing
  107. -- SIP/att1-00006cae is making progress passing it to SIP/att1-00006cad
  108. -- SIP/att1-00006cae answered SIP/att1-00006cad
  109. == Spawn extension (tony, s, 2) exited non-zero on 'SIP/att1-00006cad'
  110.  
  111. 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