<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> You could define multiple functions that called the same script with different parameters or channels. In this case *D1 through *D3 would set channels 1-3. You can add more as you wish and even process additional parameters.<br></font><br id="FontBreak"><font style="" color="#000000" face="Tahoma,sans-serif">D1=cmd,/etc/asterisk/local/set_channel 1 <br></font><font style="" color="#000000" face="Tahoma,sans-serif">D2=cmd,/etc/asterisk/local/set_channel 2</font><br><font style="" color="#000000" face="Tahoma,sans-serif">D3=cmd,/etc/asterisk/local/set_channel 3</font><br><b><font style="font-size:16pt;" size="4">etc....<br><br></font></b><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><font style="">Then in the script test the parameter and execute the </font><font style="">proper command or just use the parameter in the call to the command.</font></font><b><font style="font-size:16pt;" size="4"><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><br></font></b><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"># !/bin/bash<br><br>if [ -z $1 ]<br> then<br> echo "No channel given (1-16)"<br> exit 0<br>fi<br><br>case "$1" in<br><br> 1) Echo "Channel 1"<br> # command for channel 1 to asterisk put here<br> ;;<br><br> 2) echo "Channel 2"<br> # command for channel 2 to asterisk put here<br> ;;<br><br> 3) echo "Channel 3"<br> # command for channel 3 to asterisk put here<br> ;;<br>#etc.... add channels<br><br>esac<br><br>exit</font><b><font style="font-size:16pt;" size="4"><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><br></font></b><font style="font-size:16pt;" size="4"><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">By the way Dave, KB4FXC commented to me that you could use the dialplan in extensions .conf to do this and that is exactly what I did years ago in a script to control my X10 system from the phone in Asterisk.</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br>Here is an example </font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">-</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">[controlx10]</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => s,1,background(doug/enter_x10)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => s,n,Set(TIMEOUT(response)=4)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => s,n,Set(TIMEOUT(digit)=1)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => s,n,WaitExten()</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => s,n,Goto(s,1)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _1.,1,System(/usr/local/bin/x10 on ${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _1.,n,SayNumber(${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _1.,n,Playback(on)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _1.,n,Goto(s,1)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _0.,1,System(/usr/local/bin/x10 off ${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _0.,n,SayNumber(${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _0.,n,Playback(off)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _0.,n,Goto(s,1)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _3.,1,System(/usr/local/bin/x10 dim ${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">;exten => _3.,1,noop(${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _3.,n,Goto(s,1)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _4.,1,System(/usr/local/bin/x10 bright ${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _4.,n,Goto(s,1)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _5.,1,System(/usr/local/bin/x10 allon ${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _5.,n,Goto(s,1)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _6.,1,System(/usr/local/bin/x10 alloff ${EXTEN:1})</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => _6.,n,Goto(s,1)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">;exten => 4,1,Playback(goodbye)</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">;exten => 4,n,Hangup()</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => *,1,Return()</font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3"><br></font><font style="font-size: 12pt;" face="Tahoma,sans-serif" size="3">exten => #,1,Hangup()<br><br>This would need to be setup in Allstar but could work. I think for now an easier and more straightforward way would be to use the script method I proposed above if it works for you.<br><br></font></font><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: k8it@cac.net<br>To: arm-allstar@hamvoip.org<br>Date: Thu, 3 Sep 2015 21:47:33 -0400<br>Subject: Re: [arm-allstar] macro question<br><br>
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>
<div>Thanks Doug. And yes I agree with using scripts. What I am trying to do is
respond to a users DTMF digits for a remote base application. I now have written
script code using hamlib to control my TMV71A radio. it works good but only has
a few preprogrammed memories based on which macro you use.</div>
<div>I would like to instead receive three DTMF digits and process them before
passing them to the radio via hamlib. Somehow there is a way!</div>
<div>If I call a script</div>
<div>is it possible to call an asterisk function from within the script to
receive three DTMF digits directly to the script for more processing?</div>
<div> </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=""><b>From:</b> <a title="doug@crompton.com" href="mailto:doug@crompton.com">Doug Crompton</a> </div>
<div><b>Sent:</b> Thursday, September 03, 2015 8:53 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] macro question</div></div></div>
<div><br></div>
<div dir="ltr"><font color="#000000" face="Tahoma,sans-serif">Neil,<br><br> I
don't think you can pass parameters to a macro. There would be no way to test
for vlaues. Why not call a script and pass parameters there. here is an example
from rpt.conf. This is defined in the [functions] section. *A1 would call this
and execute sayip.sh. 27225 is the passed
parameter.<br><br>A1=cmd,/usr/local/sbin/sayip.sh 27225 <br><br>The in the
sayip.sh script $1 is then defined as 27225. You can have multiple
parameters so if it were -<br><br>A1=cmd,/usr/local/sbin/sayip.sh 1 2
3<br><br>Then in the script $1 would =1, $2 would = 2, and $3 would
=3.<br><br>This yet again shows the power of using scripts over built-in
code.<br><br></font><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>> From: k8it@cac.net<br>> To: arm-allstar@hamvoip.org<br>> Date:
Thu, 3 Sep 2015 19:00:20 -0400<br>> Subject: [arm-allstar] macro
question<br>> <br>> using a macro say for example<br>> *52 which can
call a bash script<br>> How can I pass say the next three DTMF digits to the
script to be processed?<br>> For example if a user enters *52123 where 123 is
three random dtmf digits <br>> how can I pass the 123 digits to the bash
script?<br>> <br>> 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<br>>
<br>> <br>> _______________________________________________<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<br>> <br></div></div>
<BR><hr>
<BR>_______________________________________________<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
<BR><hr>
<BR><a target="_blank"></a>
<p align="left">No virus found in this
message.<br>Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>Version: 2015.0.6125 / Virus
Database: 4409/10570 - Release Date: 09/03/15</p>
<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>