<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
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;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
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;font-family:"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></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;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
devel-bounces@lists.opensips.org [mailto:devel-bounces@lists.opensips.org] <b>On
Behalf Of </b>Abhinav Jha<br>
<b>Subject:</b> Re: [OpenSIPS-Devel] [Memcached module] Adding
cache_increment/cache_decrement methods<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thanks Andrei, <o:p></o:p></p>
<div>
<p class=MsoNormal><o:p> </o:p></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 :)<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'>Abhinav<o:p></o:p></p>
<div>
<p class=MsoNormal>On Mon, Feb 22, 2010 at 4:01 PM, Andrei Dragus <<a
href="mailto:adragus@opensips.org">adragus@opensips.org</a>> wrote:<o:p></o:p></p>
<p class=MsoNormal>Hi there,<o:p></o:p></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 ?<o:p></o:p></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><o:p></o:p></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">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><o:p></o:p></p>
</div>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<p class=MsoNormal><br>
This mail was received via Mail-SeCure System.<o:p></o:p></p>
</div>
</div>
<br><br>
This mail was sent via Mail-SeCure System.<br>
</body>
</html>