[Kamailio-Users] What happens with filled htables?

Daniel-Constantin Mierla miconda at gmail.com
Wed Aug 26 16:02:58 CEST 2009



On 26.08.2009 15:29 Uhr, Alex Balashov wrote:
> Daniel-Constantin Mierla wrote:
>>
>>
>> On 26.08.2009 14:38 Uhr, Alex Balashov wrote:
>>> Daniel-Constantin Mierla wrote:
>>>> Hi,
>>>>
>>>> On 26.08.2009 14:26 Uhr, catalina oancea wrote:
>>>>> Hello
>>>>>
>>>>> I use the htable module a lot but the only problem, when I add a new
>>>>> entry in a htable, is when I will delete it. My question is: if the
>>>>> hash table is completely filled and I try to add a new value to 
>>>>> it, do
>>>>> I get an error or is an old value automatically deleted to be able to
>>>>> write my new value? If an old value was automatically deleted 
>>>>> whenever
>>>>> a new value is added, I wouldn't have to bother deleting the values I
>>>>> no longer need.
>>>>>   
>>>> the are deleted only if you have auto-expire set for htable -- see 
>>>> readme for defining htables.
>>>>
>>>> A hash table is filled when no more shm is available, it is better 
>>>> not to get there since not much will work at that time.
>>>
>>> There is no way to manually delete a key->value in a bucket?
>> it is (was there from first day):
>>
>> $sht(a=>x) = null;
>>
>> I have been talking about auto-delete.
>>
>> There are options to delete by regular expression matching against 
>> key or value, see:
>> http://kamailio.org/docs/modules/1.5.x/htable.html#id2491912
>
> Oh, I see.  Sorry for the confusion!
>
> What would be interesting and pleasant is some sort of map() function 
> (in the Perl and/or functional programming style) that allows one to 
> easily load database result sets into a hash table, keyed by a column.
this is available in kamailio via sqlops and htable module. You can 
iterate through sql result, have access to column name and value.

Not sure right now what it takes to export it to perl or so. The c code 
has function to add a item in table as simple as add_item(str key, 
int_str value).

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/





More information about the sr-users mailing list