[sr-dev] about matrix module

Henning Westerholt henning.westerholt at 1und1.de
Mon Oct 11 17:07:11 CEST 2010


On Monday 11 October 2010, Juha Heinanen wrote:
> i was searching for a module that could be used to implement lookup of a
> string value based on two other strings.

Hello Juha,

at the moment this module supports only integer lookups, i think.
 
> matrix module would otherwise be ok, but i would need to have at least
> two matrixes.  so a matrix_name column would need to be added to matrix
> table and matrix name argument to matrix function.  also, i'm worried
> about the linked list implementation and would prefer a hash table based
> one: first look for the first index from a hash table, which would then
> point to the hash table of the second index.

You need two isolated matrixes, i see. You're right, the moment the module 
only supports one table. Maybe i understood you wrong, but have you thought 
about storing the data of both in one table?

> [..]
> i would be interested to learn, why matrix module was developed in the
> first place.  why is is better suited for the job than htable module?
> and if there are good reasons, why matrix module is better for its
> intended job than htable module, is there interest in developing matrix
> module further along the lines i described in above?

One reason for developing the module was that there were no dialplan and 
htable available during the time we developed it. :-) Another reason is that 
its in this form conceptionally easier to understand, maintain and use for the 
(limited) requirements we've had for it so far. This was also the reason for 
the choice of a O(n) function for the lookup.

I'd say that changing the implementation of the lookup function should be not 
that complicated. Marius B., do you worked on it the last time, what do you 
think about it?

Regards,

Henning



More information about the sr-dev mailing list