Here’s an interesting thought. I don’t know if it’s a function of Asterisk or the scripting language being used, but I see you can execute all the dial plan commands from within an AGI script. Dial, Queue and so on. I wonder if this is thread safe? That is, if the scripting language supports threads, and you started two threads, and each say, called Dial on a different user. Would that work, and would it be safe? I wonder if Asterisk would just block on the first thread it sees, and not allow the second to talk to it until the first was finished. It would be an interesting experiment. You could simulate SIP proxy forking with this, or do other neat stuff.
Hmmm… wait a sec. Each thread would have to write to stdout, which means they are both really communicating over the same output stream. Asterisk would receive the commands in no set order, and would execute them sequentially. I guess the question is then, what happens when dial command is received. Firstly, does asterisk return control? If it does, what happens if another Dial command comes in before the first has completed/timed out? Does it execute that second dial command concurrently with the first?