I'm also interested in this functionality, would you like to share it? :) Maybe Andrei will like to apply your patches to the trunk :)
From: [email protected] [mailto:[email protected]] On Behalf Of Abhinav Jha Subject: Re: [OpenSIPS-Devel] [Memcached module] Adding cache_increment/cache_decrement methods Thanks Andrei, This helped a lot. I chose the first method (modified the parser to recognize cache_increment and cache_decrement methods) and now I have working atomic cached_increment and cached_decrement methods in memcached module as well :) Abhinav On Mon, Feb 22, 2010 at 4:01 PM, Andrei Dragus <[email protected]<mailto:[email protected]>> wrote: Hi there, > 1. cache_fetch, cache_store and cache_remove are not exported by the > memcached module anywhere. How then are we able to use them from > opensips.cfg ? There is a layer of abstractization called memcache(in the core) which can be implemented in two ways "memcached" or "localcache" (both are modules). The parser recognizes constructs such as "cache_store.." in the .cfg file and calls the appropriate methods of the abstractization layer (core), which in turn calls the method of the registered cache system(module). In other words you need to modify the parser to recognize "cache_increment" and "cache_decrement". If you choose this way you must also create appropriate methods in the localcache module or at least place warnings that they are not implemented. There is however a different approach. You can export the 2 functions as you did, but you need to manually search for the server and call the library increment function. Of course the functions will look a little different. They will look like this: int cache_increment (struct sip_msg* msg, char* str1,char * str2 ) { //...some code to find the appropriate handle in "servers" list // you should use fix-up functions if you know how //call the increment method. return 1; // or -1 on error } Hope it helps. -- Andrei Dragus www.voice-system.ro<http://www.voice-system.ro> _______________________________________________ Devel mailing list [email protected]<mailto:[email protected]> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel This mail was received via Mail-SeCure System. This mail was sent via Mail-SeCure System.
_______________________________________________ Devel mailing list [email protected] http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
