I found a link to a script that does this (credit to this clearly smart guy
pquiring.homedns.org/) on the Vicidial forums a while back. I couldn't get it to work on Elastix so I made some changes.
redlinetel.com/?q=node/8
As of right now it breaks some things in Elastix but Vicidial works great. I think it is because Vicidial wants to run everything as root. I think if we figure out the permissions thing (get Vicidial to run as Asterisk or Elastix to run as root) then everything should work. It is packaged as a freepbx module but needs a few things done on the commmand line to complete the installation. Upload it on the FreePBX modules page, then follow the instructions.
This will only work on systems running Asterisk 1.4.xx. That is a Vicidial thing. If someone can figure out how to get Vicidial running on asterisk 1.6.2.xx that would be really cool!