[SR-Users] getting unexpected values from htable

Javier Gallart jgallartm at gmail.com
Fri Oct 15 17:34:32 CEST 2010


Hello

thanks....I think It's working now; I had defined the key_type and
value_type columns as char; I've changed them to integer and now it's
showing the correct values.


Regards

Javi
On Fri, Oct 15, 2010 at 12:32 PM, Elena-Ramona Modroiu <ramona at asipto.com>wrote:

>  Hi,
>
>
> On 10/14/2010 04:26 PM, Javier Gallart wrote:
>
> Hi all
>
>  I'm testing the htable module at Kamailio 3.1. Currently it's an
> extremely simple table with a single row loaded from a postgres DB.
> These are the relevant lines in the configuration file:
>
>  modparam("htable", "db_url", "postgres://user:password@localhost
> :5432/database")
> modparam("htable", "htable", "a=>size=2;autoexpire=0;dbtable=h_table;")
> modparam("htable", "key_name_column", "key_name")
> modparam("htable", "key_type_column", "key_type")
> modparam("htable", "value_type_column", "value_type")
> modparam("htable", "key_value_column", "key_value")
>
>  The only line in the table is:
>
>   key_name | key_value | key_type | value_type
> ----------+-----------+----------+------------
>  5        | 1         | 1        | 0
>
>
> do you want to store the value in an array-like format? I see you have
> key_type=1
>
>
> For key_type 1 the key name in htable should be 5[0] and another item with
> key 5::size should be there, but sht_print() does not show it.
>
> Are you sure this is the record you had in database? I tested with same
> record but with mysql and it looks ok in sht_print().
>
> Regards,
> Ramona
>
>
>  However, sht_print() shows this:
>
>   0(8570) ERROR: htable [ht_api.c:488]: ===== htable[a] hid: 109 exp: 0>
>  0(8570) ERROR: htable [ht_api.c:492]: htable[0] -- <0>
>  0(8570) ERROR: htable [ht_api.c:492]: htable[1] -- <0>
>  0(8570) ERROR: htable [ht_api.c:492]: htable[2] -- <0>
>  0(8570) ERROR: htable [ht_api.c:492]: htable[3] -- <1>
>  0(8570) ERROR: htable [ht_api.c:496]: cell: 5
>  0(8570) ERROR: htable [ht_api.c:498]: hid: 51 msize: 74 flags: 0 expire:
> 0
>  0(8570) ERROR: htable [ht_api.c:502]: v-i:9585128
>
>  Any idea of what might be happening?
>
>  Thanks in advance.
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users at lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20101015/b4e08dbe/attachment.htm>


More information about the sr-users mailing list