ratox-nuggets

useful ratox related scripts
git clone git://git.2f30.org/ratox-nuggets
Log | Files | Refs | LICENSE

rat-autoanswer (532B)


      1 #!/bin/sh
      2 # raTox Auto Answer
      3 # Usage:
      4 #    rat-autoanswer <script>
      5 #        Wait until incomin call and spawn <script> to handle it
      6 #        script will have voice data piped into stdin and is expected
      7 #        to produce response' voice data into stdout
      8 
      9 LIBRARY_LOCATION=`dirname $0`
     10 . $LIBRARY_LOCATION/functions
     11 export PATH=$LIBRARY_LOCATION:$PATH
     12 
     13 check_if_dir
     14 
     15 while true; do
     16         log "Monitoring for new call"
     17         monitor_pending call
     18 
     19         log "Call started"
     20         $*
     21 
     22         log "Call finished"
     23 	sleep 1
     24 done