[asterisk-users] Can someone give a plain english explanation of the HASH function?

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Sun Sep 14 11:53:19 CDT 2008


On Saturday 13 September 2008 22:29:24 Alex Balashov wrote:
> Tilghman Lesher wrote:
> > On Saturday 13 September 2008 21:14:24 Alex Balashov wrote:
> >> On Sat, September 13, 2008 10:08 pm, Tilghman Lesher wrote:
> >>> Basically, it's a way to retrieve multiple values from a database
> >>> without using ARRAY() to enumerate each field, but also without
> >>> polluting the variable namespace, which could cause unexpected
> >>> behavior, such as when somebody adds a field to a database table whose
> >>> name happens to coincide with an existing variable.
> >>
> >> Or when the domain of keys you want to use for suitable or desirable
> >> variable names does not make.  :)
> >
> > Oh, you mean like a table column name that starts with an underscore? 
> > That's the only case I can think of where that wouldn't work out well.
>
> I would have thought the HASH() function can take as a key parameter
> various types of data, including multidimensional kinds, or something
> that looks Asdiuhadiu12b34918h213i1u3h19833n3iu, which, while usable as
> a string key, is undesirable to have, recall, store, or reference as a key.

I'm a Perl programmer, as well, so some of the features I introduce into the
Asterisk dialplan are taken from concepts from that language.  In this case,
I took the concept of hash variables and create the HASH() function.  I hope
this clarifies the naming.

-- 
Tilghman



More information about the asterisk-users mailing list