Hereâs how I accomplish this on my system with scripts. I use permanent links incase it becomes disconnected, it will reestablish the link automatically.
Hereâs one example from my crontab:
#Connect to Texas X-Reflector 497330 at 7:35am
35 7 * * * /etc/asterisk/local/connect.sh 525240 497330 > /dev/null 2>&1
#Disconnect from Texas X-Reflector at 9:00am
1 9 * * * /etc/asterisk/local/disconnect.sh 525240 497330 > /dev/null 2>&1
Here are the scripts, remember that you have to make the executable:
first one is the connect.sh script:
#!/bin/bash
#Connect Script for Crontab
#Made by K6IAN 11/11/2020
#Example usage in crontab
#00 09 * * * /etc/asterisk/local/connect.sh 40000 40001
#This says connect at 0900 (9AM - Minutes first then hours) node 40000
#to node 40001
#This can also be used on the command line
#Local playback connect message
/usr/sbin/asterisk -rx ârpt localplay $1 /etc/asterisk/local/conf_connectâ
sleep 1
#Connect permanent link
/usr/sbin/asterisk -rx ârpt cmd $1 ilink 13 $2â
the second one is disconnect.sh script:
#!/bin/bash
#Disconnect Script for Crontab
#Made by K6IAN 11/11/2020
#Example usage in crontab
#00 09 * * * /etc/asterisk/local/disconnect.sh 40000 40001
#This says disconnect at 0900 (9AM - Minutes first then hours) node 40000
#to node 40001
#This can also be used on the command line
#Disconnect permanent link
/usr/sbin/asterisk -rx ârpt cmd $1 ilink 11 $2â
sleep 1
#Local playback disconnect message
/usr/sbin/asterisk -rx ârpt localplay $1 /etc/asterisk/local/conf_disconnectâ
I have two audio files that I created âconf_connect.ulawâ and âconf_disconnect.ulawâ that you can see that the scripts call up and play locally. I created those by running these following commands:
cat /var/lib/asterisk/sounds/conference.ulaw /var/lib/asterisk/sounds/connected.ulaw > /etc/asterisk/local/conf_connect.ulaw
cat /var/lib/asterisk/sounds/conference.ulaw /var/lib/asterisk/sounds/disconnected.ulaw > /etc/asterisk/local/conf_disconnect.ulaw
I canât take the credit fully for all of this, as I usually browse the forums and look at what others are doing and then try it another way to be different⌠lol
-Ian K6IAN