<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="" 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 style="" color="#000000" face="Tahoma,sans-serif"><font style="" 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 style="" 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 style="" face="Tahoma,sans-serif"><br></font><font style="" face="Tahoma,sans-serif"><br></font><font style="" face="Tahoma,sans-serif">871=autopatchup,context=command_radio,noct=1,farenddisconnect=1,dialtime=20000,quiet=1 </font><font style="" face="Tahoma,sans-serif"><br></font><font style="" face="Tahoma,sans-serif"><br></font><font style="" face="Tahoma,sans-serif">and leaving the 61 function alone would mean that you would enter</font><font style="" face="Tahoma,sans-serif"><br></font><font style="" face="Tahoma,sans-serif"><br></font><font style="" 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 style="" 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 style="" 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 style="" 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></body>
</html>