<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hello,<br>
    <br>
    <div class="moz-cite-prefix">On 6/19/13 9:29 PM, Daniel W. Graham
      wrote:<br>
    </div>
    <blockquote
      cite="mid:2C3A7EA3B2A07B43B077DB944A00304B06B84B1529@CRM1"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">My kamailio implementation sits in front of
          a group of asterisk servers, when a call comes into kamailio
          it does a series of checks on the location of the src and dst
          to determine if the call is allowed. If the src is PSTN  and
          called user is found in the location table the call is passed
          to an asterisk server for further processing of call
          forwarding options / voicemail / ring time setting etc.
          However if the called account is not found (not currently
          registered) the call is then discarded and voicemail etc can
          never be accessed.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I can add a avp_db_query to fetch user from
          the subscriber table vs location table lookup. Just wondering
          if there are any built in functions or other efficient ways to
          handle this that others are doing.</p>
      </div>
    </blockquote>
    <br>
    sqlops is recommended for sql queries if you are not tied to some
    avp operations.<br>
    <br>
    If you just want to check if the subscriber exists, there is a
    function in auth_db module:<br>
    -
    <a class="moz-txt-link-freetext" href="http://kamailio.org/docs/modules/stable/modules/auth_db.html#idp42920">http://kamailio.org/docs/modules/stable/modules/auth_db.html#idp42920</a><br>
    <br>
    Another one should be in uri_db, available in older versions but not
    that much flexible as the above one.<br>
    <br>
    Cheers,<br>
    Daniel<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 Advanced Training, San Francisco, USA - June 24-27, 2013
  * <a class="moz-txt-link-freetext" href="http://asipto.com/u/katu">http://asipto.com/u/katu</a> *</pre>
  </body>
</html>