Asterisk tips wake-up

Wake-up call


Contributed by Rob Fugina

Still looking for comments/help with a re-implementation. What is published here is the latest version — the one I'm running myself at home.

All the code is GPL.

Feedback is appreciated, both positive and negative. Success stories are especially welcome. Email preferred.

Rob
robf at geekthing dot com

Requirements:

  • Asterisk
  • Additional sounds from asterisk-sounds package in CVS
  • Perl
  • Perl module Date::Manip (available on CPAN)
  • Perl module Asterisk::AGI (see Asterisk perl library)
  • tarball referenced below — run 'make install'.
  • Dialplan entry to call AGI(wakeup.agi)
  • Crontab entry to run the provided run_wakeups script
  • Customize to your environment — see below

Examples:

Example dialplan entry:
exten => 999,1,AGI(wakeup.agi)

If you want wakup.agi in a non-standard place, you'll have to specify the full path in the dialplan:
exten => 999,1,AGI(/full/path/to/wakeup.agi)

Example crontab entry: (/etc/crontab, root's crontab, or whatever user Asterisk is running as)
  • * * * * root /var/spool/asterisk/wakeups/run_wakeups

How It Works

Operation is simple: An AGI is used to schedule a wakeup call in the first place. A call file is created in the wakeups spool that will later be moved into Asterisk's outgoing call spool to make the wakeup call. Another AGI is called directly for the wakeup call itself, and may schedule a future wakeup call based on a selected snooze time.

Where To Get It

The scripts, additional sound files, etc, are available at http://www.geekthing.com/~robf/asterisk/.

Customizing For Your Environment:

The following items are the most likely things you will have to change to suit your particular needs.

  • callerid for wakeup service — change in wakeup.agi
  • local context name for wakeup call to use — change in wakeup.agi and snooze.agi
  • spool directory locations — change in wakeup.agi, snooze.agi, and run_wakeups

Different Versions of Asterisk

There are some differences between stable and development branches of Asterisk in terms of how callerid information is presented to an AGI script. I believe the current version of asterisk-wakeup takes this into account, and should work with either the 1.0 branch or CVS HEAD. Let me know if this is not the case...

Future Directions

I'd like to rewrite the two AGI scripts as regular Asterisk applications (in C). Don't know when I'll have the time...

See also



Go back to Asterisk tips and tricks

Wake-up call


Contributed by Rob Fugina

Still looking for comments/help with a re-implementation. What is published here is the latest version — the one I'm running myself at home.

All the code is GPL.

Feedback is appreciated, both positive and negative. Success stories are especially welcome. Email preferred.

Rob
robf at geekthing dot com

Requirements:

  • Asterisk
  • Additional sounds from asterisk-sounds package in CVS
  • Perl
  • Perl module Date::Manip (available on CPAN)
  • Perl module Asterisk::AGI (see Asterisk perl library)
  • tarball referenced below — run 'make install'.
  • Dialplan entry to call AGI(wakeup.agi)
  • Crontab entry to run the provided run_wakeups script
  • Customize to your environment — see below

Examples:

Example dialplan entry:
exten => 999,1,AGI(wakeup.agi)

If you want wakup.agi in a non-standard place, you'll have to specify the full path in the dialplan:
exten => 999,1,AGI(/full/path/to/wakeup.agi)

Example crontab entry: (/etc/crontab, root's crontab, or whatever user Asterisk is running as)
  • * * * * root /var/spool/asterisk/wakeups/run_wakeups

How It Works

Operation is simple: An AGI is used to schedule a wakeup call in the first place. A call file is created in the wakeups spool that will later be moved into Asterisk's outgoing call spool to make the wakeup call. Another AGI is called directly for the wakeup call itself, and may schedule a future wakeup call based on a selected snooze time.

Where To Get It

The scripts, additional sound files, etc, are available at http://www.geekthing.com/~robf/asterisk/.

Customizing For Your Environment:

The following items are the most likely things you will have to change to suit your particular needs.

  • callerid for wakeup service — change in wakeup.agi
  • local context name for wakeup call to use — change in wakeup.agi and snooze.agi
  • spool directory locations — change in wakeup.agi, snooze.agi, and run_wakeups

Different Versions of Asterisk

There are some differences between stable and development branches of Asterisk in terms of how callerid information is presented to an AGI script. I believe the current version of asterisk-wakeup takes this into account, and should work with either the 1.0 branch or CVS HEAD. Let me know if this is not the case...

Future Directions

I'd like to rewrite the two AGI scripts as regular Asterisk applications (in C). Don't know when I'll have the time...

See also



Go back to Asterisk tips and tricks

Created by: JustRumours, Last modification: Sun 11 of Apr, 2010 (01:25 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+