#!/bin/bash # Send a recorded message to every logged-in asterisk extension # Copyright Noel Butler 2017-2019 # Licensed under GPL v3.0 ... modify to suite your needs # # DANGER: Do not run unless you absolutely must send a mass message to every # phone extension on your system # # Usage: Set the extension start and end numbers below # Set "Data" to sound files - # hellovoiceengineer (is a static intro advising important msg follows) # emergmessage (the current message) upload or use freepbx to record it # For prevention of accidental use COMMENT the "exit" below before running # Change "CallerID" below to suite your organisation # ###################################################################################### cd /var/tmp exit start=601 end=601 for ((i=start; i<=end; i++));do echo $i echo "Channel: Local/$i@ext-local CallerID: \"Voice Engineer\" <7000> Application: Playback Data: silence/1&custom/hellovoiceengineer&silence/1&custom/emergmessage&goodbye Archive: No MaxRetries: 2 RetryTime: 10 WaitTime: 45 " > CALLFILE chown asterisk:asterisk CALLFILE mv CALLFILE /var/spool/asterisk/outgoing/$i-$(date +%T).call sleep 3 done