ratox-nuggets

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

commit 657835ea83c43f071a2d0f7f8be110bcec55aa40
parent 4fb8fbe179a8211665b1fc242bd65775ba63b80c
Author: Myroslav Opyr <myroslav@quintagroup.com>
Date:   Thu,  9 Oct 2014 21:03:15 +0300

Factoring out Autoanswer logic into separate script

Diffstat:
Arat-autoanswer | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/rat-autoanswer b/rat-autoanswer @@ -0,0 +1,22 @@ +#!/bin/sh +# raTox Auto Answer +# Usage: +# rat-autoanswer <script> +# Wait until incomin call and spawn <script> to handle it +# script will have voice data piped into stdin and is expected +# to produce response' voice data into stdout + +LIBRARY_LOCATION=`dirname $0` +. $LIBRARY_LOCATION/functions +export PATH=$LIBRARY_LOCATION:$PATH + +while true; do + log "Monitoring for new call" + monitor_pending call + + log "Call started" + $* + + log "Call finished" + sleep 1 +done