<!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">
    Hi Logan,<br>
    <br>
    what are the printed xlogs from your script ? interesting is to see
    the values for $avp(s:cnt) and $avp(s:sim_calls) .<br>
    <br>
    Regards,<br>
    Bogdan<br>
    <br>
    On 03/15/2011 04:15 PM, logan wrote:
    <blockquote cite="mid:e1dc278b-6cdf-ceb7-fbd6-e6ba04288d7e@me.com"
      type="cite">
      <div>
        <p style="margin: 0px; font: 12px Times;">I have a uuid in the
          usr_preferences table set to attribute = sim_calls with value
          = 15 calls allowed but am getting the concurrency limit error
          when 2 calls are up and trying to establish the 3rd call. Can
          anyone help figure out why?</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">Config Snips:</p>
        <p style="margin: 0px; font: 12px Times;">modparam("avpops",
          "avp_table", "usr_preferences")</p>
        <p style="margin: 0px; font: 12px Times;">modparam("avpops",
          "use_domain", 0)</p>
        <p style="margin: 0px; font: 12px Times;">modparam("avpops",
          "uuid_column", "uuid")</p>
        <p style="margin: 0px; font: 12px Times;">modparam("avpops",
          "username_column", "username")</p>
        <p style="margin: 0px; font: 12px Times;">modparam("avpops",
          "domain_column", "domain")</p>
        <p style="margin: 0px; font: 12px Times;">modparam("avpops",
          "attribute_column", "attribute")</p>
        <p style="margin: 0px; font: 12px Times;">modparam("avpops",
          "value_column", "value")</p>
        <p style="margin: 0px; font: 12px Times;">modparam("avpops",
          "type_column", "type")</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">loadmodule "dialog.so"</p>
        <p style="margin: 0px; font: 12px Times;">modparam("dialog",
          "dlg_flag", 4)</p>
        <p style="margin: 0px; font: 12px Times;">modparam("dialog",
          "db_mode", 1)</p>
        <p style="margin: 0px; font: 12px Times;"># TODO: rename profile
          "caller" to something more deliberate</p>
        <p style="margin: 0px; font: 12px Times;">modparam("dialog",
          "profiles_with_value", "caller;carrierin;carrierout")</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;# fetch group the
          user belongs to</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          avp_db_query("select grp from grp where
          username='$avp(s:username)'", "$avp(s:group)");</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          if(avp_check("$avp(s:group)","re/.*/g")) {</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          xlog("L_INFO", "----- user $avp(s:username) belongs to
          $avp(s:group) group\n");</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # find
          out how many calls are allowed, match username to uuid column</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          if(avp_db_load("$avp(s:group)/uuid","$avp(s:sim_calls)")) {</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          xlog("L_INFO", "----- group $avp(s:group) can have max
          $avp(s:sim_calls) calls\n");</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #
          check active calls</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          get_profile_size("caller","$avp(s:group)","$avp(s:cnt)");</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          xlog("L_INFO", "----- currently the group $avp(s:group) has
          $avp(s:cnt) active outgoing calls\n");</p>
        <p style="margin: 0px; font: 12px Times; min-height: 140px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #
          reject if there is more than $sim_calls active calls from this
          user</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          if($avp(s:cnt) &gt;= $avp(s:sim_calls)) {</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; sl_send_reply("486","Concurrency Limit Exceeded");</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; exit;</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
          else {</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; # store dialog on the profile</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          &nbsp; set_dlg_profile("caller","$avp(s:group)");</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else
          {</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          xlog("L_INFO", "----- group $avp(s:group) doesn't have
          sim_calls limit\n");</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
          xlog("L_INFO", "----- user $avp(s:username) doesn't belong to
          any groups\n");</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">root@sip01:~#
          opensipsctl fifo profile_get_values caller</p>
        <p style="margin: 0px; font: 12px Times;">value:: 80 count=2</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">root@sip01:~#
          opensipsctl fifo profile_get_values carrierin</p>
        <p style="margin: 0px; font: 12px Times;">value:: 192.168.1.234
          count=2</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">profile_list_dlgs:</p>
        <p style="margin: 0px; font: 12px Times; min-height: 14px;"><br>
        </p>
        <p style="margin: 0px; font: 12px Times;">opensipsctl fifo
          profile_list_dlgs caller</p>
        <p style="margin: 0px; font: 12px Times;">dialog::&nbsp;
          hash=57:1237628390</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; state:: 4</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; user_flags:: 0</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; timestart::
          1299009653</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; timeout:: 1786844</p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; callid:: <a
              moz-do-not-send="true"
              href="mailto:32d75fda0adefcc6454938161fa8f488@69.25.128.234"><span
                style="text-decoration: underline;">32d75fda0adefcc6454938161fa8f488@192.168.1.234</span></a></span></p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; from_uri:: <a
              moz-do-not-send="true"
              href="mailto:sip%3A%2B16465222041@69.25.128.234"><span
                style="text-decoration: underline;">sip:+16465222041@192.168.1.234</span></a></span></p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; to_uri:: <a
              moz-do-not-send="true"
              href="mailto:sip%3A%2B19194397540@72.15.219.141"><span
                style="text-decoration: underline;">sip:+18642227540@10.1.0.141</span></a></span></p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; caller_tag::
          as303e8090</p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; caller_contact::
            <a moz-do-not-send="true"
              href="mailto:sip%3A%2B16465222041@69.25.128.234"><span
                style="text-decoration: underline;">sip:+16465222041@192.168.1.234</span></a></span></p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; callee_cseq:: 102</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp;
          caller_route_set::&nbsp;</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; caller_bind_addr::
          udp:<a moz-do-not-send="true"
            href="http://72.15.219.141:5060/"><span
              style="text-decoration: underline; color: rgb(20, 56,
              231);">10.1.0.141:5060</span></a></p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; callee_tag::
          as6b251cdf</p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; callee_contact::
            <a moz-do-not-send="true"
              href="mailto:sip%3A9194397540@72.15.219.137"><span
                style="text-decoration: underline;">sip:8642227540@10.1.0.137</span></a></span></p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; caller_cseq:: 102</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp;
          callee_route_set::&nbsp;</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; callee_bind_addr::
          udp:<a moz-do-not-send="true"
            href="http://72.15.219.141:5060/"><span
              style="text-decoration: underline; color: rgb(20, 56,
              231);">10.1.0.141:5060</span></a></p>
        <p style="margin: 0px; font: 12px Times;">dialog::&nbsp;
          hash=1234:1922532974</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; state:: 4</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; user_flags:: 0</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; timestart::
          1299009708</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; timeout:: 1786898</p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; callid:: <a
              moz-do-not-send="true"
              href="mailto:61e4b8a31839e0c311ed482c6453317a@69.25.128.234"><span
                style="text-decoration: underline;">61e4b8a31839e0c311ed482c6453317a@192.168.1.234</span></a></span></p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; from_uri:: <a
              moz-do-not-send="true"
              href="mailto:sip%3A%2B12127858470@69.25.128.234"><span
                style="text-decoration: underline;">sip:+12127858470@192.168.1.234</span></a></span></p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; to_uri:: <a
              moz-do-not-send="true"
              href="mailto:sip%3A%2B19194397540@7215.219.141"><span
                style="text-decoration: underline;">sip:+18642227540@10.1.0.141</span></a></span></p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; caller_tag::
          as7c87f91d</p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; caller_contact::
            <a moz-do-not-send="true"
              href="mailto:sip%3A%2B12127858470@69.25.128.234"><span
                style="text-decoration: underline;">sip:+12127858470@192.168.1.234</span></a></span></p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; callee_cseq:: 102</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp;
          caller_route_set::&nbsp;</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; caller_bind_addr::
          udp:<a moz-do-not-send="true"
            href="http://72.15.219.141:5060/"><span
              style="text-decoration: underline; color: rgb(20, 56,
              231);">10.1.0.141:5060</span></a></p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; callee_tag::
          as7bd2b3e8</p>
        <p style="margin: 0px; font: 12px Times; color: rgb(20, 56,
          231);"><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp; callee_contact::
            <a moz-do-not-send="true"
              href="mailto:sip%3A9194397540@72.15.219.137"><span
                style="text-decoration: underline;">sip:8642227540@10.1.0.137</span></a></span></p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; caller_cseq:: 102</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp;
          callee_route_set::&nbsp;</p>
        <p style="margin: 0px; font: 12px Times;">&nbsp;&nbsp;&nbsp; callee_bind_addr::
          udp:<a moz-do-not-send="true"
            href="http://72.15.219.141:5060/"><span
              style="text-decoration: underline; color: rgb(20, 56,
              231);">10.1.0.141:5060</span></a></p>
      </div>
      <br>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"</pre>
  </body>
</html>