<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    set use_domain parameter for avpops:<br>
    <br>
<a class="moz-txt-link-freetext" href="http://kamailio.org/docs/modules/stable/modules/avpops.html#avpops.p.use_domain">http://kamailio.org/docs/modules/stable/modules/avpops.html#avpops.p.use_domain</a><br>
    <br>
    then use<br>
    <br>
    avp_db_load("$ru", ...)<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 27/04/14 05:09, arun Jayaprakash
      wrote:<br>
    </div>
    <blockquote
      cite="mid:1398568197.45339.YahooMailNeo@web161603.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:times
        new roman, new york, times, serif;font-size:12pt">
        <div><span style="font-size: 12pt;">Hello, I have a piece of
            code as follows:</span><br>
        </div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 12pt;">
          <div style="font-family: 'times new roman', 'new york', times,
            serif; font-size: 12pt;">
            <div class="y_msg_container">
              <div id="yiv5057600885">
                <div style="color: rgb(0, 0, 0); background-color:
                  rgb(255, 255, 255); font-family: 'times new roman',
                  'new york', times, serif; font-size: 12pt;">
                  <div><font face="times new roman, new york, times,
                      serif"><br>
                    </font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif">$avp(callfwdcount) = 0;</font></div>
                  <div><font face="times new roman, new york, times,
                      serif">  $avp(dnumber) = $rU;</font></div>
                  <div><font face="times new roman, new york, times,
                      serif">  $var(found) = 0;</font></div>
                  <div><font face="times new roman, new york, times,
                      serif">  while($avp(callfwdcount) < 3) {</font></div>
                  <div><font face="times new roman, new york, times,
                      serif">    if (avp_db_load("$avp(dnumber)",
                      "$avp(callfwd_permanent)"))</font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif">   {</font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif">          .....</font></div>
                  <div style="background-color:transparent;"><font
                      style="color: rgb(0, 0, 0); font-family: 'times
                      new roman', 'new york', times, serif; font-size:
                      16px; font-style: normal;">         </font><span
                      style="background-color:transparent;"><font
                        face="times new roman, new york, times, serif">$avp(dst_number)
                        = $avp(callfwd_permanent); # SET THE CALL
                        FORWARD TO  NUMBER</font></span></div>
                  <div><span style="background-color:transparent;"><br>
                    </span></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif">          ....</font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif">       }</font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif"><br>
                    </font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif">Now this works if this is a single
                      domain set up. I am running a multidomain set up
                      and need to check the domain part to ( $rd ) and
                      if there is match in the database with $rU and $rd
                      then the forward to number needs to be set. Can
                      someone let me know how this can be done?</font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif"><br>
                    </font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif">Thank you,</font></div>
                  <div style="color: rgb(0, 0, 0); font-size: 16px;
                    font-family: 'times new roman', 'new york', times,
                    serif; background-color: transparent; font-style:
                    normal;"><font face="times new roman, new york,
                      times, serif">Arun</font></div>
                  <div style="font-family: 'times new roman', 'new
                    york', times, serif; font-size: 16px; color: rgb(0,
                    0, 0); background-color: transparent; font-style:
                    normal;"><br>
                  </div>
                </div>
              </div>
              <br>
              <br>
            </div>
          </div>
        </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://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>