Simple Hotel Style Wake-Up Calls

Hat

Guru
Joined
Dec 18, 2007
Messages
88
Reaction score
0
***Original code corrected by tshif, this post no longer valid.****

Just a heads up for anyone doing the copy and paste thing with the outside wake up call scripts.

This line of code reads:
Code:
[FONT=Arial]exten => s,3,Authenticate (1234567)[/FONT]
Eliminate the space after Authenticate
Code:
[FONT=Arial]exten => s,3,Authenticate(1234567)[/FONT]
If not, the system will hang up and give you an error in your log along the lines of "WARNING:..No Authenticate Program...". At least that is what it did for me.

Tom

***Original code corrected by tshif, this post no longer valid***
 

couchmonster

New Member
Joined
Dec 16, 2008
Messages
1
Reaction score
0
As far as I can tell, the problem with these files is that the .php ones are in a windows txt format. I.e. CR instead of LF.

Just my 2c worth =D
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
:iagree: Yup - I think so too. Seems there are a couple of work arounds posted that get the job done - that's good news.
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Just a heads up for anyone doing the copy and paste thing with the outside wake up call scripts.

This line of code reads:
Code:
[FONT=Arial]exten => s,3,Authenticate (1234567)[/FONT]
Eliminate the space after Authenticate
Code:
[FONT=Arial]exten => s,3,Authenticate(1234567)[/FONT]
If not, the system will hang up and give you an error in your log along the lines of "WARNING:..No Authenticate Program...". At least that is what it did for me.

Tom

Tom - Thanks for pointing this out. I fixed it in the original post. Tony
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
After I enter the time and am/pm, I get something has gone horribly wrong. Please try again later. What should I do?
Code:
    PBX in a Flash Version 1.3 Daemon Status
********************************************************************
* Asterisk  * ONLINE  * Zaptel    * ONLINE  * MySQL      * ONLINE  *
* SSH       * ONLINE  * Apache    * ONLINE  * Iptables   * ONLINE  *
* Fail2ban  * ONLINE  * IP Connect* ONLINE  * Ip6tables  * ONLINE  *
* BlueTooth * ONLINE  * Hidd      * ONLINE  * NTPD       * ONLINE  *
* Sendmail  * ONLINE  * Samba     * ONLINE  * Webmin     * ONLINE  *
* Ethernet0 * ONLINE  * Ethernet1 *   N/A   * Wlan0      *   N/A   *
********************************************************************
* Running Asterisk Version : Asterisk 1.4.21.2
* Asterisk Source Version  : 1.4.21.2
* Zaptel Source Version    : 1.4.12.1
* Libpri Source Version    : 1.4.7
* Addons Source Version    : 1.4.7
********************************************************************
pbx.local on 192.168.1.24 - eth0
CentOS release 5.2 (Final) :32 Bit Kernel: 2.6.18-92.1.6.el5
Code:
   -- Executing [*62@from-internal:1] Macro("SIP/2000-09da5e18", "user-callerid|") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/2000-09da5e18", "AMPUSER=2000") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("SIP/2000-09da5e18", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("SIP/2000-09da5e18", "1|Set|REALCALLERIDNUM=2000") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/2000-09da5e18", "AMPUSER=2000") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/2000-09da5e18", "AMPUSERCIDNAME=Lindsay Family") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/2000-09da5e18", "0?report") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/2000-09da5e18", "AMPUSERCID=2000") in new stack
    -- Executing [s@macro-user-callerid:8] Set("SIP/2000-09da5e18", "CALLERID(all)="Lindsay Family" <2000>") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/2000-09da5e18", "REALCALLERIDNUM=2000") in new stack
    -- Executing [s@macro-user-callerid:10] ExecIf("SIP/2000-09da5e18", "0|Set|CHANNEL(language)=") in new stack
    -- Executing [s@macro-user-callerid:11] GotoIf("SIP/2000-09da5e18", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:12] Set("SIP/2000-09da5e18", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:13] GotoIf("SIP/2000-09da5e18", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,20)
    -- Executing [s@macro-user-callerid:20] NoOp("SIP/2000-09da5e18", "Using CallerID "Lindsay Family" <2000>") in new stack
    -- Executing [*62@from-internal:2] Answer("SIP/2000-09da5e18", "") in new stack
    -- Executing [*62@from-internal:3] Wait("SIP/2000-09da5e18", "1") in new stack
    -- Executing [*62@from-internal:4] AGI("SIP/2000-09da5e18", "wakeup.php") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/wakeup.php
    -- Playing 'welcome' (escape_digits=) (sample_offset 0)
    -- Playing 'please-enter-the' (escape_digits=0123456789) (sample_offset 0)
    -- Playing 'time' (escape_digits=0123456789) (sample_offset 0)
    -- Playing 'for' (escape_digits=0123456789) (sample_offset 0)
    -- Playing 'your' (escape_digits=0123456789) (sample_offset 0)
    -- <SIP/2000-09da5e18> Playing 'wakeup-call' (language 'en')
    -- <SIP/2000-09da5e18> Playing '1-for-am-2-for-pm' (language 'en')
    -- Playing 'something-terribly-wrong' (escape_digits=) (sample_offset 0)
    -- Playing 'goodbye' (escape_digits=) (sample_offset 0)
  == Spawn extension (from-internal, *62, 4) exited non-zero on 'SIP/2000-09da5e18'
    -- Executing [h@from-internal:1] Macro("SIP/2000-09da5e18", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] ResetCDR("SIP/2000-09da5e18", "w") in new stack
    -- Executing [s@macro-hangupcall:2] NoCDR("SIP/2000-09da5e18", "") in new stack
    -- Executing [s@macro-hangupcall:3] GotoIf("SIP/2000-09da5e18", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,6)
    -- Executing [s@macro-hangupcall:6] GotoIf("SIP/2000-09da5e18", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing [s@macro-hangupcall:9] GotoIf("SIP/2000-09da5e18", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,11)
    -- Executing [s@macro-hangupcall:11] Hangup("SIP/2000-09da5e18", "") in new stack
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/2000-09da5e18' in macro 'hangupcall'
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/2000-09da5e18'
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
rossiv;
More info please.

Can we see your dial plan for telephone style wake-up calls, and describe exactly how you created and installed the scripts, and where you got them from. It will make it possible for us to help figure it out.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Tshif,

I got the code from the first post of this topic. Im not sure what you mean by created and installed the scripts, but I did exactly as the instructions say on the first post of this topic.
Code:
[SIZE=3]
[B]Step One:[/B]
Create a custom destination. 
Custom Destination: [B][I]custom-wakeup-calls,s,1[/I][/B]
Description: Wake Up Calls

[B]Step Two:[/B]
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.)

[B]Step Three[/B]:
Add the following new context, in [/SIZE]          [SIZE=3][COLOR=black][URL="https://192.168.64.211/maint/configedit/phpconfig.php?file=extensions_override_freepbx.conf&section=extensions_override_freepbx.conf"][COLOR=black]extensions_override_freepbx.conf[/COLOR][/URL]

[/COLOR][/SIZE][SIZE=3][custom-wakeup-calls]
exten => s,1,Answer
exten => s,2,AGI(wakeup.php)
exten => s,3,Hangup


[B]Step Four[/B]:
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[/SIZE]
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Got it! Manually creating the files in NANO by copying and pasting worked!

Thanks!!
 

edisoninfo

Guru
Joined
Nov 19, 2007
Messages
505
Reaction score
4
For people with shell access, this works:

vi wakeup.php
press the : key
set ff=unix <enter>
press the : key
qw <enter>

Do that for each file to set the file format (ff) to unix

BTW: <enter> means press the enter key at this point!
 

frontline

Member
Joined
Oct 18, 2007
Messages
110
Reaction score
0
dos2unix

from the manpage (man dos2unix)
"dos2unix, the program that converts plain text files in DOS/MAC format to UNIX format."
 

MGD4me

Guru
Joined
Feb 3, 2009
Messages
505
Reaction score
109
Works great for me too! The only change I made was to delete the '5-minute snooze' option, so that the first snooze choice is 10 minutes. Just a personal preference, nothing more. Thanks for making this work!
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Hotel Style Wake-Up Calls: THE MODULE

For more than a little while I have been trying to understand how to make a FreePBX Module.

I've read the development wiki, taken modules apart and tried to understand what the HECK is going on under the hood, and....

Well - it may have actually worked. I made a Module out of the Hotel Style Wake-Up Call Dial plan. This is a work in progress - and while it works and creates no known issues, I do not yet recommend it for a production or mission critical use.

While still absent a feature or two I would like to see added to it, here's what it does so far:
  • Installs using the regular method in FreePBX (Upload the module to FreePBX, then Manage Local Modules to install it)
  • Creates the dial plan in extensions_additional.conf - along side the other modules.
  • Places (symbolic links to) the Wakeup program files in /var/lib/asterisk/agi-bin - right where they belong.
  • Full support for standard FreePBX module management functions uninstall and disable.
  • Fully supports the FreePBX Feature Codes management page, including the ability to change the feature code, and enable and disable the feature.
What it does not do so far:
  • Does not have a functional user interface to allow the user to configure the Operator Mode - although provisions to add that ability have been made.
(If your good with PHP, and are interested in this project, send me a message - Id love to have someone help add this ability.)
  • Does not support the "Wake-Up Calls Outside the Box" authentication functions as of yet.
This version has been tested only on FreePBX v 2.5.x, under Asterisk 1.4. On other platforms, your mileage may vary.

If you want to try this new way of deploying Hotel Style Wake Up Calls - make sure:
  1. You remove any and all other versions of this series of wakeup programs. Remove the files in agi-bin, and any FreePBX special destination, or misc applications that exist for previous versions.
  2. This version may interact in unanticipated ways if you are using the version I wrote about earlier in this thread that supports calling to OUTSIDE telephone numbers. Make sure you test that version (WakeUp Calls Outside the Box) to assure that this module version doesn't mangle it somehow.
You can download the module here. (updated 2/6/09 11:30 PM)

Since this is my first ray gun, um, MODULE - I would really like to know if anyone tries it, and how it works for you.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Terribly Wrong Again!

Ok, I have posted in this thread many times. Again, I have the issue that after I choose the AM/PM option, I get "Something is terribly wrong. Goodbye.". What's up with that? I have re-installed in a previous post, and that fixed it for like about a week, but it stops after a week. Anyone know what could be causing this?

FreePBX 2.5.1.1
Asterisk 1.4.21.2
PIAF 1.3

Ross

Asterisk Log:
Code:
-- Executing [*62@from-internal:1] Macro("SIP/2000-08fdb798", "user-callerid|") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/2000-08fdb798", "AMPUSER=2000") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("SIP/2000-08fdb798", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("SIP/2000-08fdb798", "1|Set|REALCALLERIDNUM=2000") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/2000-08fdb798", "AMPUSER=2000") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/2000-08fdb798", "AMPUSERCIDNAME=Lindsay Family") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/2000-08fdb798", "0?report") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/2000-08fdb798", "AMPUSERCID=2000") in new stack
    -- Executing [s@macro-user-callerid:8] Set("SIP/2000-08fdb798", "CALLERID(all)="Lindsay Family" <2000>") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/2000-08fdb798", "REALCALLERIDNUM=2000") in new stack
    -- Executing [s@macro-user-callerid:10] ExecIf("SIP/2000-08fdb798", "0|Set|CHANNEL(language)=") in new stack
    -- Executing [s@macro-user-callerid:11] GotoIf("SIP/2000-08fdb798", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:12] Set("SIP/2000-08fdb798", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:13] GotoIf("SIP/2000-08fdb798", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,20)
    -- Executing [s@macro-user-callerid:20] NoOp("SIP/2000-08fdb798", "Using CallerID "Lindsay Family" <2000>") in new stack
    -- Executing [*62@from-internal:2] Answer("SIP/2000-08fdb798", "") in new stack
    -- Executing [*62@from-internal:3] Wait("SIP/2000-08fdb798", "1") in new stack
    -- Executing [*62@from-internal:4] AGI("SIP/2000-08fdb798", "wakeup.php") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/wakeup.php
    -- Playing 'welcome' (escape_digits=) (sample_offset 0)
    -- Playing 'please-enter-the' (escape_digits=0123456789) (sample_offset 0)
    -- Playing 'time' (escape_digits=0123456789) (sample_offset 0)
    -- Playing 'for' (escape_digits=0123456789) (sample_offset 0)
    -- Playing 'your' (escape_digits=0123456789) (sample_offset 0)
    -- <SIP/2000-08fdb798> Playing 'wakeup-call' (language 'en')
    -- <SIP/2000-08fdb798> Playing '1-for-am-2-for-pm' (language 'en')
    -- Playing 'something-terribly-wrong' (escape_digits=) (sample_offset 0)
    -- Playing 'goodbye' (escape_digits=) (sample_offset 0)
  == Spawn extension (from-internal, *62, 4) exited non-zero on 'SIP/2000-08fdb798'
    -- Executing [h@from-internal:1] Macro("SIP/2000-08fdb798", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] ResetCDR("SIP/2000-08fdb798", "w") in new stack
    -- Executing [s@macro-hangupcall:2] NoCDR("SIP/2000-08fdb798", "") in new stack
    -- Executing [s@macro-hangupcall:3] GotoIf("SIP/2000-08fdb798", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,6)
    -- Executing [s@macro-hangupcall:6] GotoIf("SIP/2000-08fdb798", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing [s@macro-hangupcall:9] GotoIf("SIP/2000-08fdb798", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,11)
    -- Executing [s@macro-hangupcall:11] Hangup("SIP/2000-08fdb798", "") in new stack
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/2000-08fdb798' in macro 'hangupcall'
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/2000-08fdb798'
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Ross;
I would start by asking myself what changes / maintenance had been performed around the time that you began seeing the error again. Sine we all know the situation didnt just change itself magically - we should focus on finding out whats messing with your setup after you already have it working.

Did you restore from backups, or run any pbxiaf scripts - install any other software, or make any other changes to any configs during that time?

I would also be very interested to know what you have to do to correct the problem in these cases - since that could also lead us to the answer "What is happening to the WakeUp call function?"

You breifly mentioned having to "resinstall as per a previous post" - I'm not really able to figure out which post you refer to - and which exact installation method you are using. The biggie - I would hope anyway, would be figuring our exactly what step you do to fix it - so we can look to see what may be whacking it in the first place.

Fill in some of the informational "blanks" - and lets see if we can figure out whats happening to you.

-tshif
 

jeffmac

Guru
Joined
Jan 16, 2008
Messages
230
Reaction score
9
While I don't claim to be a comprehensive beta tester(and I've never played one on tv!...) I have installed the FREEPBX module for wake up calls successfully. My simple "set one", "let it ring", "set one", "cancel it" test was successful.

I don't know how often I'll use it, but was interested to try it out. No problems with the install, or my simple-minded test.
Jeff
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
The only thing AT ALL that I have done is add VoicePulse trunks to my PIAF server. Nothing else at all. What I did to correct it last time was mentioned in a post 1 or 2 pages back on this thread. I opened the files in windows notepad, and copied and pasted the text into NANO using SSH access. That worked for like 2 weeks, then the problems came back. That is how I fixed it before. I have not tried that yet for this time. Umm, gosh! I dont think I did much else in the way of changing things or installing new stuff.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Ok. This is spooky. All of the sudden there is ANOTHER wake-up call code on my system. There is *62 (Original) and now *68. *62 Does not work, but *68 does. Anyone have a clue why that was created? Anyway...it works. But how do I enable the operator function for that or the original? I can not seem to get it to work. Maybe the module created *68. I did try to do that and maybe it worked..the code anyway. I can NOT do anything with the module on my server. Nothing changes on the online module if I change it there or in config.
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
If you want to try this new way of deploying Hotel Style Wake Up Calls - make sure:
  1. You remove any and all other versions of this series of wakeup programs. Remove the files in agi-bin, and any FreePBX special destination, or misc applications that exist for previous versions.
  2. This version may interact in unanticipated ways if you are using the version I wrote about earlier in this thread that supports calling to OUTSIDE telephone numbers. Make sure you test that version (WakeUp Calls Outside the Box) to assure that this module version doesn't mangle it somehow.

Ross - you might wanna slow down, and read the entire article before jumping in. You didn't remove the previous version, did you my friend? :)

I suggest you (1) uninstall the wake up module, then (2) go and remove any parts of the previous version you had installed manually. Then you can reinstall the module. Look for 'Wake Up Calls" on the Free PBX tools menu. You'll see the user interface (which is not finished/working yet), below which you'll find the instructions for activating to operator mode.

Use the FreePBX Feature Control page to change the feature code used by the Wakeup Module. With the module, we never have to edit the dial plan directly. As the on screen notes discuss, we only have to edit the params for the operator mode.

The good news is we are working away completing the user interface so even those manual edits wont be needed any more.

- tshif
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
While I don't claim to be a comprehensive beta tester(and I've never played one on tv!...) I have installed the FREEPBX module for wake up calls successfully. My simple "set one", "let it ring", "set one", "cancel it" test was successful.

I don't know how often I'll use it, but was interested to try it out. No problems with the install, or my simple-minded test.
Jeff

Excellent Jeff -thanks for the feedback. From time to time, Ill be releasing upgrades - as I complete the modules user interface. I hope youll be around to check those out too.

-tshif
 

Members online

Forum statistics

Threads
25,782
Messages
167,512
Members
19,203
Latest member
frapu
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.
Top