[Asterisk-Users] Re: Explicit Dialplan Exit

Tony Mountifield tony at softins.clara.co.uk
Thu Jun 1 01:20:24 MST 2006


In article <645FEC31A18FE54A8721500CDD55A7B6031B8DB2 at mail.oneeighty.com>,
Douglas Garstang <dgarstang at oneeighty.com> wrote:
> -=-=-=-=-=-
> -=-=-=-=-=-
> 
> Eh, I'm thinking I don't like labels very much. They aren't all they are cracked up to be.
>  
> Previously, using extensions of the format extension-function, like 2944000-open or
> 2944000-closed for example, I could break up an extension into logical units based on
> function, and it made sense. By exclusively using labels, everthing is in the one extension
> and it isn't as easy to read at a glance. There's also the chance that statements from one
> section could over-run into another.
>  
> or... am I missing something?

I don't think labels are intended to be a replacement for logically named
extensions. I prefer your original dialplan, but with the change that
consecutive sequences of priorities after "1" can be numbered "n".

I think the evolution went like this (I remember watching it happen):

a) So that we don't have to renumber lines when adding or removing a step,
   let's define a priority "n" that means "one more then the previous step".

b) Now what do I do when Dial wants to jump to priority+101? I don't know
   what number to use for the target priority! OK, let's allow "n+number".

c) That's ok, but if I have, say 3 steps after the Dial, I then have to
   number to target line of the jump something like "n+97", and that offset
   will change when I add or delete lines above it: back to square one.

d) OK, how about adding a label to a priority, so that it can be referred
   to by name? Oh, but that still doesn't really help the n+100 problem.

e) But it does if you allow a priority to be specified as "label+number".
   Then you can label the Dial statement, and use "label+101" as the jump
   destination.

f) After all that, priority jumping got deprecated, and now we return
   DIALSTATUS instead, and do a GOTO based on that.

I've probably missed a bit, but certainly I don't think there was the
idea that everything should become the same extension and just use labels.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-users mailing list