<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.hoenzb
{mso-style-name:hoenzb;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Very nice – I do something quite similar.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I note that you can define a function to tell Allison to “be quiet” for example<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>9940=cop,34 ; local telemtry off<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I execute *9940 at the start of my multi step script and it helps keep things a bit more quiet.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>At the end, I turn it back on with cop,33.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Of course, this only does the local node. I suppose you could execute such a function on the remote node to turn off announcements (after the first one).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have a DSTAR machine at the same site and it sends commands to the asterisk machine, in some cases, using OS scripts like this.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>73<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ken<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Michael Hebert [mailto:mhebert1975@gmail.com] <br><b>Sent:</b> Wednesday, July 31, 2013 3:21 PM<br><b>To:</b> Bryan D. Boyle<br><b>Cc:</b> app_rpt mailing list<br><b>Subject:</b> Re: [App_rpt-users] Access Command Mode With A Macro<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Brilliantly written Bryan! Kudos<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Mike - KD5DFB<o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Wed, Jul 31, 2013 at 2:14 PM, Bryan D. Boyle <<a href="mailto:bdboyle@bdboyle.com" target="_blank">bdboyle@bdboyle.com</a>> wrote:<o:p></o:p></p><p class=MsoNormal>On 7/31/13 2:38 PM, Johnny Keeker wrote:<o:p></o:p></p><p class=MsoNormal>The question is, can a macro be created to connect to a node and then put it in the command mode? I've tried creating the usual macro example.<br>[macro]<br>1=*325555*425555#<br>*51 only calls the 25555 node yet it does not take into account the *425555<o:p></o:p></p><p class=MsoNormal><br>Colin Chapman, founder of Lotus, had a favorite saying: "Simplify and add lightness".<br><br>When you get into complex command strings and trying to make the machines jump through hoops, brew coffee, and change the baby at the same time, it's easy to forget that there is more than one way to accomplish what you are trying to do or gore an ox or stuff a ballot box (if you're in Chicago).<br><br>Ever thought of writing an OS shell script? There you now have somewhat more programmatic control over HOW and IN WHAT sequence commands are executed, can pause in between commands to allow them to run to completion, do variable substitution so that the same shell, with different values passed to it, can be used for multiple functions.<br><br>In short, to me, it makes more sense.<br><br>Here, is an example of a useful Macro tied to a schedule:<br><br>[macro27XXX]<br>09=*81#<br><br>[schedule27XXX] <br>09 = 00 * * * *<br><br>Which plays the time at the top of every hour. Clean. Neat. Simple. Brilliant. No pillocks here....<br><br>But, what if you want to unlink two hub nodes, link another node through a secondary hub (because your brother ops object to the other node because it's a 2-meter link radio?) and tell everyone that it's done? Wow. Tell me the command string for that.<br><br>I do not see that as a macro job.<br><br>How about a script to do it:<br><br>Call this script linkconnect.sh. Put it in a scripts directory somewhere, like /etc/asterisk/scripts, strangely enough...<br><br>Call it from rpt.conf:<br>9XX=cmd,/etc/asterisk/scripts/linkconnect.sh<br><br>--<br># Call a shell, no error checking, WYSIWYG, down and dirty<br>#!/bin/bash<br><br>#Send Asterisk a function message to unlink the two hubs<br>/usr/sbin/asterisk -rx "rpt fun 27123 *127234#"<br><br>#wait for all the gyrations and Allison to shut up<br>sleep 5<br><br>#Now, send a message to the second hub in the network to link<br>#to the link radio node 27999<br>/usr/sbin/asterisk -rx "rpt fun 27123 *428999*327999#"<br><br>#Wait for it....<br>sleep 2<br><br>#Now, play an announcement that the new configuration is up and going.<br>/etc/asterisk/scripts/w3skconnect<br>--<br><br><br>(obviously not the real node numbers, apologies to the holders of those numbers if they're in live use.)<br><br>Now, you can define a 'macro' as, say,<br>10=*9xx# ;call the function numbered 9XX<br><br>This gives you added flexibility and the ability to either call, using the internal schedule, on a fixed value, the shell you wrote, or using the OS cron facility, from a cronjob, or, even just run from the shell.<br><br>Don't fixate on one solution as being better...sometimes imagination is the key to creativity and indecision is the key to flexibility.<span style='color:#888888'><br><br><br><span class=hoenzb>-- </span><br><span class=hoenzb>Bryan</span><br><span class=hoenzb>In this world, you must be oh so smart or oh so pleasant.</span><br><span class=hoenzb>Well, for years I was smart. I recommend pleasant.</span><br><span class=hoenzb>You may quote me.</span><br><br><span class=hoenzb>Sent from my MacBook Pro.</span><br><span class=hoenzb>_______________________________________________</span><br><span class=hoenzb>App_rpt-users mailing list</span><br><span class=hoenzb><a href="mailto:App_rpt-users@ohnosec.org" target="_blank">App_rpt-users@ohnosec.org</a></span><br><span class=hoenzb><a href="http://ohnosec.org/cgi-bin/mailman/listinfo/app_rpt-users" target="_blank">http://ohnosec.org/cgi-bin/mailman/listinfo/app_rpt-users</a></span></span><o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>