1)Does the Originate action support multiple Application keys? If so,how does it handle the order in which they’re added to the Originate action?
2)If it does not support multiple Application keys, I’ll have to instruct the Originate action to enter a context in the dialplan, and pass the sequence of applications in its Variable key. How would I configure the dialplan context to dynamically handle the sequence of applications to execute? Are there alternatives for doing what I require?
I would assume not, then create an application that does what you are specifically looking for. The limits the variability you are concerned about in the second part of your question.
Within the context, you can use asterisk-level variables, including astdb database tuples that include as much or as little detail as you need. You can pass the astdb variable indirectly through the event/context that produces the Originate call. Once the data is secure, you can use “if” functions within the context to perform as many and as complex steps as you’d care to implement.
Once you’re in a call, you aren’t under context control, per se, so you’d have to set everything up before you can originate the call. Once you are in the call, the only variability you’d have would be something like an on-demand audio stream or an IVR.
If you follow the AMI status stream, you will get the “answered” information from the existing datastream - no need for any special or custom programming there. The only way for you to effect the call, however, is to start another call leg and join the (now) three calls together into a pseudo-conference.
Now, the “I don’t want to tell you what I’m actually doing” implications in your questions so far have led us to the point that, without more details, the answers are going to start being “I don’t know - try it.”
If you want to get more specific, the answer can too. From a general perspective, though, I’m feeling like this is something you’re just going to have to program out.
It sounds like you want to ORIGINATE to EXTENSION (not application) and call your own context using the local channel such as to channel local/xxxx@my-own-context
[my-own-context]
exten => _.,1,Noop(Entering user defined context my-own-context)
exten => _.,n, Set(foo=${CURL(https://adresse.com/)})
exten => _.,n,Goto(from-internal,${EXTEN},1)
exten => _.,n,Hangup()