Skip to content

Instantly share code, notes, and snippets.

@probonopd
Last active March 25, 2024 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save probonopd/087af6cfe711d2fb83416e3299675af8 to your computer and use it in GitHub Desktop.
Save probonopd/087af6cfe711d2fb83416e3299675af8 to your computer and use it in GitHub Desktop.

The sorry state of desk phones, 2018

Seemingly I cannot find ONE good desk phone as of 2018 that is not either technically outdated, or cheap-feeling, or unusable, or all of that...

Must have

  • Desk phone
  • SIP
  • G.722
  • "Unlimited" size of address book
  • Ethernet
  • WLAN
  • Low power consumption, not more than 1W standby
  • No color screen but great readable large bw OLED screen
  • Great "European" design
  • Many hardware short dial keys
  • Ideally no "menu" operation for essentials
  • Configurable via web browser
  • Senior-friendly but not a "Senior phone"
  • Supported for 10+ years (the last ISDN phone lasted for 20 years)
  • No DECT (WLAN radiation is already enough and I want to be able to use wherever there is any LAN or WLAN)
  • Price up to 200 EUR
  • Power supply included (not: PoE. No one has that at home)
  • Real handset, must rest safely on the phone
  • Great conference phone abilities (microphone array, think Amazon echo)
  • Not battery-powered

Should have

  • Made in Germany (Not v-tech etc.)
  • Open source firmware (e.g., OpenWRT)
  • Great brand (not Yealink, Grandstream,... but: Siemens, BOSCH, Gigaset, Telekom,...)
  • If color screen, then HD, touch, latest Android
  • If Android/touchscreen, then hardware buttons in addition ("real phone feeling")
  • Be able to show the stream of a door webcam
  • Clever integration with services like telefonbuch.de
  • Be available for purchase in nearby stores (MediaMarkt, Saturn, Telekom Shop, etc.)

Close candidates

  • Ubiquity UVP and UVP pro UniFi(R) VoIP 150 EUR 5 inch Android desk phone. Good but a) Android is outdated b) needs POE or cluncy 48V power supply rather than a normal 5V USB charger. Only the Pro model has WLAN and camera, and then costs 250 EUR. A cheap Android mobile phone costs a third of that! Is the app in German at all? I downloaded one from https://help.ubnt.com/hc/en-us/articles/216650337-UniFi-VoIP-How-to-Manually-Upgrade-UVP-App-Platform and it didn't seem so. I installs an Android Service which seems to be using PJSIP. When the service is installed, the Android phone shows the Ubuquity SIP phone UI.
  • Acer abTouchPhone. Acer, wasn't that Benq, the company that bought Siemens mobile and destroyed it? Besides, the phone seems to be pure vaporware and not available for purchase
  • Gigaset PRO Maxwell 10 if it was not utterly outdated, did not have bad customer ratings, was not 2-3x as expensive as need be, and had real keys
  • Amazon echo show if it had a real handset, and had real keys, and all Amazon software and services could be removed
  • snom D315, D715 if it wasn't bought by v-tech, wasn't made in China, and there weren't way too many models, and you could be sure you are not buying outdated technology
  • Android tablets if there was an accessory that would provide a microphone array, a real handset, and real keys
  • http://jablocom.com/raven/ but 3x too expensive (compared to a tablet); screen is "always-on 8″ = not energy efficient; Android is way outdated (4.2.2), I don't want umts/gsm
  • https://www.amazon.de/Altigen-iFusion-SmartStation-iPhone-Schwarz/dp/B005LFUE46 but unavailable for purchase, no Ethernet
  • UNIFY OpenStage 40 SIP but it seems to be 10+ years old now, it was already made when the company was still SIEMENS. And they have this weird policy in which you get software updates from dealers(!) rather than the manufacturer. Their "HFA" versions "just" need SIP firmware but they seem to not give it to end users. Seems to be based on 2002-ish INCA-IP chip aka. Danube according to http://wiki.unify.com/wiki/OpenStage_40. snom 300 and 370 seem to use INCA-IP too. Infineon seemingly sold this business to Lantiq which was sold to Intel. INCA-IP chips are also used in IP phones like e.g. optiPoint 410/420 S. Does not work on a TP-LINK T240100-2-POE (24V, 1A) "passive" PoE injector, according to the manual it must be an (expensive) IEEE 802.3af "active" PoE injector. "Power in" plug even needs (crazy?) 38V, 420mA. Why not just run off 5V? Runnnig PoE from a hub would mean that I need to use the precious few pins of the cables in the house
  • Fanvil C400. Android 4.2, wtf?! Recent apps won't run there anmore

Self-made to the rescue

Here is my solution: https://github.com/probonopd/OpenPhone - Open source desk telephone implemented in Python and pjsua, running on a Orange Pi Zero single board computer

Any suggestions are welcome in the comments!

Tests

Since there are almost no phones on the market targeting consumers, I have been trying various phones originally targeting business customers. Since business phones are at least 2-3 times as expensive as consumer grade phones, I have been doing my experiments with "outdated" phones that can be had rather cheaply from eBay.

Unify OpenStage 40

Despite "open" in the name, and despite using plenty of open source software (including Linux and pjsip) in the phone, the firmware apparently is not open source (yet?). The phone is no longer actively produced, so why don't they release the complete source code and build instructions?

  • Built-in (on device) phone book randomly limited (=crippled) to just 99 entries, then "Maximale Anzahl der Kontakte überschritten" appears. Why the heck??? This alone is a frigging showstopper for this phone. This limitation is completely random and not technically necessary
  • Phone boots way slower than my PC
  • https://wiki.unify.com/wiki/OpenStage_40#Open_Source_Software_V3R1
  • I measured 3.7 Watts in standby on a Cisco CP-PWR-CUBE-3 Power Supply. Personally I think this is still rather much (e.g., compared to an Android phone on a USB charger)
  • Can fully configure the phone from the phone itself, and from the phone's HTTPS web interface (which is dog slow)
  • The manual is almost useless because regarding all of the more advanced functions it just refers to the "Fachpersonal" (which basically means "ask your local system administrator"). As a private user I do not have a system administrator, nor do I think a usable modern IP phone should need one
  • No built-in answerphone. Why can't they put a few GB flash storage into the phone and have it record its messages locally. My SIP provider does have a mailbox, but it forwards the messages by e-mail and apparently there is no way to make this setup work with the OpenStage
  • The setup is divided into a user and an administrator area. While the user area can be set to different languages including German, the setup area is hardwired to English?!

There is no batch upload for a local phonebook, but one can make subsequent HTTP requests using the Cookie seen by a browser like this:

#!/bin/bash

input="Documents/phonenumbers2019.csv"

# Format:
# ;08003302000;Telekom;Deutsche;;

while IFS= read -r line
do
  PHONE=$(echo "$line" | cut -d ';' -f 2 | sed -e 's| |+|g')
  LAST=$(echo "$line" | cut -d ';' -f 3| sed -e 's| |+|g')
  FIRST=$(echo "$line" | cut -d ';' -f 4| sed -e 's| |+|g')
  echo curl -k "https://192.168.178.111/page.cmd -H \"Cookie: $COOKIE\" -H \"Cookie-Installing-Permission: required\" --data \"page_submit=WEBM_User_Phonebook_NewContact&lang=de&lastName=$LAST&firstName=$FIRST&phoneNumber=$PHONE\""

done < "$input"

This worked neatly for me. I had copied the phone numbers into a CSV from Fritz!Box before. The advantage is that the numbers are stored locally in the phone, so the phone will have the numbers even if relocated to another local network, and no server is needed (one point of failure less).

Exercise for later, should it be wanted: Write a tiny LDAP server that uses the Fritz!Box address book.

Linux on Unify OpenStage

The OpenStage phones are running Linux:

BusyBox v1.15.3 (2014-06-05 23:05:20 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

Sourcing Opera Environment...
FipsMode from Phone.db = 
OPENSSL_FIPS = 0
$ uname -a
Linux OIP001ae8659145 3.4.84-WP_LO #1 Thu Jun 5 23:04:00 CEST 2014 mips GNU/Linux

$ lsmod 
sidecar 20816 2 - Live 0xc00e0000
st7529fb 3696 0 - Live 0xc00ce000
Backlight 3184 0 - Live 0xc00c5000
QSlider 23456 0 - Live 0xc00b8000
QLed 2528 1 QSlider, Live 0xc00aa000
QWheelTestIfc 3440 2 QSlider, Live 0xc00a2000
QWheel 3776 2 QSlider,QWheelTestIfc, Live 0xc009a000
Quantum_mux 3136 2 QSlider,QLed, Live 0xc0092000
Headset 7232 1 - Live 0xc0089000
mps_event 6864 1 Headset, Live 0xc007e000
LANstatus 5616 2 - Live 0xc0074000
hookSwitch 5504 0 - Live 0xc006a000
wkeypad 5040 2 - Live 0xc0060000
keyinput 7840 3 QSlider,Headset,LANstatus, Live 0xc0056000

$ mount
rootfs on / type rootfs (rw)
/dev/root on / type jffs2 (rw,relatime)
/proc on /proc type proc (rw,relatime)
/sys on /sys type sysfs (rw,relatime)
/dev/shm on /tmp type tmpfs (rw,relatime)
/dev/mtdblock5 on /data type jffs2 (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)

$ df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                21.0M     17.5M      3.5M  83% /
/dev/shm                 29.0M    300.0K     28.7M   1% /tmp
/dev/mtdblock5            4.5M    244.0K      4.3M   5% /data

$ cat /proc/cpuinfo 
system type		: INCAIP2
processor		: 0
cpu model		: MIPS 24Kc V4.0
BogoMIPS		: 173.46
wait instruction	: yes
microsecond timers	: yes
tlb_entries		: 16
extra interrupt vector	: yes
hardware watchpoint	: yes, count: 4, address/irw mask: [0x0000, 0x0400, 0x0698, 0x0880]
ASEs implemented	: mips16 dsp
shadow register sets	: 1
kscratch registers	: 0
core			: 0
VCED exceptions		: not available
VCEI exceptions		: not available

Building own Linux for the device?

The INCA-IP2 SOC is from Infineon (ex-SIEMENS, now Lantiq/Intel). What a shame that this company that had a long-standing tradition in telecommunications once had all the technology from their own chips to entire phones, and now is scattered all over the place in disjunct pieces.

Can we build our own kernel and own runtime, thus removing arbitrary restrictions such as the crippled local phonebook?

Can we get OpenWrt to run on it? https://openwrt.org/docs/techref/hardware/soc/soc.lantiq

For a phone that has "open" in its name, we find suprisingly few peole talking about running your own entirely custom software stack on this hardware.

The source code is provided: https://wiki.unify.com/ftp/OpenStage-OSSW/

Qt

/etc/init.d/OperaEnv.sh sets QWS_MOUSE_PROTO. So it seems like the OpenStage uses Qt.

phone.db

/data/database/phone.db is a SQLite database that stores the phone configuration. One can interact with it like this:

$ export LD_LIBRARY_PATH=/Opera_Deploy

$ /Opera_Deploy/sqlite3 /data/database/phone.db ".tables" 
CALL_LOG                      FORWARDING_KEY_DESTINATIONS 
CANONICAL_LOOK_UP             GENERAL_CONFIG              
CODEC_SETTINGS                LINE_KEY_SETTINGS           
CONFIG_LOCKDOWN               LOCAL_FUNCTION_LOCKDOWN     
DEFLECT_KEY_DESTINATIONS      PHONE_BOOK                  
DISTINCTIVE_RINGING           REPERTORY_DIALLING          
DSS_KEY_SETTINGS              SELECTED_DIALLING           
FEATURE_KEYS                  SRTP_ENCRYPTION_SETTINGS    
FEATURE_KEY_SETTINGS          START_APPLICATION           
FEATURE_TOGGLE_KEY_SETTINGS   START_APPLICATION_FIXED_KEYS
FILEDOWNLOAD_SETTINGS_ENC     STIMULUS_KEY_SETTINGS       
FIXED_KEYS   

$ /Opera_Deploy/sqlite3 /data/database/phone.db "SELECT * FROM GENERAL_CONFIG"
...

$ /Opera_Deploy/sqlite3 /data/database/phone.db "SELECT * FROM PHONE_BOOK"
...

I wonder what would happen if we put more than 100 entries into PHONE_BOOK using SQLite.

Cisco

  • Phones boot way slower than my PC amd way slower than a 15 USD OrangePi Zero with OpenWrt
  • No way to configure the phone from the phone itself! Normally configured by enterprise-grade serverside Cisco configuration software
  • Has a web interface, but it is read-only and cannot be used to configure the phone
  • Need to use TFTP with XML for configuration and firmware updates, and HTTP with XML for phonebook
  • I have been coding something in Go to make configuration easier
  • Once the config is loaded via TFTP, the TFTP server is not needed anymore
  • Cannot get the time from a NTP time server to show correctly

7960

  • Proprietary Unix, not Linux based

9951

  • Linux based? Can use USB headsets, and can use a Cisco USB camera
  • I measured 6 W standby power consumption on the original power supply, with the display off. Personally I think this is WAY too much

Polycom

SoundStation IP 6000

  • "Spider" conference phone
  • Local adress book (XML)
  • Supposedly can use OpenLDAP address books
  • Gets very warm on the underside. Processor is from 2002

https://gist.github.com/probonopd/f60dcaa8db06334cf0647d19ed5a0d70

Reverse lookups of the caller

It looks like that the canonical way of doing this is to use a SIP proxy that can add the P-Asserted-Identity header from RFC 3325.

P-Asserted-Identity: “Andrew” <sip:Andrew@littlecompany.com>
P-Asserted-Identity: tel:+19524563516

So one "only" needs to write something to loop up the phone number in all available public directories (e.g., https://www.dasoertliche.de/?form_name=search_inv&ph=08003302000 but ideally via API and globally), "inject" this header into the SIP messages, and possibly cache the lookup infomration for this number for subsequent requests.

@l1m3r
Copy link

l1m3r commented Nov 26, 2019

Hi @probonopd,
I just bought two OpenStage 40 SIP phones and they DO work with passive POE with at least 36V DC+ on pair one (pins 4+5) and GND on pair ? (pins 7+8).
I just murdered an Ethernet cable for that purpose and connected a 48V Cisco PSU to the aforementioned pins and it works flawlessly.

And maybe a raspberry PI + Display (like this one) with a few keyboard keys and an USB sound card is another alternative (with less effort then the oPI considering all the Asterisx/PBX stuff already beeing done with the rPI).

@probonopd
Copy link
Author

Thank you @l1m3r this is very good to know. I do have a few 48V Cisco PSUs but I am not sure how to exactly connect them to the OpenStage 40 SIP, can you elaborate please?

@probonopd
Copy link
Author

And maybe a raspberry PI + Display (like this one) with a few keyboard keys and an USB sound card is another alternative (with less effort then the oPI considering all the Asterisx/PBX stuff already beeing done with the rPI).

This is what I have come up with so far:
https://github.com/probonopd/OpenPhone

@l1m3r
Copy link

l1m3r commented Dec 3, 2019

Thank you @l1m3r this is very good to know. I do have a few 48V Cisco PSUs but I am not sure how to exactly connect them to the OpenStage 40 SIP, can you elaborate please?

I basically just build a passive PoE injector by skinning a normal ethernet patch-cable of a few cm outer hull, cutting the blue and brown wire pairs (4+5 & 7+8) and connecting the PSU to the set of those wires which go to the phone.

to PHONE
 1  2  3  4  5  6  7  8
 |  |  |  |  |  |  |  |
 |  |  |  ++++  |  ----
 |  |  |     |  |     |___-  to
 |  |  |     |__|_________+  PSU
 |  |  |        |
 |  |  |        |
 1  2  3        6
to SWITCH

@probonopd
Copy link
Author

probonopd commented Dec 3, 2019

Thanks for the explanation, very useful. Worked for me!

@probonopd
Copy link
Author

probonopd commented Mar 25, 2024

And as of 2024, Gigaset (the formerly reputable Siemens phone business) is insolvent and Hong Kong's VTech is the new owner, just like it went with snom!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment