Upgrade 3CX to v18 and get it hosted free!

Asterisk tips Wake-Up Call Perl

Author image

Note, bug fixes

Version 1.1 – Referred to wrong file in call file. Thanks to Tom Arnold for noticing.
Version 1.2 – 10/21/2014 – Added error checking for digit entry. (done by http://jonathanmanning.com)

This is another wakeup script for Asterisk. Why another one? Well, I
have seen some great solutions out there prior to this one. I was in
need of a solution that allowed for several calls though. I also wanted
to get some experience with AGI on Asterisk.
This is a single script that does it all without any type of daemon, cron job or
similar. Just a perl script that works almost completely out of the outgoing
folder. I tried to make a clean solution with no dependencies outside of
regular Asterisk.

Installation
Just drop the script in /var/lib/asterisk/agi-bin/ (or wherever you have your
agi scripts). Make it executable. Make sure the /var/spool/asterisk/outgoing
and /var/spool/asterisk/wakeups exist with the correct permission.

In your dial plan, do something along the lines…
exten => *63,1,Answer
exten => *63,2,AGI(jwakeup.agi)
exten => *63,3,Hangup

Features

  • Single script
  • No daemon, no crontab
  • Can schedule an unlimited amount of wakeup calls
  • Can list them and delete individual calls
  • Reoccurring wakeups as well as “one-time” wakeups
  • Snooze
  • Allows you to press keys in the middle of prompts

Dependencies
Asterisk 1.4 (could work on 1.2 as well, I am not sure)
General perl with Time
Unix touch command
Core sounds and extra sounds

How it works
The program works almost completely out of the /var/spool/asterisk/outgoing
directory (there is a use of /var/spool/asterisk/wakeups as well, but that is
for temporary files and you could instead use /tmp if you want).
The solution is based on typical Asterisk call files. If you don’t run
asterisk as root, make sure you have write permissions in the above directories.
The program uses the unix touch command to set the time of the wakeup. Make
sure the path to touch is correctly reflected in the program
(my $TOUCH = “/usr/bin/touch”).

Contact
I am not setting out to further develop this script. If you find bugs please
let me know ([email protected]) and I might fix them 🙂
I have been using this script myself for a couple of months so I am convinced
that it runs fine. There might still be corner cases that I have not run into

Thanks,

// Jonas

This is the newest version of the script. I modified version 1.1 and made some changes to error checking/validation.

Download for Asterisk and AstLinux (10/21/2014) http://jonathanmanning.com/2014/10/21/asterisk-and-astlinux-wake-up-call-agi-script/

Go Back to: Asterisk tips and tricksAsterisk AGI

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.