[asterisk-users] Executing a dynamic sequence of applications

Matthew Jordan mjordan at digium.com
Thu May 30 06:55:25 CDT 2013


On 05/30/2013 04:46 AM, Grant Bagdasarian wrote:
> Hello,
> 
>  
> 
> I’m researching the possibilities of multiple communication platforms
> like Asterisk and FreeSwitch for handling a dynamic sequence of
> applications to execute, like Playback, Read, etc.
> 
>  
> 
> This only applies to originating a call from an external application by
> using the AMI Manager and the Originate action.
> 
>  
> 
> I need to know the following:
> 
> 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?

No it does not. Originating to an application is a convenience mechanism
for when you want to spawn a channel, have a single application execute
against it, and hang it up when the application is finished.

> 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? I was thinking of creating a separate priority
> label for each required Application and have each application in the
> Variable key routed to the correct priority label. Is this possible? Are
> there alternatives for doing what I require?
> 

That's not how the dialplan works. The dialplan is a configured sequence
of actions that you take on a channel; it is not meant for external
manipulation of the channel.

As noted by Yves, external manipulation of channels can be done using
AGI. In AGI, the actions executed on a single channel are all performed
externally. Your dialplan ends up being quite simple in that case:

[default]
exten => originated_channel,1,AGI( ... )

And you simply originate your channel to that context, extension,
priority tuple.

In your particular case, since you're using AMI for call control, you
may want to look into AsyncAGI as well. When the channel enters into an
AGI application using AsyncAGI, the same AMI connection can be used to
control the channel.

Matt

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org





More information about the asterisk-users mailing list