Hi Daniel,<br><br>My problem is how to define the hash table in Kamailio.cfg. Especially I don't understand how to define :<br><h3 class="title"><code class="varname">key_name_column: here I understand that is the name of the key = fist col (phonenumber)<br>
</code></h3><h3 class="title"><code class="varname">key_type_column == string ?<br></code></h3><h3 class="title"><code class="varname">value_type_column == string ?<br></code></h3><h3 class="title"><code class="varname">key_value_column == second col(prefix)?<br>
</code></h3> <br><br>I get the following errors:<br><br>ERROR:db_mysql:db_mysql_submit_query: driver error on query: Unknown column 'key_type' in 'field list'<br>ERROR:core:db_do_query: error while submitting query<br>
ERROR:htable:ht_db_load_table: Error while querying db<br>ERROR:core:init_mod: failed to initialize module htable<br>ERROR:core:main: error while initializing modules<br><br>Thank you <br><br>Alex<br><br><br><br><div class="gmail_quote">
On Wed, Dec 23, 2009 at 6:43 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">
Hello,<div class="im"><br>
<br>
On 12/23/09 4:28 PM, alex pappas wrote:
</div><blockquote type="cite">Hi all,<br>
<br><div class="im">
It is possible to have some help in defining the hash table?<br>
<br>
I'm giving some parameters but some of them i don't really understand
them. my configuration is:<br>
<br>
# --------- Htable ---------<br>
modparam("htable", "htable", "a=>dbtable=ported1;")<br>
modparam("htable", "db_url",
"mysql://pskoul:pskoul123@localhost/openser")<br>
modparam("htable", "key_name_column", "phonenumber")<br>
modparam("htable", "key_value", "prefix")<br>
modparam("htable", "fetch_rows", 1000)<br>
<br>
The table I want to htable is a 2 cols table (phonenumber,prefix) In
mysql they are defined as varchar(10). All the phonenumber values are
unique so the key in htable is phonenumber with value in prefix.<br>
</div></blockquote>
<br>
what don't you understand? I do not know what to explain. Is there any
error you get? At least the parameter key_value is wrong, should be
key_value_column.<br>
<br>
Cheers,<br><font color="#888888">
Daniel</font><div><div></div><div class="h5"><br>
<br>
<blockquote type="cite"><br>
Thanks All,<br>
<br>
Alex<br>
<br>
<br>
<br>
<div class="gmail_quote">On Wed, Dec 23, 2009 at 1:04 PM, alex pappas
<span dir="ltr"><<a href="mailto:rebel.pappas@gmail.com" target="_blank">rebel.pappas@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thank
you Daniel,<br>
<br>
I will try first oracle db and then htable which is also very
interesting. When I'm done I will get back with the results.<br>
<br>
Cheers<br>
<font color="#888888">Alex</font>
<div>
<div><br>
<br>
<br>
<br>
<div class="gmail_quote">On Wed, Dec 23, 2009 at 11:44 AM,
Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">
Hello,
<div><br>
<br>
On 12/22/09 1:25 PM, alex pappas wrote:
<blockquote type="cite">Hi all,<br>
<br>
Concerning portability again :-)<br>
<br>
Is there any way I can add in the memory all the numbers with
portability? (2.000.000 rows)?<br>
And also reload these data a few times a day and access this data from
the Kamailio script?<br>
</blockquote>
<br>
</div>
while I advise usage of sqlops/sql_query() instead of
avpops/avp_db_query(), if you want to load such data in memory should
be in shared memory. For that look at htable or maybe you can re-use
pdt.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote type="cite">
<div>
<div><br>
Cheers<br>
Alex<br>
<br>
<br>
<br>
<div class="gmail_quote">On Tue, Dec 22, 2009 at 12:56 AM,
Henning
Westerholt <span dir="ltr"><<a href="mailto:henning.westerholt@1und1.de" target="_blank">henning.westerholt@1und1.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On
Mon,
December 21, 2009 9:50 pm, Alex Balashov wrote:<br>
> [..]<br>
<div>> Having said that, AVPs are still very useful
and necessary because they<br>
> persist across the lifetime of a transaction, so you can access
them in<br>
> subsequent reply and failure routes. This is not true of user<br>
> pseudovariables ($var(...)), nor, as far as I know, of any other
class<br>
> of pseudovariable at this point except special
transaction-persistent<br>
> ones exported by modules.<br>
><br>
> As a result, it is often necessary for me to take data from $dbr<br>
> (sqlops) and load it into arrays of AVPs, such as for example when
doing<br>
> custom fail-over in failure_route that uses logic for which
dispatcher<br>
> is not suitable. I store a set of gateways in an AVP array along
with<br>
> another AVP value indicating the current array index and iterate
over<br>
> them in failure_route, and so on.<br>
><br>
> Daniel taught me how to use AVP arrays once, although I noticed
this is<br>
> not mentioned anywhere in the avpops documentation. It should be<br>
> published somewhere, as it is one of the most useful programmatic<br>
> features of Kamailio.<br>
><br>
> Henning/Daniel, does Kamailio 3/SR offer any kind of better
substitute<br>
> for what I am doing with AVPs as described above? In other words,
are<br>
> there any transaction-persistent pseudovariables and/or namespace<br>
> containers that are easier to deal with syntactically, and provide
more<br>
> advanced data structure primitives like arrays? I am aware of
htable,<br>
> but I need something local to a transaction, not global.<br>
<br>
</div>
There are the $var PVs you already mentioned, and then also the $shv
that<br>
are shared variables. But they are (process) global, and not<br>
transactional. Daniel proposed and developed the new xavp type for sr<br>
which are basically extended AVPs. More informations can be found here:<br>
<a href="http://sip-router.org/wiki/devel/xavp" target="_blank">http://sip-router.org/wiki/devel/xavp</a><br>
<br>
Regards,<br>
<font color="#888888"><br>
Henning<br>
<br>
</font></blockquote>
</div>
<br>
</div>
</div>
<pre><fieldset></fieldset>
_______________________________________________
Kamailio (OpenSER) - Users mailing list
<div><a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a></div></pre>
</blockquote>
<br>
<div>
<pre cols="72">--
Daniel-Constantin Mierla
* <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a>
</pre>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
<pre><fieldset></fieldset>
_______________________________________________
Kamailio (OpenSER) - Users mailing list
<a href="mailto:Users@lists.kamailio.org" target="_blank">Users@lists.kamailio.org</a>
<a href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a>
<a href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a></pre>
</blockquote>
<br>
<pre cols="72">--
Daniel-Constantin Mierla
* <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a>
</pre>
</div></div></div>
</blockquote></div><br><input id="gwProxy" type="hidden"><input onclick="jsCall();" id="jsProxy" type="hidden"><div id="refHTML"></div>