<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>you can use sqlops module to load data from database and store in
      an xavp.</p>
    <p>If you want to load from subscriber table along with auth
      credentials, look at load_credentials parameter from auth_db
      module.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 14/10/16 12:05, Ivan Dudko wrote:<br>
    </div>
    <blockquote
cite="mid:CAMY-Hu94NJZ6Yx6+6WX2e96WnqSC9=HgUduD+AZdO5hXTFRDNA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hello!<br>
          <br>
          I am trying to implement limit of active calls for
          subscribers. And for each subscriber this limit must be
          personal.<br>
          <br>
          I find example route in presentation of Daniel-Constantin
          Mierla.<br>
          And i need to set $xavp(caller=>active_calls) = 1;<br>
        </div>
        for each dialog. But i can't understand how to load this number
        of active calls from some-thing similar of user profile or
        subscriber table?<br>
        <div><br>
          route[DIALOG] {<br>
          <br>
              if (is_method("CANCEL") || (has_totag() &&
          is_method("INVITE|BYE|ACK"))) {<br>
                  dlg_manage();<br>
                  return;<br>
              }<br>
          <br>
              if (is_method("INVITE") && !has_totag() &&
          !isflagset(WITH_ACTIVE_CALLS_LIMIT)) {<br>
                  if( $xavp(caller[0]=>active_calls) != $null
          && $xavp(caller[0]=>active_calls) > 0 ) {<br>
                      if(!get_profile_size("caller", "$fU@$fd",
          "$var(acsize)")) {<br>
                          send_reply("500", "No more active calls");<br>
                          exit;<br>
                      }<br>
                     
          if($var(acsize)>=$xavp(caller[0]=>active_calls)) {<br>
                          send_reply("403", "No more active calls");<br>
                          exit;<br>
                      }<br>
                      set_dlg_profile("caller", "$fU@$fd");<br>
                  }<br>
                  setflag(WITH_ACTIVE_CALLS_LIMIT);<br>
                  dlg_manage();<br>
              }<br>
          }<br>
          <br>
          <br>
        </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>
Kamailio Advanced Training, Berlin, Oct 24-26, 2016 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>