[asterisk-users] Asterisk as an IVR solution

Steve Edwards asterisk.org at sedwards.com
Fri Jul 11 13:18:34 CDT 2008


> From: Steve Edwards <asterisk.org at sedwards.com>
>
> On Fri, 11 Jul 2008, Douglas Garstang wrote:
>
>> Ugh. Yes, the variables are local to the current channel. However, they 
>> are global to the entire dial plan within the current channel. I have 
>> stepped on myself many times because I've had a loop counter called $i 
>> for example, jumped somewhere else within that loop, reused the same 
>> variable name, $i, and screwed up my logic.
>
> Ugh indeed. While I sympathize with your local/global name space issues, 
> you lose credibility with your false economy.
>
> IMNSHO, anybody who uses a single [common] letter for a variable 
> deserves a bump in the temperature when they reach their final resting 
> place :)
>
> Surely you can come up with a name slightly more descriptive -- maybe 
> "idx?"
>
> Take pity on the next sod that has to plod through your dialplan. The 
> millisecond you "spend" typing a more meaningful name will be returned 
> to you (or your employer) a millionfold.

On Fri, 11 Jul 2008, Douglas Garstang wrote:

> Fine, I'll call it ${LoopVariable} then... how's that going to fix the 
> problem?

It (obviously) doesn't. It just "fixes" the next guy's problem when he 
tries to read your dialplan -- as stated above.

I'm just suggesting "better practices." Even examples should demonstrate 
best practices because they form the basis of some coders only source of 
knowledge.

Kind of like not "top posting" in a list where the posted "etiquette" is 
not top posting ;)

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-users mailing list