[sr-dev] htable add/delete RPC commands

Ovidiu Sas osas at voipembedded.com
Tue Feb 25 17:29:51 CET 2014


Juha,

Based on how htable works now, a specific pseudoarray entry can be
deleted by specifying it's position:
kamcmd htable.delete H_TABLE H_KEY[INDEX]
I tested it and it works ok.

-ovidiu

On Sat, Feb 22, 2014 at 4:29 PM, Juha Heinanen <jh at tutpro.com> wrote:
> Ovidiu Sas writes:
>
>> I moved the discussion here, in a separate thread.
>> It seems that what are you looking for is not there ... not
>> implemented.
>
> yes, that is way is asked about it.
>
>> If you have the same key_name with different values in the table, the
>> last value will be the one loaded in memory.
>> You can't have an array of values for the same keys.
>
>> Also, there's no syntax to access a particular value in an array.
>> Maybe that's why there's no option to provide the value.
>
> see this:
>
> o key type - the type of the key
>
>     0 - simple key - the key is added as 'key_name'.
>
>     1 - array key - the key is added as 'key_name[n]'. n is incremented
>     for each key with this name to build an array in hash table.
>
> for example:
>
>     $var(size) = $sht(htable=>$var(key)::size);
>     $var(i) = 0;
>     while ($var(i) < $var(size)) {
>         $var(value) = $sht(htable=>$var(key)[$var(i)]);
>         ...
>
>  -- juha



-- 
VoIP Embedded, Inc.
http://www.voipembedded.com



More information about the sr-dev mailing list