SHARE
TWEET

nodenames.sh

a guest Aug 17th, 2015 203 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # !/bin/bash
  2. #
  3. #  Created by Marshall Dias
  4.  
  5. rm -rf *.ulaw
  6. rm -rf wav/*.wav
  7.  
  8.  
  9. NODENAMES=/var/lib/asterisk/sounds/rpt/nodenames
  10. LETTERS=/var/lib/asterisk/sounds/letters
  11. NUMBERS=/var/lib/asterisk/sounds/digits
  12. STRING=""
  13.  
  14. rm -rf $NODENAMES/*.ulaw
  15.  
  16. while IFS='|' read f1 f2 f3 f4
  17. do      
  18.  
  19. echo "Node Number is: $f1"
  20. echo "Callsign is: $f2"
  21.  
  22. STRING=""
  23.  
  24.  
  25.  
  26.  
  27. foo=${f2,,}
  28. for (( i=0; i<${#foo}; i++ )); do
  29.   char=${foo:$i:1}
  30.  
  31.                 case ${foo:$i:1} in
  32.                 [0-9]*) FILENAME=$NUMBERS/$char.gsm ;;
  33.                 "/") FILENAME=$LETTERS/slash.gsm ;;
  34.                 "-") FILENAME=$LETTERS/dash.gsm ;;
  35.                 [a-z]*|[A-Z]*) FILENAME=$LETTERS/$char.gsm ;;
  36.                 esac
  37.  
  38. STRING="$STRING|$FILENAME"
  39.  
  40.  
  41. done
  42.  
  43. #ffmpeg -i "concat:${STRING:1}" -ar 8000 -ac 1 -ab 64k wav/$f1.wav < /dev/null
  44. ffmpeg -i "concat:${STRING:1}" -ar 8000 -ac 1 -ab 64k -f mulaw $NODENAMES/$f1.ulaw < /dev/null
  45. #cp $f1.ulaw $NODENAMES/
  46.  
  47. done < nodenames.txt
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top