Hello<div><br></div><div>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.</div><div><br></div>
<div><br></div><div>Regards</div><div><br></div><div>Javi<br><div class="gmail_quote">On Fri, Oct 15, 2010 at 12:32 PM, Elena-Ramona Modroiu <span dir="ltr"><<a href="mailto:ramona@asipto.com">ramona@asipto.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div text="#000000" bgcolor="#ffffff">
Hi,<div class="im"><br>
<br>
On 10/14/2010 04:26 PM, Javier Gallart wrote:
<blockquote type="cite">Hi all
<div><br>
</div>
<div>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.</div>
<div>These are the relevant lines in the configuration file:</div>
<div><br>
</div>
<div>
<div>modparam("htable", "db_url",
"postgres://user:password@localhost:5432/database")</div>
<div>modparam("htable", "htable",
"a=>size=2;autoexpire=0;dbtable=h_table;")</div>
<div>modparam("htable", "key_name_column", "key_name")</div>
<div>modparam("htable", "key_type_column", "key_type")</div>
<div>modparam("htable", "value_type_column", "value_type")</div>
<div>modparam("htable", "key_value_column", "key_value")</div>
</div>
<div><br>
</div>
<div>The only line in the table is:</div>
<div><br>
</div>
<div>
<div> key_name | key_value | key_type | value_type </div>
<div>----------+-----------+----------+------------</div>
<div> 5 | 1 | 1 | 0</div>
</div>
</blockquote>
<br></div>
do you want to store the value in an array-like format? I see you have
key_type=1<br>
<br>
<br>
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.<br>
<br>
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().<br>
<br>
Regards,<br>
Ramona<br>
<br>
<blockquote type="cite"><div class="im">
<div><br>
</div>
<div>However, sht_print() shows this:</div>
<div><br>
</div>
<div>
<div> 0(8570) ERROR: htable [ht_api.c:488]: ===== htable[a] hid: 109
exp: 0></div>
<div> 0(8570) ERROR: htable [ht_api.c:492]: htable[0] -- <0></div>
<div> 0(8570) ERROR: htable [ht_api.c:492]: htable[1] -- <0></div>
<div> 0(8570) ERROR: htable [ht_api.c:492]: htable[2] -- <0></div>
<div> 0(8570) ERROR: htable [ht_api.c:492]: htable[3] -- <1></div>
<div> 0(8570) ERROR: htable [ht_api.c:496]: <span style="white-space:pre-wrap"> </span>cell: 5</div>
<div> 0(8570) ERROR: htable [ht_api.c:498]: <span style="white-space:pre-wrap"> </span>hid: 51
msize: 74 flags: 0 expire: 0</div>
<div> 0(8570) ERROR: htable [ht_api.c:502]: <span style="white-space:pre-wrap"> </span>v-i:9585128</div>
</div>
<div><br>
</div>
<div>Any idea of what might be happening?</div>
<div><br>
</div>
<div>Thanks in advance.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div><pre><fieldset></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div>