]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/asterisk/pbx-daemon/eg-pbx-preclean.sh
LP1779158 Angular7 and ng-lint updates
[Evergreen.git] / Open-ILS / src / asterisk / pbx-daemon / eg-pbx-preclean.sh
1 #!/bin/bash
2
3 # You may not want this.
4 #
5 # If and only if your telephony A/T templates ...
6 #
7 # 1. generate callfiles that include the token 'DAHDI' for notifications that
8 #   the system should actually dial
9 # 2. generate callfiles that include the token 'noop' when notifications
10 #   should NOT be attempted
11 #
12 # ... would you want this.  If you meet these conditions, read on.
13
14 cd /var/tmp
15
16 # This heuristic finds call files that don't containt 'DAHDI' but do contain
17 # 'noop', and appends a line to those files for the benefit of the
18 # get_failures() method of eg-pbx-mediator.pl, and moves these files to the
19 # directory where they would land if they were call files which Asterisk
20 # had attempted and failed.
21 #
22 # The purpose of this is to support a special case of the "rollover failed
23 # phone notices to print notices" functionality.  Notices that never reach
24 # Asterisk because of a lack of patron phone number are still expected to
25 # rollover to print notices.
26
27 # XXX todo: get rid of this script, and incorporate into eg-pbx-allocator.pl,
28 # or at least don't have hardcoded paths here
29
30 grep -L DAHDI EG*.call 2>/dev/null |
31     xargs grep -l noop |
32     xargs -I X sh -c 'echo "Status: Untried" >> X ; mv X /var/spool/asterisk/outgoing_done' 2>&1 > /dev/null
33
34 # If you know your deployment doesn't use the "rollover failed phone notices
35 # to print notices" functionality, you could comment out the chain of commands
36 # above, and uncomment the simpler one below.  This assumes you still meet
37 # the two initial requirements in the top comments in this script.
38
39 # grep -L DAHDI EG*.call 2>/dev/null |
40 #     xargs grep -l noop | xargs rm -f 2>&1 > /dev/null