<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Where do you use dlg_manage()? It is not in the route you pasted
    below.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 2/12/13 10:12 AM, Bayram Karagoz
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAEGJRcQLW7G0ePphd8g-V72uMsbmNsyR6UC204EYAmeieCQ0eQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thanks for quick response Daniel,
        <div><br>
        </div>
        <div style="">My kamailio version is 3.2.3 (x86_64/linux) .</div>
        <div style="">I want to use&nbsp;<span
            style="font-family:arial,sans-serif;font-size:13px">dlg_manage()
            before but not sure which side of my call limitation route
            code block.</span></div>
        <div style=""><span
            style="font-family:arial,sans-serif;font-size:13px">can you
            advise me where to use&nbsp;</span><span
            style="font-family:arial,sans-serif;font-size:13px">dlg_manage()
            in my routing?</span></div>
        <div style=""><span
            style="font-family:arial,sans-serif;font-size:13px">here is
            my route block defined below;</span></div>
        <div style=""><br>
        </div>
        <div style=""><br>
        </div>
        <div style="">
          <div>route[QUOTA] {</div>
          <div><br>
          </div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; if (is_method("INVITE") &amp;&amp; $fU ==
            $avp(s:username)) {</div>
          <div><br>
          </div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; avp_db_query("select quota from subscriber where
            username='$avp(s:username)'", "$avp(s:quota)");</div>
          <div><br>
          </div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; $var(SIZE) = 0;</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; get_profile_size("callquota", "$avp(s:username)",
            "$var(SIZE)");</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "CALL_KAMAILIO:Call
            originated from = $fd\n");</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "Active call amount for
            $fU is $var(SIZE) , call-id=$ci, quota=$avp(s:quota)\n");</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; if( $var(SIZE) &gt;= $avp(s:quota) ){</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sl_send_reply("403", "Simultaneous calls
            limit reached");</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xlog("L_INFO", "QUOTA:Limit of $var(SIZE)
            active calls has been reached for user=$avp(s:username),
            call-id=$ci, quota=$avp(s:quota)\n");</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit;</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; set_dlg_profile("callquota","$avp(s:username)");</div>
          <div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
          <div>}</div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2013/2/12 Daniel-Constantin Mierla <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span><br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
              <br>
              what version of kamailio are you using?<br>
              <br>
              State 1 is for dialogs that were not relayed (or they
              haven't received any reply yet). That means you create the
              dialog and don't relay the INVITE. Try to us dlg_manage()
              just before relaying the INVITE.<br>
              <br>
              Cheers,<br>
              Daniel
              <div>
                <div class="h5"><br>
                  <br>
                  <div>On 2/12/13 9:37 AM, Bayram Karagoz wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr">Hi,
                      <div><br>
                      </div>
                      <div>is there any advise about my problem?</div>
                      <div>I'm using kamailio in my production
                        environment and this issue started to reproduce
                        a lot.</div>
                      <div>is there any way to discard retransmitted
                        INVITE messages from counting dialog?</div>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">2013/2/9 Bayram Karagoz <span
                          dir="ltr">&lt;<a moz-do-not-send="true"
                            href="mailto:karagoz.bayram@gmail.com"
                            target="_blank">karagoz.bayram@gmail.com</a>&gt;</span><br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div dir="ltr">
                            <div>thanks for the response Daniel,</div>
                            <div><br>
                            </div>
                            has_totag not solved my problem.
                            <div><br>
                            </div>
                            <div>in a deep search I realized that these
                              retransmission INVITE dialogs are waiting
                              in dialog list as state = 1. one example
                              is below;</div>
                            <div>is there any way to clear these dialog
                              which state is waiting for state = 1 or
                              any other solution is welcome for me?</div>
                            <div><br>
                            </div>
                            <div>
                              <div>dialog:: &nbsp;hash=246:499719317</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; state:: 1</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; ref_count:: 1</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; timestart:: 0</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; timeout:: 0</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; callid:: <a
                                  moz-do-not-send="true"
                                  href="mailto:1356619-3569384775-474862@GBSBC-1.mydomain.com"
                                  target="_blank">1356619-3569384775-474862@GBSBC-1.mydomain.com</a></div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; from_uri:: sip:<a
                                  moz-do-not-send="true"
                                  href="tel:02165151057"
                                  value="+902165151057" target="_blank">02165151057</a>@xxx.xxx.xxx.xxx</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; from_tag:: 3569384775-474868</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; caller_contact:: sip:<a
                                  moz-do-not-send="true"
                                  href="tel:02165151057"
                                  value="+902165151057" target="_blank">02165151057</a>@xxx.xxx.xxx.xxx:5060</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; caller_cseq:: 2</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; caller_route_set::&nbsp;</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; caller_bind_addr:: <a
                                  moz-do-not-send="true">udp:xxx.xxx.xxx.xxx:5060</a></div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; callee_bind_addr::&nbsp;</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; to_uri:: <a
                                  moz-do-not-send="true">sip:4115667@xxx.xxx.xxx.xxx</a></div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; to_tag::&nbsp;</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; callee_contact::&nbsp;</div>
                              <div> &nbsp; &nbsp; &nbsp; &nbsp; callee_cseq::&nbsp;</div>
                              <div>&nbsp; &nbsp; &nbsp; &nbsp; callee_route_set::&nbsp;</div>
                              <div><br>
                              </div>
                            </div>
                            <div><br>
                            </div>
                          </div>
                          <div class="gmail_extra">
                            <div>
                              <div><br>
                                <br>
                                <div class="gmail_quote">2013/2/4 Daniel
                                  Tryba <span dir="ltr">&lt;<a
                                      moz-do-not-send="true"
                                      href="mailto:daniel@pocos.nl"
                                      target="_blank">daniel@pocos.nl</a>&gt;</span><br>
                                  <blockquote class="gmail_quote"
                                    style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex">
                                    <div>On Sunday 03 February 2013
                                      12:58:02 Bayram Karagoz wrote:<br>
                                      &gt; I'm trying to limit all
                                      subscriber's active call according
                                      to setting their<br>
                                      &gt; simultaneous use setting
                                      defined in database.<br>
                                      &gt; But having problem when one
                                      subscriber's INVITE message goes
                                      to<br>
                                      &gt; retransmission. When
                                      retranmission occures INVITE
                                      messages don't complete<br>
                                      &gt; with BYE and subscriber
                                      simultaneus use amount will hung.<br>
                                      &gt; My example code block is
                                      below.<br>
                                      &gt; Does anyone advice me for
                                      overcome INVITE retransmissions?<br>
                                      <br>
                                    </div>
                                    I haven't implemented it myself yet,
                                    but all examples I've seen check for<br>
                                    !has_totag() in the INVITE when
                                    doing call limit accounting. So<br>
                                    if (is_method("INVITE") &amp;&amp;
                                    $fU == $avp(s:username) &amp;&amp;
                                    !has_totag())<br>
                                    in your case. But that only works if
                                    the device received the initial 100<br>
                                    Trying with a tag from Kamailio.<br>
                                    <br>
                                    But might it not be better to just
                                    do the count in the INVITE and<br>
                                    adding/deleting of dialogs in the
                                    dialog event routes?<br>
                                    <a moz-do-not-send="true"
href="http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2556156"
                                      target="_blank">http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2556156</a><br>
                                    Problem here is that if the limit is
                                    5 and and there are more than 5<br>
                                    concurrent INVITES you'd have to
                                    drop calls with a 200 OK response.<br>
                                    <span><font color="#888888"><br>
                                        --<br>
                                        <br>
                                        POCOS B.V. - Croy 9c - 5653 LC
                                        Eindhoven<br>
                                        Telefoon: 040 293 8661 - Fax:
                                        040 293 8658<br>
                                        <a moz-do-not-send="true"
                                          href="http://www.pocos.nl/"
                                          target="_blank">http://www.pocos.nl/</a>
                                        &nbsp; - <a moz-do-not-send="true"
                                          href="http://www.sipo.nl/"
                                          target="_blank">http://www.sipo.nl/</a><br>
                                        K.v.K. Eindhoven 17097024<br>
                                      </font></span></blockquote>
                                </div>
                                <br>
                                <br clear="all">
                                <div><br>
                                </div>
                              </div>
                            </div>
                            <span><font color="#888888">-- <br>
                                <div>
                                  <div style="font-weight:bold"><b
                                      style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><font
                                        size="3"><font face="Calibri">Bayram
                                          KARAG&Ouml;Z</font></font></b></div>
                                </div>
                                <div style="font-weight:bold">
                                  <p
                                    style="color:rgb(34,34,34);font-size:13px;margin:0cm
                                    0cm
                                    0pt;font-family:arial,sans-serif;font-weight:normal"><b><font
                                        size="3"><font face="Calibri">NGN
                                          Engineer</font></font></b></p>
                                  <p
                                    style="color:rgb(34,34,34);font-size:13px;margin:0cm
                                    0cm
                                    0pt;font-family:arial,sans-serif;font-weight:normal"><b><font
                                        size="3"><font face="Calibri">-----------------------------------------</font></font></b></p>
                                  <p
                                    style="color:rgb(34,34,34);font-size:13px;margin:0cm
                                    0cm
                                    0pt;font-family:arial,sans-serif;font-weight:normal"><font
                                      face="Calibri"><b><span
                                          style="color:rgb(31,73,125);font-size:14pt">@</span></b><font
                                        size="3">&nbsp;&nbsp;&nbsp;</font></font><a
                                      moz-do-not-send="true"
                                      href="mailto:bayram@bayramkaragoz.org"
style="background-color:transparent" target="_blank">bayram@bayramkaragoz.org</a></p>
                                  <p
                                    style="color:rgb(34,34,34);font-size:13px;margin:0cm
                                    0cm
                                    0pt;font-family:arial,sans-serif;font-weight:normal"><b><span
style="font-family:Wingdings;color:rgb(31,73,125);font-size:14pt">:</span></b><font
                                      face="Calibri"><b><span
                                          style="font-size:14pt">&nbsp;&nbsp;</span></b></font><a
                                      moz-do-not-send="true"
                                      href="http://www.bayramkaragoz.org/"
style="font-weight:bold;background-color:transparent" target="_blank">www.bayramkaragoz.org</a></p>
                                  <p
                                    style="color:rgb(34,34,34);font-size:13px;margin:0cm
                                    0cm
                                    0pt;font-family:arial,sans-serif;font-weight:normal"><b><font
                                        size="3"><font face="Calibri">-----------------------------------------</font></font></b></p>
                                </div>
                              </font></span></div>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br>
                      <div>
                        <div style="font-weight:bold"><b
                            style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><font
                              size="3"><font face="Calibri">Bayram
                                KARAG&Ouml;Z</font></font></b></div>
                      </div>
                      <div style="font-weight:bold">
                        <p
                          style="color:rgb(34,34,34);font-size:13px;margin:0cm
                          0cm
                          0pt;font-family:arial,sans-serif;font-weight:normal"><b><font
                              size="3"><font face="Calibri">NGN Engineer</font></font></b></p>
                        <p
                          style="color:rgb(34,34,34);font-size:13px;margin:0cm
                          0cm
                          0pt;font-family:arial,sans-serif;font-weight:normal"><b><font
                              size="3"><font face="Calibri">-----------------------------------------</font></font></b></p>
                        <p
                          style="color:rgb(34,34,34);font-size:13px;margin:0cm
                          0cm
                          0pt;font-family:arial,sans-serif;font-weight:normal"><font
                            face="Calibri"><b><span
                                style="color:rgb(31,73,125);font-size:14pt">@</span></b><font
                              size="3">&nbsp;&nbsp;&nbsp;</font></font><a
                            moz-do-not-send="true"
                            href="mailto:bayram@bayramkaragoz.org"
                            style="background-color:transparent"
                            target="_blank">bayram@bayramkaragoz.org</a></p>
                        <p
                          style="color:rgb(34,34,34);font-size:13px;margin:0cm
                          0cm
                          0pt;font-family:arial,sans-serif;font-weight:normal"><b><span
style="font-family:Wingdings;color:rgb(31,73,125);font-size:14pt">:</span></b><font
                            face="Calibri"><b><span
                                style="font-size:14pt">&nbsp;&nbsp;</span></b></font><a
                            moz-do-not-send="true"
                            href="http://www.bayramkaragoz.org/"
                            style="font-weight:bold;background-color:transparent"
                            target="_blank">www.bayramkaragoz.org</a></p>
                        <p
                          style="color:rgb(34,34,34);font-size:13px;margin:0cm
                          0cm
                          0pt;font-family:arial,sans-serif;font-weight:normal"><b><font
                              size="3"><font face="Calibri">-----------------------------------------</font></font></b></p>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span class="HOEnZb"><font color="#888888">
</font></span></pre>
                <span class="HOEnZb"><font color="#888888"> </font></span></blockquote>
              <span class="HOEnZb"><font color="#888888"> <br>
                  <pre cols="72">-- 
Daniel-Constantin Mierla - <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a moz-do-not-send="true" href="http://twitter.com/#%21/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
 - <a moz-do-not-send="true" href="http://conference.kamailio.com" target="_blank">http://conference.kamailio.com</a> -</pre>
                </font></span></div>
            <br>
            _______________________________________________<br>
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
            mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
              target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div>
          <div style="font-weight:bold"><b
              style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px"><font
                size="3"><font face="Calibri">Bayram KARAG&Ouml;Z</font></font></b></div>
        </div>
        <div style="font-weight:bold">
          <p
            style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;font-weight:normal;background-color:rgb(255,255,255);margin:0cm
            0cm 0pt"><b><font size="3"><font face="Calibri">NGN Engineer</font></font></b></p>
          <p
            style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;font-weight:normal;background-color:rgb(255,255,255);margin:0cm
            0cm 0pt"><b><font size="3"><font face="Calibri">-----------------------------------------</font></font></b></p>
          <p
            style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;font-weight:normal;background-color:rgb(255,255,255);margin:0cm
            0cm 0pt"><font face="Calibri"><b><span
                  style="color:rgb(31,73,125);font-size:14pt">@</span></b><font
                size="3">&nbsp;&nbsp;&nbsp;</font></font><a moz-do-not-send="true"
              href="mailto:bayram@bayramkaragoz.org"
              style="background-color:transparent" target="_blank">bayram@bayramkaragoz.org</a></p>
          <p
            style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;font-weight:normal;background-color:rgb(255,255,255);margin:0cm
            0cm 0pt"><b><span
                style="font-family:Wingdings;color:rgb(31,73,125);font-size:14pt">:</span></b><font
              face="Calibri"><b><span style="font-size:14pt">&nbsp;&nbsp;</span></b></font><a
              moz-do-not-send="true"
              href="http://www.bayramkaragoz.org/"
              style="font-weight:bold;background-color:transparent"
              target="_blank">www.bayramkaragoz.org</a></p>
          <p
            style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;font-weight:normal;background-color:rgb(255,255,255);margin:0cm
            0cm 0pt"><b><font size="3"><font face="Calibri">-----------------------------------------</font></font></b></p>
        </div>
      </div>
    </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>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, April 16-17, 2013, Berlin
 - <a class="moz-txt-link-freetext" href="http://conference.kamailio.com">http://conference.kamailio.com</a> -</pre>
  </body>
</html>