Simple Hotel Style Wake-Up Calls
(This work is based on this thread: http://trixbox.org/forums/trixbox-forums/open-discussion/wake-calls-trixbox-ce-how-five-easy-steps) (Updated 12/19/08. The attached scripts have changed. ) These steps and attached scripts should work for any FreePBX based Asterisk installation. (Callback is dependent upon the presence of context: from-internal)
For quite a while, I have been hoping to make the simple, hotel style wake-up function, well, functional again. (Nerd Vittles Voice Reminders is a great application - but it serves a different purpose.)
This procedure will provide the "hotel style" wakeup calls, and will even support "snooze" functions. An “operator” mode is available which allows specific phones to set wake up calls for any extension.
This approach differs from the TrixThread in that only one Dial Plan Fragment is used, instead of two. This version also better uses the FreePBX extension registry, and is easier to change to respond to a phone number other than *62. I have made changes to the attached scripts – thus they are not the same as those on the TrixThread. These should be "drop and run" ready for you when used with the steps outlined below.
Step One:
Create a custom destination.
Custom Destination: custom-wakeup-calls,s,1
Description: Wake Up Calls
Step Two:
Then create a misc application
Description:Wake Up Calls
Feature Code:*62,
Feature Status: Enabled
Destination: Custom Destinations: Wake Up Calls
(You can use any feature code you like here – we use *62.)
Step Three:
Add the following new context, in extensions_override_freepbx.conf
[custom-wakeup-calls]
exten => s,1,Answer
exten => s,2,AGI(wakeup.php)
exten => s,3,Hangup
Step Four:
Next, get the files attached to this article and copy them to /var/lib/asterisk/agi-bin
The PHP files should already be executable if not then, and change ownership to asterisk:asterisk.
cd /var/lib/asterisk/agi-bin
chown asterisk:asterisk wake*
chmod +x wakeup.php
chmod +x wakeconfirm.php
amportal restart
Everything should be running now.
Some folks have had troubles at this point - when they dial *62, they here nothing and nothing happens. Sometimes then they get hung up on. Should this happen to you, try running update-fixes.
Here are some notes about some settings inside /var/lib/asterisk/agi-bin
// Operator Mode, Allow an extension to key in wakeup calls for other extensions
$parm_operator_mode = 1;
// Operator Extension
// Enter any extension that is allowed to enter in operator mode - Caller ID is used to validate
$parm_operator_extensions= array( 0, 15 );
// The max length of an extension when entering by operator
$parm_operator_ext_len = 4;
If you want to change the script so it can run from another number than *62, its easy. In Step 2, Above, enter whatever extension or star code you wish to use in place of *62.
Then edit /var/lib/asterisk/agi-bin/wake.inc:
// Caller ID of who the wakeup call is from Change this to the extension [FONT="] $parm_wakeupcallerid = '"Wake Up Call" <*62>';
I'd like to know how this works for anyone who tries it out.
Next Steps? I would like to learn how to turn this into a module for FreePBX. Some time ago, before getting this version working, I tried using some of the ones that are in the FreePBX user repository - MISTAKE - they reacted poorly with my system. If anyone reading this understand module creation - I'd like to hear from you.
Do you have all this working now and want to go the next step? Check Outside the Box Wake Up calls.
[/FONT]
(This work is based on this thread: http://trixbox.org/forums/trixbox-forums/open-discussion/wake-calls-trixbox-ce-how-five-easy-steps) (Updated 12/19/08. The attached scripts have changed. ) These steps and attached scripts should work for any FreePBX based Asterisk installation. (Callback is dependent upon the presence of context: from-internal)
For quite a while, I have been hoping to make the simple, hotel style wake-up function, well, functional again. (Nerd Vittles Voice Reminders is a great application - but it serves a different purpose.)
This procedure will provide the "hotel style" wakeup calls, and will even support "snooze" functions. An “operator” mode is available which allows specific phones to set wake up calls for any extension.
This approach differs from the TrixThread in that only one Dial Plan Fragment is used, instead of two. This version also better uses the FreePBX extension registry, and is easier to change to respond to a phone number other than *62. I have made changes to the attached scripts – thus they are not the same as those on the TrixThread. These should be "drop and run" ready for you when used with the steps outlined below.
Step One:
Create a custom destination.
Custom Destination: custom-wakeup-calls,s,1
Description: Wake Up Calls
Step Two:
Then create a misc application
Description:Wake Up Calls
Feature Code:*62,
Feature Status: Enabled
Destination: Custom Destinations: Wake Up Calls
(You can use any feature code you like here – we use *62.)
Step Three:
Add the following new context, in extensions_override_freepbx.conf
[custom-wakeup-calls]
exten => s,1,Answer
exten => s,2,AGI(wakeup.php)
exten => s,3,Hangup
Step Four:
Next, get the files attached to this article and copy them to /var/lib/asterisk/agi-bin
The PHP files should already be executable if not then, and change ownership to asterisk:asterisk.
cd /var/lib/asterisk/agi-bin
chown asterisk:asterisk wake*
chmod +x wakeup.php
chmod +x wakeconfirm.php
amportal restart
Everything should be running now.
Some folks have had troubles at this point - when they dial *62, they here nothing and nothing happens. Sometimes then they get hung up on. Should this happen to you, try running update-fixes.
Here are some notes about some settings inside /var/lib/asterisk/agi-bin
// Operator Mode, Allow an extension to key in wakeup calls for other extensions
$parm_operator_mode = 1;
// Operator Extension
// Enter any extension that is allowed to enter in operator mode - Caller ID is used to validate
$parm_operator_extensions= array( 0, 15 );
// The max length of an extension when entering by operator
$parm_operator_ext_len = 4;
If you want to change the script so it can run from another number than *62, its easy. In Step 2, Above, enter whatever extension or star code you wish to use in place of *62.
Then edit /var/lib/asterisk/agi-bin/wake.inc:
// Caller ID of who the wakeup call is from Change this to the extension [FONT="] $parm_wakeupcallerid = '"Wake Up Call" <*62>';
I'd like to know how this works for anyone who tries it out.
Next Steps? I would like to learn how to turn this into a module for FreePBX. Some time ago, before getting this version working, I tried using some of the ones that are in the FreePBX user repository - MISTAKE - they reacted poorly with my system. If anyone reading this understand module creation - I'd like to hear from you.
Do you have all this working now and want to go the next step? Check Outside the Box Wake Up calls.
[/FONT]