<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<STYLE><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></STYLE>
<META name=GENERATOR content="MSHTML 11.00.10240.16590"></HEAD>
<BODY id=MailContainerBody class=hmmessage
style="PADDING-TOP: 15px; PADDING-LEFT: 10px; PADDING-RIGHT: 10px" leftMargin=0
topMargin=0 CanvasTabStop="true" name="Compose message area">
<DIV>Doug</DIV>
<DIV>THANK YOU</DIV>
<DIV>You have just opened the door to many script possibilities. You should
write the book</DIV>
<DIV>Scripting in Asterisk"</DIV>
<DIV>Thanks again and I will let you know my results in a week or so</DIV>
<DIV> </DIV>
<DIV>Thanks<BR>73 Neil Sablatzky K8IT<BR>Allstar Node 41838
KITLINK<BR>Allstar Node 42087 KITLINK HUB<BR>IRLP Node exp0068<BR>Echolink
K8IT-L<BR>WIRES-X K8IT 11479 Room 21479</DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=doug@crompton.com
href="mailto:doug@crompton.com">Doug Crompton</A> </DIV>
<DIV><B>Sent:</B> Tuesday, December 08, 2015 4:22 PM</DIV>
<DIV><B>To:</B> <A title=arm-allstar@hamvoip.org
href="mailto:arm-allstar@hamvoip.org">ARM Allstar</A> </DIV>
<DIV><B>Subject:</B> Re: [arm-allstar] scripting - last dtmf digit received in
client display</DIV></DIV></DIV>
<DIV><BR></DIV>
<DIV dir=ltr><FONT color=#000000 face=Tahoma,sans-serif>Neil,<BR><BR> A
couple of more points on my last message. You should comment or delete the line
that plays - "please enter the" It is redundant the digits have already
been passed. With that line removed if you enter *61114300 it will
playback - Frequency 14300.<BR><BR>You could enter a line after the
SayDigits line like this -<BR><BR>exten =>
_1xxxxx,n,Playback(megahertz)<BR><BR>Then it would say - Frequency 14300
megahertz<BR><BR>hertz, kilohertz, and gigahertz are also available.<BR><BR>The
reason to enter the second "1" - 611 - is that it points it to the first
context. In that way you can have 10 sections 0-9 or *610 thru
*619 with parameters after that. Each section could do something else. If
you wanted more you could add a third digit. Each context could have as many
DTMF characters passed to it as desire or it could be none if none are
needed.<BR><BR>Asterisk can make system calls so anything that would run under
Linux can be executed and parameters can be passed. Here is an example of how I
call x10 control from my phone -<BR><BR>exten =>
_1.,1,System(/usr/local/bin/x10 on ${EXTEN:1})<BR><BR>In this case I execute the
x10 program in /usr/local/bin and pass it the parameters "on" and one digit of
the extension.<BR><BR>So if you wanted to pass the frequency to hamlib (I don't
know hamlib parameters so this is JUST and example)<BR><BR></FONT><FONT
color=#000000 face=Tahoma,sans-serif><FONT color=#000000
face=Tahoma,sans-serif>exten => _1.,1,System(/directory-location/hamlib
<freq-command> ${EXTEN})</FONT><BR><BR>The digits can be formatted either
in the extensions file with asterisk commands or sent to an external script for
formatting. <BR><BR>Also note that any playback in asterisk would be global.
That is if you are connected to other nodes they would hear "Frequency
14300" There are ways to get around this by using system calls either in
the dial plan or in a script that directly calls asterisk and executes rpt
commands. You can execute rpt commands from the dialplan but there is no
SayDigit command in Allstar so you would have to use a script to say the
individual digits. An example is in the script that says the IP address which
calls speaktext.sh. If this is an issue then you could go to the extra trouble
but if not it would greatly simplify things.<BR id=FontBreak></FONT><BR><FONT
face=Tahoma,sans-serif>While the example I show uses the current default *61 to
enter the patch you could leave that line intact if you are using it to actually
do patch things and enter a new line with the same parameter except with the
"context=" changed and a different function code defined. So as an example
entering -</FONT><FONT face=Tahoma,sans-serif><BR></FONT><FONT
face=Tahoma,sans-serif><BR></FONT><FONT
face=Tahoma,sans-serif>871=autopatchup,context=command_radio,noct=1,farenddisconnect=1,dialtime=20000,quiet=1
</FONT><FONT face=Tahoma,sans-serif><BR></FONT><FONT
face=Tahoma,sans-serif><BR></FONT><FONT face=Tahoma,sans-serif>and leaving the
61 function alone would mean that you would enter</FONT><FONT
face=Tahoma,sans-serif><BR></FONT><FONT face=Tahoma,sans-serif><BR></FONT><FONT
face=Tahoma,sans-serif>*8711xxxxx to enter a five digit frequency. Of
course the number of frequency digits could be any lenght defined by the x's
indicating a digit.</FONT><FONT face=Tahoma,sans-serif><BR></FONT><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><BR><BR>
<DIV>
<HR id=stopSpelling>
From: doug@crompton.com<BR>To: arm-allstar@hamvoip.org<BR>Date: Tue, 8 Dec 2015
13:46:44 -0500<BR>Subject: Re: [arm-allstar] scripting - last dtmf digit
received in client display<BR><BR>
<STYLE><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></STYLE>
<DIV dir=ltr><FONT color=#000000 face=Tahoma,sans-serif>Neil,<BR><BR> OK
here is a way to do this at least here are the clues to do it. I have not done
it completely for you but what I show here does work.<BR><BR>First in rpt.conf
find the phone patch function - 61<BR><BR>change the context= to
context=command_radio<BR><BR>then in extensions.conf add the following context
at the end -<BR><BR>[command_radio]<BR>exten =>
_1xxxxx,1,Playback(please-enter-the)<BR>exten =>
_1xxxxx,n,Playback(frequency)<BR>exten =>
_1xxxxx,n,SayDigits(${EXTEN})<BR>exten => _1xxxxx,n,Wait(2)<BR>exten =>
_1xxxxx,n,Hangup()<BR><BR>You need to understand asterisk dial plans in order to
understand this but basically the way this is setup if you enter at the
radio *611xxxxx the last 5 digits will be passed as the EXTEN
variable in Asterisk. At that point you could do whatever you wanted with it -
like pass to a script that sent it to hamlib for execution. Of course the number
of digits could be changed and other functions could be added.<BR><BR>When
changing either file you need to either reload then in the client or restart
Allstar.<BR><BR></FONT><FONT face=Tahoma,sans-serif>The Asterisk diaplan is very
powerful but you need to hone up on the commands and syntax!!!<BR><BR>This is
the (more) right way to do this rather than adding stuff to
Allstar.<BR></FONT><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><BR><BR></DIV><BR>_______________________________________________
arm-allstar mailing list arm-allstar@hamvoip.org
http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar Visit the BBB and
RPi2 web page - http://hamvoip.org</DIV></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR><BR>arm-allstar
mailing
list<BR>arm-allstar@hamvoip.org<BR>http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar<BR><BR>Visit
the BBB and RPi2 web page - http://hamvoip.org</BODY></HTML>