<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
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";
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@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]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>is_subscriber in auth_db module was exactly what I was looking for. However it doesn’t look like my version has it, I’m on 3.3.x branch-<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>0(7535) ERROR: <core> [cfg.y:3455]: cfg. parser: failed to find command is_subscriber<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'> 0(7535) : <core> [cfg.y:3594]: parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 386, column 48: unknown command, missing loadmodule?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Is this only available on 4.x?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks for the info on sqlops, I will keep that in mind.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>-dan<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] <b>On Behalf Of </b>Daniel-Constantin Mierla<br><b>Sent:</b> Wednesday, June 19, 2013 6:29 PM<br><b>To:</b> Kamailio (SER) - Users Mailing List<br><b>Subject:</b> Re: [SR-Users] Local subscriber lookup / usrloc<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hello,<o:p></o:p></p><div><p class=MsoNormal>On 6/19/13 9:29 PM, Daniel W. Graham wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><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.<o:p></o:p></p></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><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 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><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>Daniel-Constantin Mierla - <a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre><pre><a href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre><pre>Kamailio Advanced Training, San Francisco, USA - June 24-27, 2013<o:p></o:p></pre><pre>  * <a href="http://asipto.com/u/katu">http://asipto.com/u/katu</a> *<o:p></o:p></pre></div></body></html>