Another Raspi Application: Check and Report Call-by-Call Tariffs

In Germany we have this great system in place since the liberalization of the telecoms industry in the 1990's called "Call-by-Call" that lets fixed line customers select a carrier to use for national and international calls by dialing an additional access code before the telephone number. In practice it has significantly spurred competition and has brought prices down. But there's also the danger that some black sheep change prices quickly, first getting customers with low prices and then increasing their price ten fold over night without informing them. But there are two cures now:

The first cure is that call-by-call carriers now have to play an announcement before each call to inform customers of the true cost. Problem fixed one might thing. Well not quite because my use of call-by-call is a bit different. I mostly use it for calling abroad from my mobile. Direct calls to international numbers are prohibitively expensive, somewhere between a Euro or two a minute. The same calls from my fixed line at home are in the order of 2 to 3 cents a minute. So the solution for me I have used over many years is to call one of my fixed line numbers at home which is permanently forwarded to one of the few international destinations I call frequently. Praise to home ISDN that gives one several phone numbers (5 in my case). The catch when combining unconditional call forwarding and call-by-call is that no announcement is made because it's not the caller that pays but the forwarder. So my problem was how do I get informed of price hikes?

In the past I manually had to look up prices and was sometimes surprised by the price hikes. Well, no more because now one of my Raspi's does the job for me. With the background I have gained when programming my water alarm system with email notification and the automatic download and backup of all pictures of this blog recently I could quickly put together a script and a Phyton program invoked by cron once a day to download the web page with the prices of my current call-by-call provider, parse it for the prices to the destination countries I'm interested in, extract the price, compare it against maximum values defined and send me an email with the prices and a general verdict in the subject line if everything is still o.k. And with the code for sending an email already there from my previous project and the knowledge I have gained previously of how to parse through strings in Python it took less than two hours to get it working.

Another cloud service at home, excellent! So why am I writing about this? Well, first of course because I'm proud to have done it and done it that quickly. But I also write about it because it shows what can be triggered once you have computing resources available at home running 24/7 that you can play around with and use your imagination and creativity.

And if you want to have a look at the code here we go: Download Call-By-Call-Pi-Code