3 # Check if there are more than one instance of this command
4 # with the same command line running at the same time for some
5 # reason, then quit. We are checking for the same
6 # commandline in order to permit two different callback
7 # attempts simultaneously.
9 if ! grep -q "$@" /dev/shm/delayedcallback.[0-9]* 2>/dev/null
11 echo "$@" > /dev/shm/delayedcallback.$$
13 asterisk -r -x "$1 $2 \"$3\" $4 $5 $6"
14 rm /dev/shm/delayedcallback.$$
15 # echo "`date` $@": >> /dev/shm/delayedcallback.log
17 # echo "`date` ERROR: There appears to be a callback attempt in progress to: $@" >> /dev/shm/delayedcallback.err