<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="" face="Tahoma">Here is a little script that says the IP address of your BBB using Ramon's script. It is just one example of how to use it.<br><br>File name - sayip.sh - be sure to make executable - chmod 750 sayip.sh<br><br>Usage - sayip.sh node#<br><br><b>#!/bin/bash<br><br>ip=`ifconfig eth0 | awk '/inet / {print $2}'`<br><br>cat /var/lib/asterisk/sounds/letters/i.gsm /var/lib/asterisk/sounds/letters/p.gsm /var/lib/asterisk/sounds/address.gsm > /tmp/ip.gsm<br><br>asterisk -rx "rpt localplay $1 /tmp/ip"<br><br>/etc/asterisk/local/speaktext.sh $ip $1<br><br>rm /tmp/ip.gsm<br></b><br>and here is Ramon's script with localplay mod....<br><br>File name - speaktext.sh<br><br>#!/bin/bash<br><br>#<br># Script to speak letters and numbers from asterisk sounds<br># over a radio node using simpleusb<br># by Ramon Gonzalez KP4TR 2014<br>#<br><br>#set -xv<br><br>ASTERISKSND=/var/lib/asterisk/sounds<br>LOCALSND=/tmp/randommsg<br><br><br>function speak {<br> SPEAKTEXT=$(echo "$1" | tr '[:upper:]' '[:lower:]')<br> let SPEAKLEN=$(echo "$SPEAKTEXT" | /usr/bin/wc -m)-1<br> COUNTER=0<br> rm -f ${LOCALSND}.gsm<br> touch ${LOCALSND}.gsm<br> while [ $COUNTER -lt $SPEAKLEN ]; do<br> let COUNTER=COUNTER+1<br> CH=$(echo "$SPEAKTEXT"|cut -c${COUNTER})<br> if [[ $CH =~ ^[A-Za-z_]+$ ]]; then<br> cat ${ASTERISKSND}/letters/${CH}.gsm >> ${LOCALSND}.gsm<br> fi<br> if [[ ${CH} =~ ^-?[0-9]+$ ]]; then<br> cat /var/lib/asterisk/sounds/digits/${CH}.gsm >> ${LOCALSND}.gsm<br> fi<br><br> case $CH in<br> .) cat ${ASTERISKSND}/letters/dot.gsm >> ${LOCALSND}.gsm;;<br> -) cat ${ASTERISKSND}/letters/dash.gsm >> ${LOCALSND}.gsm;;<br> =) cat ${ASTERISKSND}/letters/equals.gsm >> ${LOCALSND}.gsm;;<br> /) cat ${ASTERISKSND}/letters/slash.gsm >> ${LOCALSND}.gsm;;<br> !) cat ${ASTERISKSND}/letters/exclaimation-point.gsm >> ${LOCALSND}.gsm;;<br> @) cat ${ASTERISKSND}letters/at.gsm >> ${LOCALSND}.gsm;;<br> $) cat ${ASTERISKSND}/letters/dollar.gsm >> ${LOCALSND}.gsm;;<br> *) ;;<br> esac<br> done<br><br> <b> asterisk -rx "rpt localplay $2 ${LOCALSND}"</b><br><br>}<br><br>if [ "$1" == "" -o "$2" == "" ];then<br> echo "Usage: speaktext.sh \"abc123\" node#"<br> exit<br>fi<br><br>speak "$1" $2<br><br></font><br><br><b><font style="font-size:16pt;" size="4">73 Doug</font><font style="font-size:16pt;" size="4"><br></font><font style="font-size:16pt;" size="4">WA3DSP</font><font style="font-size:16pt;" size="4"><br></font><font style="font-size:16pt;" size="4">http://www.crompton.com/hamradio</font></b><font style="font-size:16pt;" size="4"><br></font> </div></body>
</html>