#!/bin/bash
echo "S,/var/lib/asterisk/sounds/demo-congrats"
while true; do
  read stdin
  echo $stdin >> /tmp/ivr-test.log

  if [ "${stdin:0:1}" = "1" ]; then
    #
    # Here we are setting X-VAR1 and X-VAR2
    # but unfortunately only X-VAR1 is passed back to Asterisk
    #
    echo "V,X-VAR1=1,X-VAR2=2"
    echo "E,Quiting..."
    sleep 5
    exit;
  fi

  if [ "${stdin:0:1}" = "H" ]; then
    exit;
  fi
done
