I fixed the issue by opening the iphone. the indicator sticker where all red so a clear sign of water damage. I disasembled all parts and cleaned them all with alcohol. Esecially all connectors. The replacement of the complete speaker, microphone, dock connector didn't do the trick.
Answer to: How To Fix "This accessory is not optimized for this iPhone” Error?