SVXlink Part 2

This is just notes for myself really, but part one can be found here.

Default path for sound files in Debian.  This path depends on your distro;
/usr/local/share/svxlink/sounds/en_US

What I have done to build custom modules into SVXlink is to use DTMF tones to trigger external scripts.  Those scripts are written in Bash or Python.

Drop a file in the following path, copy and paste below, edit as needed.  As you can see, toggling a DTMF tone will run a script and send me an eMail.
/usr/local/share/svxlink/events.d/local/Logic.tcl

###############################################################################
#
# Generic Logic event handlers (local extension)
#
###############################################################################
# This is the namespace in which all functions and variables below will exist.
#
namespace eval Logic {
# Executed when a DTMF command has been received
# cmd - The command
#
# Return 1 to hide the command from further processing is SvxLink or
# return 0 to make SvxLink continue processing as normal.
#
proc dtmf_cmd_received {cmd} {
global active_module
if {$active_module != "" && [string index $cmd 0] != "*"} {
return 0
}
if {[string index $cmd 0] == "*"} {
set cmd [string range $cmd 1 end]
}
if {$cmd == "99"} {
puts "Executing external command 99"
playMsg "Core" "relay4"
exec mail -a /home/revmook/test.text -s "DTMF command test 99" revmook at echoparklake dot clam < /dev/null &
return 1
}
if {$cmd == "98"} {
puts "Executing external command 98"
playMsg "Core" "relay3"
exec mail -a /home/revmook/test.text -s "DTMF command test 98" revmook at echoparklake dot clam < /dev/null &
return 1
}
if {$cmd == "97"} {
puts "Executing external command 97"
playMsg "Core" "relay2"
exec mail -a /home/revmook/test.text -s "DTMF command test 97" revmook at echoparklake dot clam < /dev/null &
return 1
}
if {$cmd == "96"} {
puts "Executing external command 96"
playMsg "Core" "relay1"
exec mail -a /home/revmook/test.text -s "DTMF command test 96" revmook at echoparklake dot clam < /dev/null &
return 1
}
return 0

External sounds for the above script go in this path.  Please note SVXlink is picky about the file format. I can’t recall what it is (mono 16 bit I think) but it will error out if things are not right.
/usr/local/share/svxlink/sounds/en_US/Core

Leave a Reply