[Kamailio-Users] LCR Documentation

Juha Heinanen jh at tutpro.com
Sat Mar 7 03:33:57 CET 2009


Geoffrey Mina writes:

 > Even your 'clarification' statement means very little  to me.  What
 > would one use these flags for?

for anything that 32 bits is good for.  for example, you could use one
of the flags to tell if the gw is active and if not, call next_gw()
again.  you can also tell, for example, if gw accepts a particular
header, for example, rpid.

 > Could I perhaps check the value of a flag in my script to ensure my
 > gateway is active, and if not immediately call next_gw() until I found
 > a gateway which I flagged as 'active'?

yes you could.

 > Also- what is the recommended max routes for the lcr module.  Would
 > 10,000 be an acceptable number, or would the performance hit be too
 > great?

it is tradeoff between hash table size and performance.  module is using
hash on prefix.  if you have 10,000 different prefixes, you could
define lcr_has_size to be 10000 in which case collisions should be rare.

this too is documented in readme:

1.3.25. lcr_hash_size (integer)

   Defines the size of hash table used to store <prefix,
   from_pattern, priority> tuples. Hashing is done based on
   prefix. Larger value means less collisions with other prefixes.
   Hash size value should be a power of 2.

-- juha




More information about the Users mailing list