How to get reminder phone calls on your phone from skype?

A reminder utility bash script to make automatic repetitive calls to a mobile number at an interval.

6th Nov, 2014

The Driving Force View on Github

‘I am so sorry. I slept at 2 am and couldn’t wake up on time.’

Today, most of us can relate ourselves to this, especially college going students and teenagers. I have this problem of sleeping very late (see I am awake and writing this post in the middle of the night and I am 200% sure that I’ll be late for my work tomorrow) I forget things, reach late for work/college and sometimes my friends have to wait till they get totally pissed off. And then I need to switch to a loop of apology to make the situation better.

The problem is alarms cannot wake me up, but getting a phone call on my mobile does. I don’t know why, but it works for me.

The Elucidation

A reminder utility bash script to make automatic repetitive calls to a mobile number at an interval.

Requirements

  • Linux: because penguin.
  • Skype Credit: as we need to make phone calls to your mobile (I had some credit from one of my previous hack).

How do we do it?


  1. Recieve command line parameters in shell script.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    echo Skype Reminder.
    mobile=
    hrs=
    min=
    sec=
    delay=
    N=
    while getopts p:h:m:s:d:n: opt; do
    case $opt in
    p)
    mobile=$OPTARG
    ;;
    h)
    hrs=$OPTARG
    ;;
    m)
    min=$OPTARG
    ;;
    s)
    sec=$OPTARG
    ;;
    d)
    delay=$OPTARG
    ;;
    n)
    N=$OPTARG
    ;;
    esac
    done
    shift $((OPTIND - 1))


  2. Calculate the time and number of times the call should be made.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    let 'hrs = hrs + 0'
    let 'min = min + 0'
    let 'sec = sec + 0'
    let 'delay = delay + 0'
    let 'N = N + 0'
    let 'tot = min + (hrs * 60)'
    let 'tot = sec + (tot * 60)'
    printf '\n'
    echo "Mobile: "$mobile
    echo "Hrs: "$hrs
    echo "Min: "$min
    echo "Sec: "$sec
    echo "Total Sec: "$tot
    if [ $N -eq '0' ]
    then
    let 'N = 1'
    fi
    printf '\n'
    echo "Delay: "$delay
    echo "Number of times: "$N


  3. Create a loop to make phone calls consecutively using skype command.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    printf '\n'
    sleep "$tot"
    for (( c=1; c<=N; c++ ))
    do
    echo "Call "$c
    skype --callto "$mobile"
    if [ $N -eq $c ]
    then
    break;
    fi
    sleep "$delay"
    done
    printf '\n'
    echo "Thank You for using our service."
    printf '\n'
    echo
    "***************************************************************"


  4. Save it as AngryAlbatross.sh in a directory, say ‘Documents’.
  5. Open terminal in the directory where this file is located and change permissions of the file.
    1
    2
    $ cd director_name
    $ chmod +x AngryAlbatross.sh


  6. Run the script with command line parameters. Eg. To make a call 5 times with delay of 30 seconds between consecutive calls, on a mobile number (+91XXXXXXXXXX), after 4 hrs 3 minutes and 10 seconds, use the following command.
    1
    2
    $ ./AngryAlbatross.sh -p +phone -h hours -m minutes -s seconds -d delay_between_calls -n number_of_times
    $ ./AngryAlbatross.sh -p +91XXXXXXXXXX -h 4 -m 3 -s 10 -d 30 -n 5


Now wait for the call.