Several years ago, I wrote a python
script
to notify me when my asterisk server got an incoming call. I programmed
this out of pure laziness: I wanted to know who was calling me without
having to look at my phone.

This script would show a pop-up on my laptop whenever I got a call and
the notification would show who was calling and for whom. This was very
useful since I was traveling a lot during that time, so I would know if
somebody was trying to reach me at home.

I'm still using this script, but I'm finding myself using my cellphone
more often than my laptop when I'm out of the house. So, I modified my
script to send a notification to my smart phone instead of my laptop.

Even though it would have been very good learning experience, I didn't
want to program a fully fledged app for this. First of all, I would have
needed to setup a new development environment, learn a whole new API
stack, deal with deployment, etc. Fortunately, I heard of Pushbullet.
This app can receive notifications - and do much more - from an web API
so it seemed like the perfect way to resolve my problem.

Simply, I only needed to send an web request using curl to the
pushbullet API using the provided API key (found on Pushbullet's setting
page):

This simple request would pop-up a notification on my smartphone - see
the screenshot above. The only thing remaining to do was to cleanup my
old script, remove everything related to the GUI and add the curl
command. After testing the following script, I added it on my asterisk
server and made sure it was launched on startup using upstart.

Here's the script. You can use it and adapt it has you wish, but a short
credit would be nice.