[Asterisk-Dev] [RFC] Dial plan extension handling change: "snapshot
run list"
Kevin P. Fleming
kpfleming at starnetworks.us
Sun Oct 3 08:49:15 MST 2004
I'm working on an enhancement for dial plan handling, and it would
simplify my work quite a bit if the following change was acceptable to
the Asterisk community :-)
extensions.conf
exten => 100,1,Wait(2)
exten => 100,2,Answer
exten => 100,3,Playback(foo/bar)
exten => 100,4,Background(foo/menu)
exten => 100,5,Background(foo/menu2)
exten => 1,...
exten => 2,...
exten => 3,...
exten => i,...
Let's assume for the sake of this discussion that "sounds/foo/bar" is a
10-second audio clip.
As it stands today, if a channel is sent into this context/extension,
and then extensions.conf is changed/reloaded while the channel is
processing these steps, it will _not_ continue processing the steps as
they were when it entered the context/extension, the reload will affect
the "live" channel.
For example: if the channel is currently in priority 3 playing the audio
clip, and the reload causes the steps to be moved down one (maybe
someone added another Wait() at priority 3), then the same audio clip
will be played again to the channel, because it will now be priority 4.
What I'm proposing is that when a channel enters a context/extension, a
"snapshot" of all the priorities of that extension is grabbed into a
"runlist", which the channel uses until it needs to leave the runlist
(because of a Goto/GotoIfTime, hangup/timeout, etc.).
This will have (at least) two advantages: the live channel's behavior
will not be affected by a reload, and processing of the extension's
priorities will be somewhat faster as the list of steps to be run will
already be determined (as opposed to doing the dialplan search for each
step).
This will be somewhat complicated to implement, but I believe it can be
done and I'm willing to do the work to make it happen. This change will
allow me to implement a "prefix", a set of steps to be run before any
defined steps for a given extension, because those prefix steps could be
prepended to the "runlist", as if they had been present in the
extension's priorities.
Comments?
More information about the asterisk-dev
mailing list