[arm-allstar] export DTMF as variable to bash

Patrick Perdue borrisinabox at gmail.com
Wed Oct 30 02:41:07 EDT 2019


Hi all:

This is probably more of an Asterisk question in general. I seem to 
remember being able to do this years ago, but my knowledge is rusty.

Here is what I want to do.

Using DVSwitch, Analog_Bridge and MMDVM_Bridge, I want to create a macro 
that allows linking to any given Brandmeister talkgroup to an Allstar 
node, probably a second, private node linked to primary, so that the 
link can be easily dropped. The way I envision this working is thus.

Call a macro, followed by a 2 to 7 digit talkgroup or DMR ID, which is 
then exported as a variable.

Run a script that first clears all static talkgroups using the 
Brandmeister API via cURL, then sets the TGID in the previously defined 
variable as the only talkgroup using the same API.

Stops MMDVM_Bridge, if it is running.

Finds and replaces a specific line of text in MMDVM_Bridge.ini, defining 
the outbound TGID.

Starts MMDVM_Bridge.

Evaluate the running status of MMDVM_Bridge, and play an appropriate 
sound file to inform the user that the bridge is active, or not, if the 
process isn't running after a second or two, or if the output shows that 
MMDVM_Bridge didn't successfully login to the master server, probably by 
reading the last few lines of MMDVM_Bridge's log if the process is running.

I know how to make most of this happen in bash. What I'm unsure of, 
however, is how to get some digits from Asterisk to a variable that can 
be called from bash, or use functions to do all the same stuff with the 
evaluated digits in Asterisk itself. Also, not sure of the best way to 
have a macro that then executes a script, gets digits, then does things 
with them.

Or, has this already been done, and I am reinventing the wheel?



More information about the ARM-allstar mailing list