<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <blockquote
      cite="mid:e3feca58a6d349c887f23073fa4d0b1f@CM-EX-V01.cm.local"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">The
            Tag column size is 64. If I make this larger in the
            database, will it be truncated once it is loaded into
            memory?</span></p>
      </div>
    </blockquote>
    According to modules source code Tag's max size is hardcoded and
    will be truncated. But this is not a bit problem. You can keep
    capabilities list in htable and only put a key for this htable info
    to the tag.
    <blockquote
      cite="mid:e3feca58a6d349c887f23073fa4d0b1f@CM-EX-V01.cm.local"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Through
            which list do I need to iterate? You mentioned the data is
            stored in a hash table, what is the name of this hash table?</span></p>
      </div>
    </blockquote>
    load_gws() creates a list of gateways and next_gw() fetches them one
    by one.<br>
    After calling load_gws() you can just call next_gw() which puts
    gateways tag to the "tag_avp". If current gateway doesn't have
    requested capabilities just call next_gw() again.<br>
    <blockquote
      cite="mid:e3feca58a6d349c887f23073fa4d0b1f@CM-EX-V01.cm.local"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Basically
            for each call I need to call the load_gws() function, which
            is O(N) * O(M).</span></p>
      </div>
    </blockquote>
    <blockquote
      cite="mid:e3feca58a6d349c887f23073fa4d0b1f@CM-EX-V01.cm.local"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">What
            if I take a different approach and call a stored procedure
            (for each call) which does the selection of a gateway based
            on the supplied criteria.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Of
            course the tables would be optimized with indices for the
            best possible performance.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">When
            comparing load_gws() (O(N) * O(M)) with the stored procedure
            approach, would there be a huge performance loss when taking
            the stored procedure approach?</span></p>
      </div>
    </blockquote>
    Who knows.. You can test it and share results with community :)<br>
    <blockquote
      cite="mid:e3feca58a6d349c887f23073fa4d0b1f@CM-EX-V01.cm.local"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">I
            know this approach brings a whole new set of problem with
            availability and the loss of features, but for now I’m only
            interested in the performance aspect of both methods.<o:p></o:p></span></p>
      </div>
    </blockquote>
    Actually going this way you don't need LCR module at all. You can
    call stored procedure, lua/python/perl/... script, or request an
    external system using radius/xmlrpc. But be careful making blocking
    operations from a script or have enough number of kamailio
    processes. <br>
    <br>
  </body>
</html>