No need for multithreading of any sort. Just leave that to me. It's all under control and it look much like Elbow's idea. The best way do know if it will work for sure is to try it. But feel free to make objections
. That will probably help us perfect the code even more.
Speaking of multithreading, what really happen when the same asterisk box receives another call while the agi is already running? It will be interesting to know that. If more than one a2billing.php process are running, could that pose some sort of problem (hypothetically)? If so, it could explain some random and yet unexplained behaviors that we are observing with a2billing. (It's just a thought)
I know that while php itself and its 'core extensions' are thread safe, many 3rd party extensions are not. So if none of those 'thread unsafe' extensions are being used, it should be possible to use php in a threaded environment. But that's not what I intend to do.
Added after 1 hours 25 minutes: Oh, by the way, FastAGI AGI only allow to implement an AGI call over a TCP socket. So instead of having the AGI script in the same box, it can be called from another box. Not sure how that will help thought.
In our drawings, the AGI script will be in the box containing A2Billing.