2013/10/16 David M. Lee <dlee at digium.com>: > Alistair Cunningham wrote: > >> If implementing this using ARI, we're going to get events such as >> PlaybackFinished, ChannelDtmfReceived, and Hangup. When this happens, >> how do we know where we are in the call flow and what to do next? >> Several options spring to mind: > > The great thing about ARI is that any of those methods could work. You > can use whatever is appropriate for you and your team. > I believe the details will differ whether you have a permanent process that will handle those events or you will fire up new processes based on the events you receive. When we started doing AMI for Wombat, we used a message-based architecture where all AMI messages go through a broker and things you perform are just objects registered to the broker, that tell the broker things like "I am interested in this kind of event" or "I am interested in this kind of reply" and can queue up more AMI actions for processing and will unregister themselves when done. This helps decoupling from the details - you can get the current state of all the things you are doing just by querying your objects, and an object can perform a sequence of actions. l. -- Loway - home of QueueMetrics - http://queuemetrics.com Try the WombatDialer auto-dialer @ http://wombatdialer.com