In regards to not getting a call back on hangup.
To resolve the issue with the wakeup calls ending on hangup is pretty easy. Asterisk kills the call file
upon answer. So when it answers just make the AGI generate another .call file. Set the time limit to
something like 10 minutes and you could even make it run the snooze script with a parm that tells the
script that the last call was disconnected. This way you can make it say something like "hahahah, it's not
that easy to get out of waking up, lol! If they reschedule a call back due to snooze then make the script
kill the created file. The filename can be easily stored in a variable once created. Make the script create
the correct call back and kill that file. The only problem with this is it may try to call you back if you take
longer than 10 minutes dealing with the script which on some SIP/IAX lines will cause call waiting, etc.
I would make sure the script has a timeout for those who may fall back asleep answering the annoy script
so a clean hangup is done and set the channel variable to "FAILED" in this instance as well. Most VoIP
devices are smart enough to release the line and go back into a idle status, hints the next call should ring
the phone again. The only problem would be for ATA VoIP to Analog devices because those devices
don't know how to release the line. Cell phones wouldn't be a problem however.
The second solution is to make a hangup extension to the alarm. Then when the call is hung up make
it check a asterisk channel variable that would be set by the snooze script to see if it completed successfully.
Upon call in make the script set the variable to "FAILED" by default and change it to "SUCCESS" if
everything the script demanded for is completed. On the hangup extension make it run the script again
with a parm of "hangup". The only task for the script will be to check the channel variable which will be
"FAILED", "SUCCESS" or "". If it's failed then set a call back of 1 minute if you really want to be a prick
about it. If it's set to SUCCESS then just exit the script normally and do nothing. You know at this point
the initial script execution completed the job for you. The same would be true if it's set to "" because that
would mean the script didn't execute at all or there was a internal issue such as the PHP or PERL interpreter
was missing or invalid or the code crashed before setting up that channel variable.
I would say make the hangup script call the person right back but I really don't think extension "hh" exists
for hanging up on the hang up extension. So that would result in no more calls back which may not be a
bad thing because at that point I'm sure they're annoyed which was the point! lol.
I hope this helps.
P.S. Why doesn't this website know how to line wrap. I had to manually break my paragraph down! Silly