<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hello,<br>
    <br>
    thanks for troubleshooting further - it looks like an issue, I am
    going to check the sources.<br>
    <br>
    Cheers,<br>
    Daniel<br>
     <br>
    <div class="moz-cite-prefix">On 8/14/13 8:55 PM, Daniel W. Graham
      wrote:<br>
    </div>
    <blockquote
      cite="mid:2C3A7EA3B2A07B43B077DB944A00304B0CB1F85AF2@CRM1"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 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";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Here is the
            debug output:<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">Aug 14 14:47:36
            SIP01 /usr/local/sbin/kamailio[30423]: INFO: <script>:
            Location route<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Aug 14 14:47:36
            SIP01 /usr/local/sbin/kamailio[30423]: ERROR: *** cfgtrace:
            c=[/usr/local/etc/kamailio/kamailio.cfg] l=506 a=16 n=if<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Aug 14 14:47:36
            SIP01 /usr/local/sbin/kamailio[30423]: ERROR: *** cfgtrace:
            c=[/usr/local/etc/kamailio/kamailio.cfg] l=501 a=27
            n=is_subscriber<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Aug 14 14:47:36
            SIP01 /usr/local/sbin/kamailio[30423]: DEBUG: auth_db
            [authdb_mod.c:291]: w_is_subscriber(): uri
            [<a class="moz-txt-link-freetext" href="sip:user2@domain.com">sip:user2@domain.com</a>] table [sip_accounts] flags [1]<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Aug 14 14:47:36
            SIP01 /usr/local/sbin/kamailio[30423]: ERROR: <core>
            [db_ut.c:280]: db_print_columns(): Invalid parameter value<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Aug 14 14:47:36
            SIP01 /usr/local/sbin/kamailio[30423]: ERROR: auth_db
            [authorize.c:97]: fetch_credentials(): failed to query
            database<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 #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b>From:</b>
              <a class="moz-txt-link-abbreviated" href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>
              [<a class="moz-txt-link-freetext" href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>] <b>On
                Behalf Of </b>Daniel W. Graham<br>
              <b>Sent:</b> Wednesday, August 14, 2013 1:06 PM<br>
              <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
              <b>Subject:</b> [SR-Users] is_subscriber function<o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">I
            am having an issue with the is_subscriber function provided
            by auth_db module. What I want to accomplish is: if the call
            is not to a local subscriber then route via LCR. If the call
            is to a local subscriber then route via LOCATION.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">My
            subscriber table is called sip_accounts and I am using
            multidomain so domain is populated in subscriber
            definitions.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">Here
            is my routing block-<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">if
            (!is_subscriber("$ru", "sip_accounts", "1")){<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">                    
            route(LCR);<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">                    
            exit;<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">             
            } else {<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">                    
            route(LOCATION);<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">                    
            exit;<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">                    
            }<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">Call
            always routes via LCR despite calling a local subscriber.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">INVITE
            is correct:<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">INVITE
            <a moz-do-not-send="true" href="sip:user2@domain.com">sip:user2@domain.com</a>
            SIP/2.0.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">From:
            user1 <<a moz-do-not-send="true"
              href="sip:user1@domain.com">sip:user1@domain.com</a>>;tag=520c9f9ade1e7026o0.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New"">To:
            <<a moz-do-not-send="true" href="sip:user2@domain.com">sip:user2@domain.com</a>>.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:9.0pt;font-family:"Courier New"">Any
            ideas or direction where my issue could be?</span><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">-dan<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </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://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>
</pre>
  </body>
</html>