[SR-Users] lcr_id vs lcr_count

Alexandru Covalschi 568691 at gmail.com
Wed Nov 29 08:04:59 CET 2017


There is a strong reason to have lcr_count variable - it actually represents the size of in-memory table that is created to store all lcr_id's on module loading, I don't think there is a way to avoid that, unless you rewrite lcr module to not load lcr in-memory, but query database (which IMO is a terrible idea).
If you need to dynamically assign kamailio lcr_id you can use event_route[core:worker-one-init] and write lcr_id inside $shv().
________________________________
Alexandru Covalschi
VoIP Engineer and System Administrator
tel: +373 673 98 493

> 29 нояб. 2017 г., в 8:54, Patrick Wakano <pwakano at gmail.com> написал(а):
> 
> Hello Kamailio list!
> 
> I've been working with the LCR module and I wanted to use the lcr_id to match some ID's I have somewhere else.
> However, due to the lcr_count my lcr_ids must be less than the lcr_count. I understand the reason behind the lcr_count, what I think is a mistake is to have the lcr_id dependent of the lcr_count.
> Ideally we should be able to use any lcr_id value, just observing that the total amount of lcr groups should not exceed the lcr_count.
> The problem is this if that appears in the load_gws, to_gw and from_gw functions in lcr_mod.c:
>     if ((lcr_id < 1) || (lcr_id > lcr_count_param)) {
>     LM_ERR("invalid lcr_id parameter value %d\n", lcr_id);
>     return -1;
>     }
> 
> I ended up using another table to make the conversion of ids, but this is horrible.... Any other reason to force the lcr_id to be less than the lcr_count?
> 
> Best Regards,
> Patrick Wakano
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20171129/002c92a9/attachment.html>


More information about the sr-users mailing list