DUNDi module development

So i’ve made this nastyish piece of PHP which directly edits the dundi.conf file and can change general parameters, add and remove mappings, add and remove peers and also manage keys (!)

It can create a set of keys and publish the public one on the web server and wget corresponding keys from other peers assuming the same location.

It works quite well but i am somewhat a novice when it comes to PHP, linux and asterisk.

Nonetheless I think it might make an excellent starting point to get a DUNDi module written for FreePBX, so i started trying to convert it for the module API today but ended up giving myself a sore headache. I wish I started with the FreePBX api in the first place now rather than writing a stand-alone PHP script!

So, who here fancies helping me with the code to get this built into FreePBX ?