Link to home
Start Free TrialLog in
Avatar of mudcow007
mudcow007Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Asterisk scheduled calls?

Hello all

is it possible to scheduled calls in Asterisk?

we are currently running 1.4.7.1 an would love to have the ability to run (internal) calls at specific times

the idea is to use the calls as factory break notifications

thanks
ASKER CERTIFIED SOLUTION
Avatar of tigermatt
tigermatt
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of José Méndez
José Méndez

So, you want the system to automatically open up a broadcast notification type of call to several IP Phones at scheduled times? Or just generate individual calls to a list of phones playing the notification message?
Avatar of mudcow007

ASKER

thanks for the info guys,

what im after is a call at say 10:00am which plays a wav/ gsm

then call at 10:15 plays wav

i have the play command worked out, but its the timing that is throwing me
This really depends on how you want it to work. Same time every day will be easier; different times will mean you need to write custom scripts to produce the call files on demand.

You can "delay" the call being placed by two methods. The first is to set the modify time on the .call file (created as per the format in the link above). Move the call file into the outgoing directory for Asterisk under /var/spool. Asterisk won't read the file and place the call until the time you set the modify date to be.

So, if I wanted to place a call file which doesn't do anything until tomorrow at 10am, I'd create the appropriate file in my home directory, then "touch" it and set the date and time thus:

touch -t 201209041000 ~/mycallfile.call

Finally, use "mv" to move the file into the outgoing directory:

mv ~/mycallfile.call /var/spool/asterisk/outgoing

The file will sit in there until tomorrow at 10am. At that time, Asterisk picks up the call file, will parse it and place the call.

You would need to devise a scripted or manual method to produce call files with the appropriate date and time and move them all into that directory. In theory you could produce the next year's worth of call files and just let them sit there; Asterisk won't do anything with them until the date on the file.

The other way is to have a stack of call files which you fire a cron job at the appropriate time to copy into the /var/spool/asterisk/outgoing directory. This means you don't need to change the modification time; just use cron to make a copy of the pre-existing file and then move it into the directory. Since your modification time would be in the past, Asterisk will pick the file up and place the call straight away. You control the time the call(s) are made by using the cron scheduler. A simple shell script can be written to make the copy and move it into the directory very easily.

-Matt
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
great stuff, so its "do-able"?

question i would like this to be a permanent alarm so could it be set just to run every day at X o'clock?


my idea is to call our paging agi (*96 on our pbx) this sets all handsets to autoanswer an would then hopefully playback a recording etc....

if possible
Can it run every day ?  Yes, just replace the 1-6 (Day of Week) with a *.

You need to read the information on the Call File provided.  An built a context to do what you want.
Fantastic, really appreciate you help guys.

just been looking at cron on my server i looked in

Var > Spool > Cron

i have three folders "atjobs" "atspool" "crontabs"

im presuming i need to make a text file within "crontabs" with something like

# Minute   Hour   Day of Month       Month          Day of Week        Command    
#   (0-59)  (0-23)      (1-31)           (1-12 or Jan-Dec)  (0-6 or Sun-Sat)                
         0        2              12                        *                    0,6                       /usr/bin/find

at the moment the crontabs folder is empty

thanks
im presuming i need to make a text file within "crontabs"?


NO !   su to root / asterisk/ who ever you want it to run as and  and Use the Command "crontab -e"  You can get in trouble doing it manually.
ah i log on as root, i have find its easy messing around with ext's etc

so tried contab -e

which opened up the creation page

fantastic i now have access to use crontab



(thanks for all the help i have done anything like this with * before)
update

i created a .call file with the following

channel: SIP/777@Internal
callerID: "alarm"
maxretries: 1
retrytime: 300
waittime: 45
context: alarm
extension: s
Priority: 1

within my extensions conf

i have added
[alarm]
Exten => s, 1,SIPAddHeader (Call-Info:\; answer-after=0)
Exten => s, n,Dial(SIP/901,,A(hello-world)gS(1))


This worked!! :)

this is now performing the tannoy announcement but dials an extension (777) before it does the call out. when the extension is answered the tannoy announcement is played

is there a way of removing "dial" from the call file?

i have tried commenting the dial string but the call fails

if i could award more than 500 points i would!!
You might want to look at this code sample from John M. over at PBXinaFlash..  

It's got most of the parts you need for the dial plan..

http://www.pbxinaflash.com/community/index.php?threads/delayed-paging.2654/
hi phonebuff, i appreciate the link but i dont really know what part of the code to use?

basically, i have playback/ tannoy part working. But when the message is played, an extensions rings.

the message only rings once that extension is answered

i then need to figure out how to use cron!
I am sorry, best I can for you here is point you the answers.  

You could register and post on the PIF Forum.  

=========================
Fantastic help<br /><br />i changed my extensions around an got the call out to work without calling the extension <br /><br />thanks