While most of the stuff I built, has no particular use, once in a while I built something that solves a real issue. In this case, it solves the lack of a phone operator at Xonay Media Headquarters.
Most of the work we do at Xonay Media is done at the office, but every now and then, I decide to work from home. The problem is, that when my colleagues decide the same, no one will answer the phone at the office. Forwarding the calls to my mobile number is an easy solution, but this means I have to redirect the phone when I’m still at the office. Or even worse: I have to drive to the office, just to forward the calls.
If only there was a way to remotely forward all calls …
Forwarding calls is done by simply dialing a special number: *21*0123456789# (Where 0123456789 is replaced by the number I want to forward the calls to …), So If this can be done remotely, the problem is solved.
As most of the old school internet guys know, an old analog modem is able to dial phone numbers, by sending the ATDT
command, so this gave me the idea to connect an old external analog modem to a Raspberry Pi. Unfortunately, I was unable to find an analog modem which was supported by the Raspberry. It appears these devices went extinct, soon after broadband internet arrived.
And then I remembered: the Gigaset SL400 phones we use at the office, have an USB port for easy configuration. After connecting it to the Raspberry, I found out it creates a virtual serial port: /dev/ttyACM0
. I crossed my fingers, did some wishful thinking, an then sent the ATDT *21*0123456789#
command to this port …
IT WORKED! The awesome people of Siemens implemented a full range of AT commands into these phones! Allowing me to dail a number with some remote commands!
Of course, I wanted to make this as user friendly as possible, and thus I quickly threw together a Node.js REST API, allowing me to forward my calls with a simple GET request, and built a small Swift app to make it easy accessible using our iPhones. After some tweaking, we ended up with a simple, but effective app … The Xonay Media Redirector!
To make sure my colleagues know when the calls are being forwarded, we added push notifications. So after enabling or disabling the call forwarding, a simple push message is sent:
And with this in place, an other first world problem is solved. Instant call forwarding from anywhere in the world!
The source code
If you’re interested in the source code, check out the following two repositories on GitHub:
- XMPhone-Redirector: The Node.js server that runs on the Raspberry and controls the Siemens Gigaset SL400.
- XMRedirector: The Swift iPhone app that makes it easy to control the Node.js backend.
Note that most of the code is ugly as hell, lacks documentation and is in no way intended to be reused. If you do, I can’t promise you won’t set your Gigaset on fire …