[asterisk-dev] [design] Matching algorithm

Steve Edwards asterisk.org at sedwards.com
Tue Jun 3 13:38:27 CDT 2008


On Tue, 3 Jun 2008, Jared Smith wrote:

> On Tue, 2008-06-03 at 16:33 +0000, Tony Mountifield wrote:
>> So my preference would be for only upper case N, X and Z to be special,
>> and lower case to be literal characters. I don't know how many Asterisk
>> users do _nxxnxxxxxx instead of _NXXNXXXXXX
>
> Unfortunately, I know from experience that a _very large_ number of
> people are using lower-case _nxxnxxxxxx for pattern matching, and so
> even though I'd personally like to have only allowed upper-case letters
> from the beginning, I think we'd be doing users in general a big
> disservice by changing things at this point.  Isn't hindsight a
> wonderful thing?

To quote Sidney Poitier -- "they call me mister lowercase."

I use lower case everywhere except global and channel variables:

; templates
[digit-timeout](!)
 	exten = t,1,			goto(${CONTEXT},s,1)
[h](!)
 	exten = h,1,			verbose(1,${CONTEXT}:${EXTEN}:${PRIORITY})
 	exten = h,n,			goto(finish-call,h,1)
[i](!)
 	exten = i,1,			goto(${CONTEXT},s,1)
[pound-hangup](!)
 	exten = #,1,			hangup()
[pound-main](!)
 	exten = #,1,			goto(main-menu,s,1)
[s](!)
 	exten = s,1,			verbose(1,${CONTEXT}:${EXTEN}:${PRIORITY})
[x](!)
 	exten = _x.,1,			verbose(1,${CONTEXT}:${EXTEN}:${PRIORITY})

; an example context
[example](digit-timeout,h,i,pound-main,s)
 	exten = s,n,			dial(sip/example)
 	exten = s,n,			hangup()

I think treating lowercase differently than uppercase would introduce 
hardship on existing dialplans, cause future dialplan writers grief, 
foster the "here the developers go again with another needless change just 
for the !@#$ of it" mentality, and contribute to global warming.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-dev mailing list