Did you know that when doing a "lookup()" from script (registrar module), the "attr" AVP is also populated? Maybe you can use this information and rewrite that "avp_db_query" portion of your script in order to achieve the fast cache-querying logic (db_mode = 0) you are talking about.

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 19.04.2016 00:07, Rodrigo Pimenta Carvalho wrote:

Hi Liviu.



When I use "modparam("usrloc", "db_mode", 1)" the following query works fine and gives me the right result:


avp_db_query("select attr from location where contact like '$(ct.fields(uri){s.select,0,;})%' and username = '$fU'", "$avp(caller)");


When I use "modparam("usrloc", "db_mode", 0)" the above query doesn't give me the right value.


It is true because the query seems to acts only over the database, not over data from cached memory. And in this case the data from database obviously is not equal to that from cached memory. As you told me: ""db_mode" of the usrloc module has nothing to do with "avp_db_query""


So, in this case, how to execute queries over data from cached memory?


Any hint will be very helpful!


Best regards.



RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979


------------------------------------------------------------------------
*De:* users-boun...@lists.opensips.org <users-boun...@lists.opensips.org> em nome de Liviu Chircu <li...@opensips.org>
*Enviado:* segunda-feira, 18 de abril de 2016 10:50
*Para:* users@lists.opensips.org
*Assunto:* Re: [OpenSIPS-Users] How to avoid increasingly memory comsuption with AVPs? Yes you can, "db_mode" of the usrloc module has nothing to do with "avp_db_query" from the avpops module! :)
Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
<http://www.opensips-solutions.com/>
        
Home — OpenSIPS Solutions <http://www.opensips-solutions.com/>
www.opensips-solutions.com
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is more than a SIP proxy/router as it includes application-level functionalities.

On 18.04.2016 15:10, Rodrigo Pimenta Carvalho wrote:

Hi Liviu.


Thank you very much!

So, I'm comfortable with OpenSIPS.


In my OpenSIPS config file I have:


loadmodule "usrloc.so"
modparam("usrloc", "db_mode",   2)


Can I change db_mode to zero and still have every avp_db_query working well?

That is, with db_mode=0 I will avoid using Sqlite and every SQL operation over user location will apply just over data in memory cache. Am I correct?


Any hint will be very helpful!




_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to