<div dir="ltr">Brilliantly written Bryan! Kudos<div><br></div><div>Mike - KD5DFB</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 31, 2013 at 2:14 PM, Bryan D. Boyle <span dir="ltr"><<a href="mailto:bdboyle@bdboyle.com" target="_blank">bdboyle@bdboyle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7/31/13 2:38 PM, Johnny Keeker wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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<br>
</blockquote>
<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/<u></u>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/<u></u>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 class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Bryan<br>
In this world, you must be oh so smart or oh so pleasant.<br>
Well, for years I was smart. I recommend pleasant.<br>
You may quote me.<br>
<br>
Sent from my MacBook Pro.<br>
______________________________<u></u>_________________<br>
App_rpt-users mailing list<br>
<a href="mailto:App_rpt-users@ohnosec.org" target="_blank">App_rpt-users@ohnosec.org</a><br>
<a href="http://ohnosec.org/cgi-bin/mailman/listinfo/app_rpt-users" target="_blank">http://ohnosec.org/cgi-bin/<u></u>mailman/listinfo/app_rpt-users</a><br>
</font></span></blockquote></div><br></div>