<div><div>Sure, I'll attach the patches to this thread shortly. ( after verifying that they work )</div><div><br></div><div>Thanks, </div><div>Abhinav<br><br><div class="gmail_quote">On Wed, Feb 24, 2010 at 2:31 PM, Alex Massover <span dir="ltr"><<a href="mailto:alex@jajah.com">alex@jajah.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I’m also interested in this functionality, would you like to share
it? </span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span style="font-size:11.0pt;color:#1F497D"></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Maybe Andrei will like to apply your patches to the trunk </span><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span><span style="font-size:11.0pt;color:#1F497D"></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt">From:</span></b><span style="font-size:10.0pt">
<a href="mailto:devel-bounces@lists.opensips.org" target="_blank">devel-bounces@lists.opensips.org</a> [mailto:<a href="mailto:devel-bounces@lists.opensips.org" target="_blank">devel-bounces@lists.opensips.org</a>] <b>On
Behalf Of </b>Abhinav Jha<br>
<b>Subject:</b> Re: [OpenSIPS-Devel] [Memcached module] Adding
cache_increment/cache_decrement methods</span></p>
</div>
</div><div><div></div><div class="h5">
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks Andrei, </p>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal">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 :)</p>
</div>
<div>
<p class="MsoNormal"> </p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Abhinav</p>
<div>
<p class="MsoNormal">On Mon, Feb 22, 2010 at 4:01 PM, Andrei Dragus <<a href="mailto:adragus@opensips.org" target="_blank">adragus@opensips.org</a>> wrote:</p>
<p class="MsoNormal">Hi there,</p>
<div>
<p class="MsoNormal"><br>
> 1. cache_fetch, cache_store and cache_remove are not exported by the<br>
> memcached module anywhere. How then are we able to use them from<br>
> opensips.cfg ?</p>
</div>
<p class="MsoNormal"> There is a layer of abstractization called
memcache(in the core)<br>
which can be implemented in two ways "memcached" or
"localcache" (both<br>
are modules). The parser recognizes constructs such as
"cache_store.."<br>
in the .cfg file and calls the appropriate methods of the<br>
abstractization layer (core), which in turn calls the method of the<br>
registered cache system(module).<br>
<br>
In other words you need to modify the parser to recognize<br>
"cache_increment" and "cache_decrement". If you choose this
way you must<br>
also create appropriate methods in the localcache module or at least<br>
place warnings that they are not implemented.<br>
<br>
There is however a different approach. You can export the 2<br>
functions as you did, but you need to manually search for the server and<br>
call the library increment function. Of course the functions will look a<br>
little different. They will look like this:<br>
<br>
int cache_increment (struct sip_msg* msg, char* str1,char * str2 )<br>
{<br>
//...some code to find the appropriate handle in
"servers" list<br>
// you should use fix-up functions if you know how<br>
<br>
//call the increment method.<br>
<br>
return 1; // or -1 on error<br>
}<br>
<br>
Hope it helps.<br>
<br>
--<br>
<span style="color:#888888">Andrei Dragus</span></p>
<div>
<div>
<p class="MsoNormal"><a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
<br>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.opensips.org" target="_blank">Devel@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a></p>
</div>
</div>
</div>
<p class="MsoNormal"> </p>
</div>
</div></div><p class="MsoNormal"><br>
This mail was received via Mail-SeCure System.</p>
</div>
</div>
<br><br>
This mail was sent via Mail-SeCure System.<br>
</div>
<br>_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a><br>
<br></blockquote></div><br></div></div>