<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">A cleaner way using Doug's awk entry is
      this one liner:<br>
      <br>
      <big>./speaktext.sh "IP $(ifconfig eth0 | awk '/inet / {print
        $2}')" XXXXX</big><br>
      <br>
      where XXXXX is your local node number......<br>
      <br>
      <br>
      <br>
      On 7/28/2014 11:07 PM, Doug Crompton wrote:<br>
    </div>
    <blockquote cite="mid:BLU172-W39895683F6061DD4EAA6B5BAF80@phx.gbl"
      type="cite">
      <style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
      <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"><a class="moz-txt-link-freetext" href="http://www.crompton.com/hamradio">http://www.crompton.com/hamradio</a></font></b><font
          style="font-size:16pt;" size="4"><br>
        </font> </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________

arm-allstar mailing list
<a class="moz-txt-link-abbreviated" href="mailto:arm-allstar@hamvoip.org">arm-allstar@hamvoip.org</a>
<a class="moz-txt-link-freetext" href="http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar">http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar</a>

Visit the BBB web page - <a class="moz-txt-link-freetext" href="http://www.crompton.com/hamradio/BeagleBoneBlackAllstar/">http://www.crompton.com/hamradio/BeagleBoneBlackAllstar/</a></pre>
    </blockquote>
    <br>
  </body>
</html>