Create a module for Asterisk 1.6.x to handle dialplan scripting in PHP rather than the native dialplan languages.
This module must replace the core PBX/dialplan module, not just call PHP scripts from within the dialplan. It should essentially replace [url removed, login to view] with extensions.php. For a conceptual example and clues for implementation, look in the Asterisk source at pbx/pbx_lua.c.
The module that implements this must NOT simply fork a new instance of the PHP interpreter for each call -- that does not scale. The goal is for the Asterisk system to be able to handle as many calls in pbx_php as it can using standard dialplan or ael.
This module must include PHP extensions that encapsulate Asterisk dialplan applications and functions. This would best be expressed as on or more PHP objects that are instantiated for each call and provided as global variables to the script being executed. (As with the PHP module for Apache -- the variables that are automatically created for the server, session, etc.)
The module must be capable of inter-operating with the full range PHP modules (databases, sockets, curl, xml, etc.) so as to provide a similar "glue" for telephony as PHP + Apache provides for web development.
Note that the plan is to open source this module so there must be no issues with the intellectual property. You may not use any commercial or patent encumbered code. If you use open source code it must be licensed under the LGPL or BSD-style license.