[asterisk-dev] Dialplan - critical sections / semaphores / run-all-of

Kevin P. Fleming kpfleming at digium.com
Thu Jun 8 09:19:00 MST 2006


----- Stephen Davies <stephen.l.davies at gmail.com> wrote:

> My idea was to put these sorts of code sections into a Macro and add
> a
> new way to call a Macro that first locks an associated mutex.  Or

I think adding an option to Macro, or creating a variant called MacroExclusive, would be a fine idea. Unfortunately Macro's syntax doesn't lend itself to taking option arguments...

> Not sure how best to handle in the dialplan.  Perhaps again a way to
> mark a Macro for this treatment?

Again, yes, this would be an ideal way to do it, adding an option to Macro to ensure that the entire thing runs to completion (although any apps in the macro that try to interact with the channel's audio will obviously not work, but this is no different than running them in the 'h' extension).

A third option would be to do this using Gosub() instead of Macro(), which doesn't have the limitation of having to pass arguments to the called code... It could be Gosub(context[|extension[|priority[|options]]]).

-- 
Kevin P. Fleming
Senior Software Engineer
Digium, Inc.




More information about the asterisk-dev mailing list