I can't claim to have anything to do with this script, and please only use it at your own risk. I am a PHP coder and I can't see anything wrong in it ( IE no calling out to a mother ship or setting up a Torrent server

The code is here https://raw.github.com/lgaetz/freepbx-t ... _trunk.php and it has pretty good instructions in it. It's all fairly simple, especially if you can get Asterisk running in the first place. What I like about it is in the script there is a bit where it will try and reload the trunks if it finds one down.
Anyway, hope this helps someone, it has eased my guess work if my FPL lines are up or not.