<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I don't use cnxcc module, but try with debug=3 in kamailio.cfg and
    look at syslog messages, maybe you get a hint of what is happening.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 22/09/15 16:29, Максим Панчоха
      wrote:<br>
    </div>
    <blockquote
cite="mid:CANgLNgxU-A_fOMjnbmoSbktO-LV+PzxncJ_P1EpCdLHNjE4nNw@mail.gmail.com"
      type="cite">
      <div dir="ltr"><span style="font-size:12.8000001907349px">Hello!</span>
        <div style="font-size:12.8000001907349px">I'm trying to set max
          call duration, but after 5 seconds call is continues.</div>
        <div style="font-size:12.8000001907349px">Kamailio
          version: 4.3.2<br>
          Here's part of my config file:</div>
        <div style="font-size:12.8000001907349px"><br>
        </div>
        <div style="font-size:12.8000001907349px"><span
            style="font-size:12.8000001907349px">#!define CC_FLAG 29</span><br>
        </div>
        <div style="font-size:12.8000001907349px"><span
            style="font-size:12.8000001907349px">...</span></div>
        <div style="font-size:12.8000001907349px">
          <div style="font-size:12.8000001907349px">modparam("cnxcc",
            "credit_check_period", 1)</div>
          <div><span style="font-size:12.8000001907349px">modparam("cnxcc",
              "redis", "addr=127.0.0.1;port=6379;db=1")</span><br>
          </div>
        </div>
        <div style="font-size:12.8000001907349px"><br>
        </div>
        <div style="font-size:12.8000001907349px">
          <div>modparam("dialog", "hash_size", 2048)</div>
          <div>modparam("dialog", "default_timeout", 3600)</div>
          <div>modparam("dialog", "db_mode", 0)</div>
          <div>modparam("dialog", "dlg_flag", DLG_FLAG)</div>
        </div>
        <div style="font-size:12.8000001907349px">...</div>
        <div style="font-size:12.8000001907349px">
          <div>if ((is_method("INVITE")) && (is_request())
            && (!has_totag())) {</div>
          <div>    route(CNXCC);</div>
          <div>}</div>
        </div>
        <div style="font-size:12.8000001907349px">
          <div>route[CNXCC]</div>
          <div>{</div>
          <div>        setflag(DLG_FLAG);</div>
          <div>        if (!is_method("INVITE"))</div>
          <div>                        return;</div>
          <div><br>
          </div>
          <div>        $var(client)         = $fU;</div>
          <div>        $var(max_time)  = 5;</div>
          <div><br>
          </div>
          <div>        if (!cnxcc_set_max_time("$var(client)",
            "$var(max_time)")) {</div>
          <div>                xlog("Error setting up credit control");</div>
          <div>                return;</div>
          <div>        }</div>
          <div>}</div>
        </div>
        <div style="font-size:12.8000001907349px"><br>
        </div>
        <div style="font-size:12.8000001907349px">
          <div style="font-size:12.8000001907349px">event_route[dialog:failed]
            {</div>
          <div style="font-size:12.8000001907349px">       
            xlog("L_INFO", "********END
            CALL*********$DLG_lifetime*******************");</div>
          <div style="font-size:12.8000001907349px">}</div>
          <div style="font-size:12.8000001907349px"><br>
          </div>
          <div style="font-size:12.8000001907349px">event_route[dialog:end]
            {</div>
          <div style="font-size:12.8000001907349px">       
            xlog("L_INFO", "******END
            CALL************$DLG_lifetime****************");</div>
          <div style="font-size:12.8000001907349px">}</div>
          <div style="font-size:12.8000001907349px"><br>
          </div>
          <div style="font-size:12.8000001907349px">event_route[dialog:start]
            {</div>
          <div style="font-size:12.8000001907349px">       
            xlog("L_INFO", "***********************DIALOG
            STARTED****************************");</div>
          <div style="font-size:12.8000001907349px">}</div>
          <div style="font-size:12.8000001907349px"><br>
          </div>
          <div>
            <div><span style="font-size:12.8000001907349px">event_route[cnxcc:call-shutdown]</span></div>
            <div><span style="font-size:12.8000001907349px">{</span></div>
            <div><span style="font-size:12.8000001907349px">       
                $var(duration)  = $TS - $dlg(start_ts);</span></div>
            <div><span style="font-size:12.8000001907349px">       
                xlog("L_INFO", *****END CALL***BALANCE IS
                EMPTY************$var(duration)*************");</span></div>
            <div><span style="font-size:12.8000001907349px">}</span></div>
          </div>
          <div style="font-size:12.8000001907349px"><br>
          </div>
        </div>
        <div style="font-size:12.8000001907349px"><br>
        </div>
        <div style="font-size:12.8000001907349px">Tell me please, where
          I made a mistake.</div>
        <div style="font-size:12.8000001907349px">Thank you for a
          response.</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a 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 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>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a></pre>
  </body>
</html>