Simple Hotel Style Wake-Up Calls – THE MODULE

Okay, I tested it. Initially it didn't work (Caller ID displayed "unknown" for both name and number) so I totally uninstalled it - as in, used phpMyAdmin to drop the entire hotelwakeup table, then uninstalled it from module admin, then reinstalled it. When I went back to phpMyAdmin to look, the wakeupcallerid entry showed "Wake Up Calls" BUT on the actual Wake Up Calls page it does NOT show the quotes around Wake Up Calls (this is definitely version 1.10, though). But then I clicked Submit, and according to phpMyAdmin the quotes went away, BUT a test call still came up with unknown caller ID. :( So I tried adding the quotes around Wake Up Calls and clicked Submit, and they disappeared! But they were back again in the phpMyAdmin display, but (as expected) the Caller ID still showed unknown for both name and number. So finally, I tried manually removing the quotes using phpMyAdmin and even that didn't work - still unknown!

In desperation I went back to version 1.03 and now even that will not send the Caller ID, with or without the quotes. I tried uninstalling everything I could think of, even went and made sure the /var/www/html/admin/modules/hotelwakeup directory was deleted, then reinstalled (tried both previous and new versions) but now it won't work at all (well, it makes the calls but just won't send any Caller ID other than unknown). I'm totally stumped now.

Edit: Here's my CLI output when a wakeup call is being set to the extension at the previously-specified time:

Code:
    -- Attempting call on Local/234@from-internal for application AGI(wakeconfirm.php) (Retry 1)
    -- Executing [234@from-internal:1] GotoIf("Local/234@from-internal-9ec1,2", "0?ext-local|234|1") in new stack
    -- Executing [234@from-internal:2] Macro("Local/234@from-internal-9ec1,2", "user-callerid|") in new stack
    -- Executing [s@macro-user-callerid:1] Set("Local/234@from-internal-9ec1,2", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("Local/234@from-internal-9ec1,2", "1?report") in new stack
    -- Goto (macro-user-callerid,s,10)
    -- Executing [s@macro-user-callerid:10] GotoIf("Local/234@from-internal-9ec1,2", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:11] Set("Local/234@from-internal-9ec1,2", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:12] GotoIf("Local/234@from-internal-9ec1,2", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,19)
    -- Executing [s@macro-user-callerid:19] NoOp("Local/234@from-internal-9ec1,2", "Using CallerID "" <>") in new stack
But, wakeupcallerid is still set to Wake Up Calls <*68> according to phpMyAdmin.

Edit 2: Okay, this is interesting - I find that if I change the file /var/lib/asterisk/agi-bin/wakeupphp, line 491 from

Code:
                fputs( $wuc, "callerid: $parm_wakeupcallerid\n");
to

Code:
                fputs( $wuc, "callerid: Wake Up Calls <*67>\n");
THEN it works. So there is something wrong in the way it's getting the variable from the database - somehow that value isn't making it into $parm_wakeupcallerid ???

Edit 3: And that's not the only value not being written to the .call file - this is what the .call file actually looks like (after I hardcoded in the Caller ID):

channel: Local/234@from-internal
maxretries:
retrytime:
waittime:
callerid: Wake Up Calls <*67>
application: AGI
data: wakeconfirm.php

Turns out that maxretries, retrytime, and waittime values aren't being written out either!
 
So the conclusion on the new test version is...

All the values are being properly saved to the MySQL database.

However, if the name is quoted in the database the page still won't display the quotes.

The values in the database are apparently not being picked up in /var/lib/asterisk/agi-bin/wakeupphp and therefore not being written to the .call file (this also may have been an issue with earlier versions, although I'm not sure why it might have worked in the past after I removed the quotes from the name in the database. Today, at least, neither 1.03 nor 1.10 would display the caller ID, despite NUMEROUS uninstalls and reinstalls of both versions in an attempt to isolate the issue).

Also, the phone actually rings one more time than what is specified in maxretries (I hardcoded in 3 but it made four attempts). Or maybe that's right - after the first attempt it made three REtries.

And one last note: Something about this forum is causing Firefox to crash multiple times. It doesn't happen often on any other page but it's done it on this one at least a dozen times today, usually while I am attempting to copy or paste text to or from the textbox, but generally it just doesn't seem to like something about this forum page (for creating a new post or editing an existing one) in particular. Even just the act of using the mouse to highlight text has caused crashes.
 
Trunk -
Thanks for the detailed info. Give me some time to think about it - and perhaps others can share their results with the beta module.
 
hi in wakeup.php i see its 2.0
but the one i downloaded from Simple Hotel Style Wake-Up Calls – THE MODULE work fine internaly but when i try wakeup call outbox pin i was getting hangup so i donwloaded
one i found ver.2.0 copied wakeup.php and wakeupconfirm.php to ari-bin folder and it worked the only thing now is that im trying to get the call out but it doesnt call back i check the did from my house and it maches and trixbox is receiving the did so i dont know whats going on
my question is do u need the authentication in costome extencion configuracion?

Ok, show us your context that requires the pin, the way you have the custom destination and custom application configured in FreePBX.

I also strongly suggest that you pick one version or the other of the program to run - and stick with that until we get it working all the way. I might also suggest you start by removing all the various ones you have installed be fore trying again.
 
Oh, Shit! HERE is your problem!

Yeah, give it some more thought - WHY would it not be getting the data out of the database? WHY??? :mad5:

Oh, I dunno... maybe it's because you violated a cardinal rule of software design and hardcoded variables in your release software (I'm talking about 1.03, even)?

As in, these lines in wake.inc...

Code:
$dbConf['user'] = 'asteriskuser';
$dbConf['pass'] = 'amp109';
$dbConf['name'] = 'asterisk';
NO, you CANNOT do that... not unless you want this to ONLY work on systems where nobody's changed the password (which for one thing means you do NOT want it to work with Elastix). If that's really what you want to do, you could at least mention it on your Wiki page! And then don't call it a FreePBX module, call it a PiaF+Fonica module or something, because FreePBX systems can and do run just fine with other passwords, and virtually EVERY other module out there is designed with that in mind.

And it's not like it's terribly hard to get the correct data. You open /etc/amportal.conf and pull the data out of these lines:

Code:
# AMPDBUSER: the user to connect to the database named 'asterisk'
AMPDBUSER=asteriskuser

# AMPDBPASS: the password for AMPDBUSER
AMPDBPASS=itsNOTamp109
Sorry to give you crap about this but I invested WAY too much time trying to figure out what was going on, and I'm tired and frustrated, and then I see this... and now that I think about it, it seems to me that I mentioned to you a few weeks ago that you cannot do that. Maybe it was someone else, but for some reason I'm thinking it might have been you, perhaps in connection with a different module. Anyway, point is, even if you change this manually the first time, if it breaks every time you upgrade the module sooner or later people will forget about it, and you don't even mention it on the Wiki page.

Changing the password in wake.inc fixed the problem of not getting the data from the database, but if you'd just MENTIONED that I would not have wasted my entire evening and part of the wee hours of the morning on this! Please stop hardcoding the doggone password! :mad5:
 
To Much Caffine Getting You Down?

Less Coffee for you! Calm down. The installation documents clearly discuss the current limitations. Slow down, relax, open both eyes when reading installation information.

I have added the default password prerequisite to the wiki. Thanks so much for your polite reminder!

Speaking of the Wiki - perhaps you simply didn't notice that Elastix is not yet on the supported distribution list.

Just because you desire something to be true - doesn't make it so, my friend. As I stated before, the hard coded stuff is slated for upgrade. I DO hope we get that little piece done before you have some sort of brain hemorrhage over it. I'm not sure what you expect when you don't follow the installation instructions?

By the way - I'm not sure you ever got around to saying weather the quotation mark changes resolved your problem?
 
One of the beauties of this stuff is that it is open, and certainly for me, it has forced me to learn all sorts of new stuff, such as Linux, Shell scripting, Asterisk dial-plans to name but a few, which I have enjoyed aquiring the knowledge.

I know that neither Tony nor I, and probably the vast majority of the people who use this stuff are what might be termed PHP developers, although I know that Tony has been learning quickly.

Certainly on my map of techie stuff - the area for PHP has also got "here be dragons" written on it.

Sometimes we have to go with something that is less than elegant simply because it is the best way we know how.

If someone has a more elegant way of doing it, e.g extracting the username and password from amportal.conf then could they publish the code to prevent Tony spending the wee small hours googling to achieve this.

Joe
 
Less Coffee for you! Calm down. The installation documents clearly discuss the current limitations. Slow down, relax, open both eyes when reading installation information.

Excuse me, but exactly where in the installation instructions did it say that you were hardcoding the password? I must have missed that. Anyway, my message was not the result of any stimulant - it was lack of sleep, a headache coming on, and the frustration of my browser having crashed several times while using this forum (the latter is, of course, not your fault, but it just added to my general frustration level).

I have added the default password prerequisite to the wiki. Thanks so much for your polite reminder!
It's simple things like that which can save those of us who don't know what you've done hours of frustration.

Code:
Speaking of the Wiki - perhaps you simply didn't notice that Elastix is not yet on the supported distribution list.

Just because you desire something to be true - doesn't make it so, my friend.  As I stated before, the hard coded stuff is slated for upgrade.  I DO hope we get that little piece done before you have some sort of brain hemorrhage over it.  I'm not sure what you expect when you don't follow the installation instructions?
HOW did I not follow the installation instructions? By not assuming that because Elastix wasn't specifically mentioned that it wasn't going to work uder that distribution? I had THOUGHT you made a FreePBX module, and up to this point nothing that you'd said would have led me to think that you only intended that the module be used with PiaF or Fonica. Should I assume that with regard to all you other modules (that they are only for use with the distributions you specifically name in the documentation)?

By the way - I'm not sure you ever got around to saying weather the quotation mark changes resolved your problem?
Yes, the changes did resolve the problem once I fixed the password problem. And if you don't understand why I'm upset, please just consider that had you mentioned that an upgrade to the module might require going in and changing the hardcoded password, I could have concentrated my efforts on telling you how it worked in the first place, instead of spending hours trying to track down what I THOUGHT was some sort of obscure system issue. I was thinking my file permissions might be screwed up or that it was some issue with my system - it just never occurred to me (until about 6 A.M., when it finally dawned on me) that you'd hardcode a password and then not mention it.

The only remaining issue I see is that when Wake Up Calls is quoted in the database, it doesn’t display the quotes in the text box - thus you get no visual indication whether it's quoted in the database or not. But that's a minor thing (to me, anyway, although it might not be to someone else that's trying to use the module).

I guess you didn't see that I really was trying to help you out, and what popped my cork was spending hours trying to figure out if it was my system or your program, when a single sentence in the Wiki could have spared me all that effort. Certainly, when I said that it didn't appear to be getting the variables from the database, you'd think that might have inspired you to think "maybe the hardcoded password is wrong" and post something to that effect, but I guess you live in a world where nobody ever changes the default passwords?!? You might not care for my attitude at the moment but if you are honest you will admit that a hardcoded password is not an example of great programming.
 
I know that neither Tony nor I, and probably the vast majority of the people who use this stuff are what might be termed PHP developers, although I know that Tony has been learning quickly.

Certainly on my map of techie stuff - the area for PHP has also got "here be dragons" written on it.

I can sympathize with you guys on that - among the scripting languages PHP seems the most inscrutable to me. I have many times wished that FreePBX would offer more support for developing modules in other languages (ones that maybe the rest of us actually understand to sme degree). I'd like to see some support for modules written in Perl. I'd LOVE to see some support for modules in just about any flavor of BASIC.

Sometimes we have to go with something that is less than elegant simply because it is the best way we know how.

If someone has a more elegant way of doing it, e.g extracting the username and password from amportal.conf then could they publish the code to prevent Tony spending the wee small hours googling to achieve this.
I wish I could help on this, but I understand PHP far less than either of you guys (even if you are rank beginners, I still guarantee you understand it better than I). What I do know is that opening a plain text file and looping through it would have been simple even under something like the old Microsoft QBASIC. Irrelevant example follows:

Code:
PASS$="amp109"
USER$="asteriskuser"
F=0
OPEN "/etc/amportal.conf" FOR INPUT
WHILE NOT EOF(1)
LINE INPUT #1, A$
IF LEFT$(A$,10) = "AMPDBPASS=" THEN
  PASS$=MID$(A$,11)
  F=F+1
ELSEIF LEFT$(A$,10) = "AMPDBUSER=" THEN
  USER$=MID$(A$,11)
  F=F+1
ENDIF
IF F>1 THEN EXIT WHILE
WEND
That's a rough (not tested or debugged) approximation of how it would be done in BASIC. The first two lines just pre-populate the varaiables with the defaults in case the file cannot be read, although even that degree of hardcoding may not be a good idea - it really should stop and complain if amportal.conf can't be read for any reason. Anyway, if PHP makes it so complicated that you have to search for hours to find out how to do something as simple as get a couple of varaibles from a text file, it makes me wonder why the writers of new languages are making it so much more difficult for today's programmers. Something that we could have knocked out in five minutes using BASIC back in the 1980's now seems like an almost insurmountable challenge in PHP?

I so wish there were something like FreePBX written in some variant of BASIC - I'll bet you'd find HUNDREDS of modules available for that sucker, because just about anybody can code in BASIC. I thought computers were supposed to make things easier. We will ever get to the days when you just tell the computer what you want to do in natural English (or the user's native tongue), and it does it? Only on Star Trek and in the movies, I fear.
 
Just thought you might find this interesting...

If you take a look at FreePBX Ticket #3620 (new Bugs) you will notice that the author has posted a rewritten Callback module. Here is the description he posted:
Callback was not working. The outgoing call was never made. Running the script from the command line did not produce any errors.

I made some updates to the callback script so that it uses call files.

Additionally I incorporated some variables from /etc/amportal to control the callback behaviour, along the lines of the ruby script posted in the help documentation wiki.

I am attaching the file, but just in case here is the link: http://www.gufonero.com/asterisk/callback.html
Emphasis is added. Just thought that maybe if you need some hints on how to do that, you might want to look at his module submission.
 
Hotel Style Wakeup Calls: THE MODULE v1.2.0

NOTE: The download links in this article are obsolete. They have been left here for archival purposes. You should download the newest version from the lilnk in the first article of this thread.


The Hotel Style Wakeup Calls module has been updated.

This is a maintenance release. Upgrading is recommended, but not required. Please get the upgrade here.

This version of the module eliminates the requirement/expectation that the database id and password be the "default" values. These values are parsed from amportal.conf.

Please provide feedback as to your success or failure with this new version of the module.

-tshif
 
Works great!

Just downloaded and installed version 1.2.0, and made a couple test wakeup calls, and it is working great - thanks for the upgrade!
 
hi and thanks for all your help
this is my custom extencion
[custom-wakeup-calls-pin]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Authenticate(12345)
exten => s,4,AGI(wakeup.php)
exten => s,5,Hangup
jus like you sed
everyting internaly is working fine , i installed your lates file hotelwakeup-1.2.0.tgz but first i remove everyting first and reinstalled the module wroks great :)
im having problems with out side calls
i have 3 outbound routes all with a password route of 1313
my csutome destination is set up with
custom-wakeup-calls-pin,s,1

in wakeup call i have
i have set operator mode to Disable
extencion legth = 10
operator extention same as you sample 00,01 since im allowing anyone to dial for wake up call
and that is it
how do i get the wakeup call to dial out thru and outbound orute that has a route password thanks very much
another thing after installing i calling wakeup it hang up
so i when to /var/lib/asterisk/agi-bin
and saw that wake.php did not had a dot ex. wakephp so i rename it to wake.php and every thing was good hope this help some one
 
this is what happends when it dial de wake up call outside


Verbosity is at least 3
-- Attempting call on Local/8095813008@from-internal for application AGI(wakeconfirm.php) (Retry 1)
-- Executing [8095813008@from-internal:1] Macro("Local/8095813008@from-internal-6ceb,2", "user-callerid|SKIPTTL|") in new stack
-- Executing [s@macro-user-callerid:1] Set("Local/8095813008@from-internal-6ceb,2", "AMPUSER=*68") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("Local/8095813008@from-internal-6ceb,2", "1?report") in new stack
-- Goto (macro-user-callerid,s,11)
-- Executing [s@macro-user-callerid:11] GotoIf("Local/8095813008@from-internal-6ceb,2", "1?continue") in new stack
-- Goto (macro-user-callerid,s,20)
-- Executing [s@macro-user-callerid:20] NoOp("Local/8095813008@from-internal-6ceb,2", "Using CallerID "Wake Up Calls" <*68>") in new stack
-- Executing [8095813008@from-internal:2] Set("Local/8095813008@from-internal-6ceb,2", "_NODEST=") in new stack
-- Executing [8095813008@from-internal:3] Macro("Local/8095813008@from-internal-6ceb,2", "record-enable|*68|OUT|") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("Local/8095813008@from-internal-6ceb,2", "1?check") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("Local/8095813008@from-internal-6ceb,2", "recordingcheck|20090414-213201|1239759121.12") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20090414-213201|1239759121.12: No AMPUSER db entry for *68. Not recording
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] MacroExit("Local/8095813008@from-internal-6ceb,2", "") in new stack
-- Executing [8095813008@from-internal:4] Macro("Local/8095813008@from-internal-6ceb,2", "dialout-trunk|1|8095813008|1414|") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("Local/8095813008@from-internal-6ceb,2", "DIAL_TRUNK=1") in new stack
-- Executing [s@macro-dialout-trunk:2] GosubIf("Local/8095813008@from-internal-6ceb,2", "1?sub-pincheck|s|1") in new stack
-- Executing [s@sub-pincheck:1] Authenticate("Local/8095813008@from-internal-6ceb,2", "1414|") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/wakeconfirm.php
-- <Local/8095813008@from-internal-6ceb,2> Playing 'agent-pass' (language 'en')
-- Playing 'this-is-yr-wakeup-call' (escape_digits=1234) (sample_offset 0)
-- Playing 'to-cancel-wakeup' (escape_digits=1234) (sample_offset 0)
-- Playing 'press-1' (escape_digits=1234) (sample_offset 0)
-- Playing 'to-snooze-for' (escape_digits=1234) (sample_offset 0)
-- Playing 'digits/5' (escape_digits=1234) (sample_offset 0)
-- Playing 'minutes' (escape_digits=1234) (sample_offset 0)
-- Playing 'press-2' (escape_digits=1234) (sample_offset 0)
-- Playing 'to-snooze-for' (escape_digits=1234) (sample_offset 0)
-- Playing 'digits/10' (escape_digits=1234) (sample_offset 0)
-- Playing 'minutes' (escape_digits=1234) (sample_offset 0)
-- Playing 'press-3' (escape_digits=1234) (sample_offset 0)
-- <Local/8095813008@from-internal-6ceb,2> Playing 'auth-incorrect' (language 'en')
-- Playing 'to-snooze-for' (escape_digits=1234) (sample_offset 0)
-- Playing 'digits/15' (escape_digits=1234) (sample_offset 0)
-- Playing 'minutes' (escape_digits=1234) (sample_offset 0)
-- Playing 'press-4' (escape_digits=1234) (sample_offset 0)
-- <Local/8095813008@from-internal-6ceb,2> Playing 'auth-incorrect' (language 'en')
-- Playing 'im-sorry' (escape_digits=) (sample_offset 0)
-- Playing 'you-dialed-wrong-number' (escape_digits=) (sample_offset 0)
-- Playing 'i-dont-understand3' (escape_digits=) (sample_offset 0)
-- Playing 'your' (escape_digits=) (sample_offset 0)
-- Playing 'communications' (escape_digits=) (sample_offset 0)
-- Playing 'this-is-yr-wakeup-call' (escape_digits=1234) (sample_offset 0)
-- Playing 'to-cancel-wakeup' (escape_digits=1234) (sample_offset 0)
-- <Local/8095813008@from-internal-6ceb,2> Playing 'vm-goodbye' (language 'en')
== Spawn extension (sub-pincheck, s, 1) exited non-zero on 'Local/8095813008@from-internal-6ceb,2' in macro 'dialout-trunk'
== Spawn extension (sub-pincheck, s, 1) exited non-zero on 'Local/8095813008@from-internal-6ceb,2'
 
cajunsniper
user_offline.gif
-
Sorry cajun - I dont know any way to make it dial out a trunk with a password. Does anyone else have any thoughts on cajun's issue?
 
anyone has any way around this without a password it work nice another thing is that when i pickup the wake up all on a external number i get half of the menu sound it would start like in option 3 or 4 if i let it ring a couple of time before awnsering please check ,thas only when calling from outside
 
Worked Agreat

Just a thought that actually seems trivial after going through the posts. maybe letting someone, a hotel guest, know that 24 hr format is needed for time? Just a thought...
Thanks again.
 
Is it just my system or everyone else also, when installing PHP and installing the wakeup call service module, my system slows down when resetting itself.

Is this the reason why wakeup was taken out of the loop in the development.
 

Members online

No members online now.

Forum statistics

Threads
26,695
Messages
174,440
Members
20,264
Latest member
TRENT310
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.
Back
Top