I wrote a tool that can extract and repack Grandstream firmware (https://github.com/BigNerd95/Grandstream-Firmware-HT802/tree...).
For example, I made a simple ARM patch that intercepts incoming caller IDs and triggers a bash script to decide what to do, in my case it checks a spam-lookup service and returns 0 or 1 so the ATA either rings or rejects the call.