louhevly has asked for the wisdom of the Perl Monks concerning the following question:

Greetings oh wise ones,

My mother is in her 90s and lives alone in her own apartment in a retirement home in the States. I live in Europe and would like to write a Perl script that calls her landline phone every morning at 9am (this could be on a cronjob). If she answers, the program should report success and exit; if no answer, then call 10 minutes later. If after 30 minutes there is no answer, then call a different number requesting that someone check her room.

My Skype account allows me to call Skype-to-landline for pennies, which is what I'm doing now manually. I searched for Skype on CPAN and found quite a number of modules described, but I thought it might save time asking here if someone knew just which module might be appropriate for what I'm trying to do.

Thanks in advance, Lou

Replies are listed 'Best First'.
Re: using Skype
by NetWallah (Canon) on Apr 29, 2017 at 19:26 UTC
    To me, this sounds like a job for an IOT type motion sensor, and back-end logic to alert you under selected conditions.

    That would be less obtrusive than a webcam, and less annoying than robo calls.

    Of course, it requires access to (very) low bandwidth Internet access.

            ...Disinformation is not as good as datinformation.               Don't document the program; program the document.

      This would be trivial to do with the Raspberry Pi and Perl. Most motion sensors are single-wire (well, V+, V- and feed), so just a single GPIO pin. Here's a quick example with a mix of real and pseudo:

      use warnings; use strict; use RPi::WiringPi; my $pi = RPi::WiringPi->new; my $pin = $pi->pin(27); # GPIO pin 27 my $count; while (1){ # check if time >= 0900 here # ...if not, sleep and next my $motion = 0; for (0..10){ if ($pin->read == 1){ $motion = 1; last; } sleep 5; } $count++ if ! $motion; if ($count >= 3){ # 0915 hrs and no movement # send email, sound an alarm etc ... } sleep 300; }

      If i were going in this direction id give her an actual button, im thinking of something like a big staples-easy button. Maybe with an led to remind her it is check in time. A positive action rather than a lack of action.

Re: using Skype
by Anonymous Monk on Apr 29, 2017 at 17:54 UTC
    Maybe you should just CALL YOUR MOTHER yourself.

      Calling your mother every day at 9 o'clock and being called by your son every day at 9 o'clock will become very tiresome and annoying on the long run. For the caller it is a duty, which may be impossible to accomplish given personal conditions and schedule; for the callee, it can lead to a debt of gratitude knowing that every single time there's somebody over there doing the check. IMHO calls to one's mother should not be those of type alarm call, i.e. call personally if you've got something to say.

      There's enough concern visible by the OP in wanting to implement such a dead-man-button, and I'd guess that it is based on mutual consent, otherwise it just doesn't make sense: then it would be better to just delegate the job to the other number - which might have been discussed also, but have turned out as not feasible.

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
        @shmem:

        The point of the dead-man-button is to allow her to live independently while assuring that she won't lie unconscious for more than 12 hours after a stroke or an incapacitating fall. She's more than willing to pick up the phone every day at 9am and 9pm if it means not having to go into assisted living.

      I was thinking the same thing. Even a one minute call if it's at the same time every morning to simply say "Good Morning".

        @Anonymous and stevieb:

        Because of my job, I can't always be at my computer at 6pm Barcelona time. But for her convenience, it's better that the call be every day at precisely 9am (Seattle time) so she can plan her morning around it.

Re: using Skype
by MidLifeXis (Monsignor) on May 05, 2017 at 17:40 UTC

    Perhaps (along the lines of the "easy button" from above) something that sends an IM or other messaging service notification. Doesn't necessarily need to be telephone to get the signal transmitted.

    --MidLifeXis