Hello<div><br></div><div>thanks....I think It&#39;s working now; I had defined the key_type and value_type columns as char; I&#39;ve changed them to integer and now it&#39;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">&lt;<a href="mailto:ramona@asipto.com">ramona@asipto.com</a>&gt;</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&#39;m testing the htable module at Kamailio 3.1. Currently it&#39;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(&quot;htable&quot;, &quot;db_url&quot;,
&quot;postgres://user:password@localhost:5432/database&quot;)</div>
  <div>modparam(&quot;htable&quot;, &quot;htable&quot;,
&quot;a=&gt;size=2;autoexpire=0;dbtable=h_table;&quot;)</div>
  <div>modparam(&quot;htable&quot;, &quot;key_name_column&quot;, &quot;key_name&quot;)</div>
  <div>modparam(&quot;htable&quot;, &quot;key_type_column&quot;, &quot;key_type&quot;)</div>
  <div>modparam(&quot;htable&quot;, &quot;value_type_column&quot;, &quot;value_type&quot;)</div>
  <div>modparam(&quot;htable&quot;, &quot;key_value_column&quot;, &quot;key_value&quot;)</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&gt;</div>
  <div> 0(8570) ERROR: htable [ht_api.c:492]: htable[0] -- &lt;0&gt;</div>
  <div> 0(8570) ERROR: htable [ht_api.c:492]: htable[1] -- &lt;0&gt;</div>
  <div> 0(8570) ERROR: htable [ht_api.c:492]: htable[2] -- &lt;0&gt;</div>
  <div> 0(8570) ERROR: htable [ht_api.c:492]: htable[3] -- &lt;1&gt;</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>