[Kamailio-Users] avpops OR sqlops

Daniel-Constantin Mierla miconda at gmail.com
Wed Dec 23 17:43:38 CET 2009


Hello,

On 12/23/09 4:28 PM, alex pappas wrote:
> Hi all,
>
> It is possible to have some help in defining the hash table?
>
> I'm giving some parameters but some of them i don't really understand 
> them. my configuration is:
>
> # --------- Htable ---------
> modparam("htable", "htable", "a=>dbtable=ported1;")
> modparam("htable", "db_url", "mysql://pskoul:pskoul123@localhost/openser")
> modparam("htable", "key_name_column", "phonenumber")
> modparam("htable", "key_value", "prefix")
> modparam("htable", "fetch_rows", 1000)
>
> 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.

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.

Cheers,
Daniel

>
> Thanks All,
>
> Alex
>
>
>
> On Wed, Dec 23, 2009 at 1:04 PM, alex pappas <rebel.pappas at gmail.com 
> <mailto:rebel.pappas at gmail.com>> wrote:
>
>     Thank you Daniel,
>
>     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.
>
>     Cheers
>     Alex
>
>
>
>
>     On Wed, Dec 23, 2009 at 11:44 AM, Daniel-Constantin Mierla
>     <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>
>         Hello,
>
>
>         On 12/22/09 1:25 PM, alex pappas wrote:
>>         Hi all,
>>
>>         Concerning portability again :-)
>>
>>         Is there any way I can add in the memory all the numbers with
>>         portability? (2.000.000 rows)?
>>         And also reload these data a few times a day and access this
>>         data from the  Kamailio script?
>
>         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.
>
>         Cheers,
>         Daniel
>
>>
>>          Cheers
>>         Alex
>>
>>
>>
>>         On Tue, Dec 22, 2009 at 12:56 AM, Henning Westerholt
>>         <henning.westerholt at 1und1.de
>>         <mailto:henning.westerholt at 1und1.de>> wrote:
>>
>>             On Mon, December 21, 2009 9:50 pm, Alex Balashov wrote:
>>             > [..]
>>             > Having said that, AVPs are still very useful and
>>             necessary because they
>>             > persist across the lifetime of a transaction, so you
>>             can access them in
>>             > subsequent reply and failure routes.  This is not true
>>             of user
>>             > pseudovariables ($var(...)), nor, as far as I know, of
>>             any other class
>>             > of pseudovariable at this point except special
>>             transaction-persistent
>>             > ones exported by modules.
>>             >
>>             > As a result, it is often necessary for me to take data
>>             from $dbr
>>             > (sqlops) and load it into arrays of AVPs, such as for
>>             example when doing
>>             > custom fail-over in failure_route that uses logic for
>>             which dispatcher
>>             > is not suitable.  I store a set of gateways in an AVP
>>             array along with
>>             > another AVP value indicating the current array index
>>             and iterate over
>>             > them in failure_route, and so on.
>>             >
>>             > Daniel taught me how to use AVP arrays once, although I
>>             noticed this is
>>             > not mentioned anywhere in the avpops documentation.  It
>>             should be
>>             > published somewhere, as it is one of the most useful
>>             programmatic
>>             > features of Kamailio.
>>             >
>>             > Henning/Daniel, does Kamailio 3/SR offer any kind of
>>             better substitute
>>             > for what I am doing with AVPs as described above?  In
>>             other words, are
>>             > there any transaction-persistent pseudovariables and/or
>>             namespace
>>             > containers that are easier to deal with syntactically,
>>             and provide more
>>             > advanced data structure primitives like arrays?  I am
>>             aware of htable,
>>             > but I need something local to a transaction, not global.
>>
>>             There are the $var PVs you already mentioned, and then
>>             also the $shv that
>>             are shared variables. But they are (process) global, and not
>>             transactional. Daniel proposed and developed the new xavp
>>             type for sr
>>             which are basically extended AVPs. More informations can
>>             be found here:
>>             http://sip-router.org/wiki/devel/xavp
>>
>>             Regards,
>>
>>             Henning
>>
>>
>>
>>         _______________________________________________
>>         Kamailio (OpenSER) - Users mailing list
>>         Users at lists.kamailio.org <mailto:Users at lists.kamailio.org>
>>         http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
>>         http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
>
>         -- 
>         Daniel-Constantin Mierla
>         *http://www.asipto.com/
>                
>
>
>
>
> _______________________________________________
> Kamailio (OpenSER) - Users mailing list
> Users at lists.kamailio.org
> http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
> http://lists.openser-project.org/cgi-bin/mailman/listinfo/users

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/users/attachments/20091223/a1f46867/attachment-0001.htm>


More information about the Users mailing list