<html><head></head><body lang="EN-US" link="#0563C1" vlink="#954F72" style="background-color: rgb(255, 255, 255); line-height: initial;">                                                                                      <div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Ali,</div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">$var variables do not persist outside the scope of the processing of a single SIP message. They live in the private memory of every receiver process.</div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">Take a look at the 'htable' or 'statistics' modules.</div>                                                                                                                                     <div style="width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);"><br style="display:initial"></div>                                                                                                                                     <div style="display:none"></div>                                                              <div style="font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, 255, 255);">--<br>Alex Balashov | Principal | Evariste Systems LLC<br>303 Perimeter Center North, Suite 300<br>Atlanta, GA 30346<br>United States<br><br>Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)<br>Web: http://www.evaristesys.com/, http://www.csrpswitch.com/<br><br>Sent from my BlackBerry.</div>                                                                                                                                                                                  <table width="100%" style="background-color:white;border-spacing:0px;"> <tbody><tr><td colspan="2" style="font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);">                           <div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in; font-family: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;">  <div><b>From: </b>Ali Taher</div><div><b>Sent: </b>Friday, June 19, 2015 09:55</div><div><b>To: </b>'Kamailio (SER) - Users Mailing List'</div><div><b>Reply To: </b>Kamailio (SER) - Users Mailing List</div><div><b>Subject: </b>[SR-Users] Kamailio invite counter</div></div></td></tr></tbody></table><div style="border-style: solid none none; border-top-color: rgb(186, 188, 209); border-top-width: 1pt; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"></div><br><div id="_originalContent" style=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></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]--><div class="WordSection1"><p class="MsoNormal">Hello,<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">I want to define a counter  that increase in every invite.<o:p></o:p></p><p class="MsoNormal">I tried the below :<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">if (is_method("INVITE"))<o:p></o:p></p><p class="MsoNormal">                {      <o:p></o:p></p><p class="MsoNormal">$var(u)=$var(u)+1;<o:p></o:p></p><p class="MsoNormal">xlog("L_INFO","Counter : $var(u) " );<o:p></o:p></p><p class="MsoNormal">}<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">But the counter is reset to 1 randomly (even before restarting kamailio service)<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">How can have a proper counter that count invite messages.<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Thanks<o:p></o:p></p><p class="MsoNormal">Ali<o:p></o:p></p></div><br><!--end of _originalContent --></div></body></html>