I have had success with creating custom node announcements. Now I would like to have a macro the plays a particular voice file on the local machine whenever executed. Seems simple enough. Help appreciated!
First you need a short script like this:
#! /bin/bash
/usr/sbin/asterisk -rx "rpt localplay 1111 CERTnetTonight"
Replace 1111 with your node number. Note the filename extension is NOT included. The file needs to be in /var/lib/asterisk/sounds
or you need to specify the full path.
And then see this post to learn how to call a script:
Timâs suggestion is truly the âmacroâ way of doing it, for sure.
Another way I could see one doing this is using the [functionsxxxxx]
(where xxxxx = node #) stanza in your /etc/asterisk/rpt.conf
file.
I have a line in there like so:
84=localplay,/var/lib/asterisk/sounds/rpt/k4sip_uhf
This will just play the referenced wav on the node with which youâre including it into on functions stanza, short and sweet. (Notice Iâve shoved it into the ârptâ subdirectory under sounds, so thatâs why the path looks like that)
So on the node, anytime I dial *84, I can bore anyone with the content of that wav, on-demand.
Timâs idea is better though, because not only can you use the bash script, once written, in your macro definition(s) within rpt.conf, you can also use âcrontab -eâ to edit your crontab into running the same bash script as a timed cron job to execute that sound-playing task daily, hourly, weekly, every 3 hours, whatever⌠using the ârpt localplay xxxxxâ function.
Iâm mentioning all this in case it helps anyone else out Good luck have fun
Byron