integrated changes from http://www.ip-phone-forum.de/showthread.php?t=267477