<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello Stefan,<br>
    <br>
    <br>
    On 3/14/11 11:03 AM, Stefan Tiedje wrote:
    <blockquote
cite="mid:78A68DD4B55ABD4CA9283A34B9AB60341048788F88@ESESSCMS0355.eemea.ericsson.se"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta content="MSHTML 6.00.6001.18565" name="GENERATOR">
      <div dir="ltr" align="left"><span class="131233009-14032011"><font
            size="2" color="#0000ff" face="Arial">Thanks for the answer.</font></span></div>
      <div dir="ltr" align="left"><span class="131233009-14032011"></span>&nbsp;</div>
      <div dir="ltr" align="left"><span class="131233009-14032011"><font
            size="2" color="#0000ff" face="Arial">Maybe I have some
            older versions of the OPENSER-MIB and the other related
            MIB's since I could not find the counter you pointed at. I'm
            using a MIB browser for reading the MIB's.</font></span></div>
      <div dir="ltr" align="left"><span class="131233009-14032011"><font
            size="2" color="#0000ff" face="Arial">Is the suggested
            counter "expired dialogs" added in a specific release of
            Kamailio? Which? We use Kamailio 3.0.2.</font></span></div>
    </blockquote>
    I used Kamailio and recommend using it sine it has the latest
    commits for stability.<br>
    <br>
    However, what I wrote before is pretty much not related to the
    version. There is a counter that tracks the processed dialogs, but
    seems it is not exported by default through snmpstats module. The
    statistics counter is named "processed_dialogs", implemented by
    dialog module.<br>
    <br>
    You can dump all internal statistics through kamctl or via xmlrpc
    command, but probably to export it through snmpstats you may need to
    extend the mibs and the code of the module.<br>
    <br>
    I just grepped the sources of snmpstats module to see what dialog
    statistics it is exporting:<br>
    <br>
    $ grep -n _dialogs modules_k/snmpstats/* | grep get_statistic<br>
    modules_k/snmpstats/alarm_checks.c:83:&nbsp;&nbsp;&nbsp; num_dialogs =
    get_statistic("active_dialogs");<br>
    modules_k/snmpstats/snmpObjects.c:404:&nbsp;&nbsp;&nbsp; int result =
    get_statistic("active_dialogs");<br>
    modules_k/snmpstats/snmpObjects.c:424:&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    get_statistic("active_dialogs") -<br>
    modules_k/snmpstats/snmpObjects.c:425:&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    get_statistic("early_dialogs");<br>
    modules_k/snmpstats/snmpObjects.c:443:&nbsp;&nbsp;&nbsp; int result =
    get_statistic("early_dialogs");<br>
    modules_k/snmpstats/snmpObjects.c:459:&nbsp;&nbsp;&nbsp; int result =
    get_statistic("failed_dialogs");<br>
    modules_k/snmpstats/snmpObjects.c:508:&nbsp;&nbsp;&nbsp; int num_dialogs =
    get_statistic("active_dialogs");<br>
    <br>
    Perhaps when the snmpstats was developed the dialog module didn't
    export the statistics counter of "processed_dialogs" and then it was
    not updated.<br>
    <br>
    Now, what I tried to say is that if the "processed_dialogs" counter
    is not available through snmpstats (and it is not now after grepping
    the sources) you can get its value from another application through
    "kamctl get_statistics all" or XMLRPC command for all of the
    existing kamailio releases. Upcoming one we will look to implement
    the export through snmpstats as well. If you have time to do it and
    send us a patch, we will gladly commit it to source tree in our GIT
    repository.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <blockquote
cite="mid:78A68DD4B55ABD4CA9283A34B9AB60341048788F88@ESESSCMS0355.eemea.ericsson.se"
      type="cite">
      <div dir="ltr" align="left"><span class="131233009-14032011"></span>&nbsp;</div>
      <div dir="ltr" align="left"><span class="131233009-14032011"><font
            size="2" color="#0000ff" face="Arial">Do you have the MIB
            name for the "expired dialogs" counter. I will look for that
            in my version of OPENSER MIBS.</font></span></div>
      <div dir="ltr" align="left"><span class="131233009-14032011"><font
            size="2" color="#0000ff" face="Arial">Important, do you have
            a link to where MIB files can be downloaded for Kamailio
            3.0.2?</font></span></div>
      <div dir="ltr" align="left"><span class="131233009-14032011"></span>&nbsp;</div>
      <div dir="ltr" align="left"><span class="131233009-14032011"><font
            size="2" color="#0000ff" face="Arial">Below follows an
            excerp from one of the MIB's. Is it old, I don't know?</font></span></div>
      <div dir="ltr" align="left"><span class="131233009-14032011"></span>&nbsp;</div>
      <div dir="ltr" align="left"><span class="131233009-14032011"><span
            lang="SV">
            <p>--
              ***********************************************************************</p>
            <p>-- OPENSER-MIB: OPENSER MIB</p>
            <p>--</p>
            <p>-- Date of Creation: Januay 2006</p>
            <p>--</p>
            <p>-- This MIB provides information related to the OpenSER
              SIP Router.</p>
            <p>-- </p>
            <p>-- Copyright (c) The Internet Society (2006)</p>
            <p>-- Ammendments (c) Soma Networks, Inc. (2006)</p>
            <p>--</p>
            <p>-- All rights reserved.</p>
            <p>--
              *****************************************************************</p>
          </span></span></div>
      <div dir="ltr" align="left"><span class="131233009-14032011"></span>&nbsp;</div>
      <div dir="ltr" align="left"><span class="131233009-14032011"><font
            size="2" color="#0000ff" face="Arial">/Stefan</font></span></div>
      <div dir="ltr" align="left"><span class="131233009-14032011"><font
            size="2" color="#0000ff" face="Arial">&nbsp;</font></span></div>
      <br>
      <div class="OutlookMessageHeader" dir="ltr" align="left"
        lang="en-us">
        <hr tabindex="-1">
        <font size="2" face="Tahoma"><b>From:</b> Daniel-Constantin
          Mierla [<a class="moz-txt-link-freetext" href="mailto:miconda@gmail.com">mailto:miconda@gmail.com</a>] <br>
          <b>Sent:</b> den 14 mars 2011 10:16<br>
          <b>To:</b> Stefan Tiedje<br>
          <b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
          <b>Subject:</b> Re: [SR-Users] OPENSER MIB<br>
        </font><br>
      </div>
      Hello,<br>
      <br>
      On 3/14/11 9:42 AM, Stefan Tiedje wrote:
      <blockquote
cite="mid:78A68DD4B55ABD4CA9283A34B9AB60341048788E56@ESESSCMS0355.eemea.ericsson.se"
        type="cite">
        <meta content="Microsoft Exchange Server" name="Generator">
        <!-- converted from rtf -->
        <style>.EmailQuote {
        PADDING-LEFT: 4pt; MARGIN-LEFT: 1pt; BORDER-LEFT: #800000 2px solid
}
</style> <font size="2" face="Arial, sans-serif"> </font>
        <div><font size="2" face="Arial, sans-serif">Hi,</font></div>
        <font size="2" face="Arial, sans-serif"> </font>
        <div><font size="2" face="Arial, sans-serif">&nbsp;</font></div>
        <font size="2" face="Arial, sans-serif"> </font>
        <div><font size="2" face="Arial, sans-serif">In the Kamailio
            OPENSER-MIB there is the counter
            "openserTotalNumFailedDialogSetups". This is a Counter32.</font></div>
        <font size="2" face="Arial, sans-serif"> </font>
        <div><font size="2" face="Arial, sans-serif">The description is:</font></div>
        <font size="2" face="Arial, sans-serif"> </font>
        <div><font size="2" face="Arial, sans-serif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "The total
            number of calls that failed with an error. The following
            codes define a failed call:" </font></div>
        <font size="2" face="Arial, sans-serif"> </font>
        <div><font size="2" face="Arial, sans-serif">&nbsp;</font></div>
        <font size="2" face="Arial, sans-serif"> </font>
        <div><font size="2" face="Arial, sans-serif"><b>Question:</b></font></div>
        <font size="2" face="Arial, sans-serif"> </font>
        <ul style="margin-top: 0pt; margin-bottom: 0pt; margin-left:
          19pt;">
          <font size="2" face="Arial, sans-serif">
            <li>I'm looking for the corresponding counter to
              "openserTotalNumFailedDialogSetups" who counts successful
              Dialog setups of Counter32 type. Does it exist? </li>
            <li>If not, does it exist a work around? </li>
            <li>Where in the code can the new suggested counter be
              added? </li>
            <li>Something else???? </li>
          </font>
        </ul>
      </blockquote>
      <br>
      the dialog module counts the number of processed dialogs, see:<br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2966360">http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2966360</a><br>
      <br>
      There is no counter currently inside dialog module exporting
      exactly the number of successfully setup dialogs, it should not be
      hard to do it, though. Using the above and the number of failed
      and expired dialogs, you can actually get the number of successful
      dialogs.<br>
      <br>
      Dialog module being the one that tracks SIP dialogs, therefore
      being able to count them, now I don't know if snmpstats module
      exports all the counters from dialog module. I setup snmpstats
      just few weeks ago and works perfect on Ubuntu/Debian servers, but
      I had no need to check dialog module counters.<br>
      <br>
      Note that you can get the list of all internal statistics via
      kamctl:<br>
      - kamctl fifo get_statistics all<br>
      <br>
      Or via XMLRPC if you need them remotely in another application.<br>
      <br>
      Another option is to define your statistics with statistics
      module. Knowing that in SIP a successful call dialog means 200ok
      reply to an INVITE transaction, you can count it in the
      onreply_route[abc] that you arm for relayed transactions with
      t_on_reply("abc").<br>
      <br>
      Hope these help you,<br>
      Daniel<br>
      <br>
      <blockquote
cite="mid:78A68DD4B55ABD4CA9283A34B9AB60341048788E56@ESESSCMS0355.eemea.ericsson.se"
        type="cite"><font size="2" face="Arial, sans-serif">
          <div>&nbsp;</div>
          <div>Suggestion for the new counter is a name like:
            "openserTotalNumSucceededDialogSetups". It has a counter32.
            Description: "The total number of calls that succeeded" </div>
          <div>&nbsp;</div>
          <div>I know that there are the counters openserCurNumDialogs,
            openserCurNumDialogsInProgress and
            openserCurNumDialogsInSetup but these are of Gauge type who
            only reflects the current situation. These Gauge counters
            can't be used together with a Counter32 counter. That don't
            mix. The calculation done for the counter
            "openserCurNumDialogsInProgress" should be used where every
            new dialog setup is added to the new suggested counter. A
            counter of 32 should cover a great deal of connections.
            These counters are usually read, if used, every 15 minutes
            or 1 hour.</div>
          <div>&nbsp;</div>
          <div>&nbsp;</div>
          <div><b>Rationale:</b></div>
          <div>The reason for the new counter is that a calculation
            between succeeded and failed dialog setups can be done and
            be used for SLA agreements. Without this, its hard to make
            any customer versus provider agreements.</div>
          <div>&nbsp;</div>
          <div>&nbsp;</div>
          <div>/Stefan</div>
          <div>PS. Ask if anything is unclear and I need an answer
            rapidly.</div>
          <div>&nbsp;</div>
        </font>
        <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>