<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Ali,<br>
    <br>
    the dpid is DialPlan ID - the idea is that you can group the rules
    in different sets and use a certain set at a given moment. This dpid
    is linked to the first param of the dp_translate() function&nbsp; - you
    tell to the function which set of rules to use (and only the rules
    from that set will be evaluated for the current translation)<br>
    <br>
    Regards,<br>
    Bogdan<br>
    <br>
    On 04/05/2012 04:36 PM, Ali Pey wrote:
    <blockquote
cite="mid:CA+q4kR+OpNA7Tz5N8V2wh1PsrSpQv_AcDrvU8qn2seeaxNLikQ@mail.gmail.com"
      type="cite">Hi Sammy,
      <div><br>
      </div>
      <div>Thank you for your response but I don't think you understood
        my question.</div>
      <div><br>
      </div>
      <div>As the subject of the thread suggests my question is
        regarding the dialplan module. I don't want to list all hundreds
        of my numbers in my config script and then restart opensips
        every time I need to make a change. I want to use the dialplan
        module to be able to look up numbers or patterns from the
        Database.</div>
      <div><br>
      </div>
      <div>
        <div style="font-family: arial,sans-serif; font-size: 13px;
          background-color: rgb(255, 255, 255);">I just don't understand
          the usage of the dpid filed in the dialplan table. Can all my
          rows in the dialplan table have the same dpid value?</div>
        <div style="font-family: arial,sans-serif; font-size: 13px;
          background-color: rgb(255, 255, 255);"><br>
        </div>
      </div>
      <div style="font-family: arial,sans-serif; font-size: 13px;
        background-color: rgb(255, 255, 255);">Basically I would like to
        use the dialplan module to see if there is a match; if there is
        no match, then use the load balancer module to route the calls.</div>
      <div style="font-family: arial,sans-serif; font-size: 13px;
        background-color: rgb(255, 255, 255);"><br>
      </div>
      <div style="font-family: arial,sans-serif; font-size: 13px;
        background-color: rgb(255, 255, 255);">Hope I explained it
        better this time.</div>
      <div><br>
        Regards,</div>
      <div>Ali</div>
      <div><br>
      </div>
      <div><br>
        <div class="gmail_quote">On Thu, Apr 5, 2012 at 1:25 AM, SamyGo
          <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:govoiper@gmail.com">govoiper@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div><br>
            </div>
            Hey,
            <div><br>
            </div>
            <div>I think using this would help
              <div><br>
              </div>
              <div>if( $tU =~ "1234567890")</div>
              <div>{</div>
              <div>&nbsp; &nbsp;$avp(gid) = 1;</div>
              <div>}else if(&nbsp;$tU =~ "
                9876543210&nbsp;&nbsp;"){</div>
              <div>&nbsp; &nbsp; $avp(gid) = 2;</div>
              <div>}</div>
              <div>if (!load_balance("$avp(gid)","transc;pstn")) {</div>
              <div>&nbsp; &nbsp; &nbsp;sl_send_reply("500","Service full");</div>
              <div>
                &nbsp; &nbsp; &nbsp;exit;</div>
              <div>}</div>
              <div><br>
              </div>
              <div>engage <a moz-do-not-send="true"
                  href="http://www.opensips.org/Resources/DocsTutLoadbalancing"
                  target="_blank">load-balancer</a> to use $avp(gid)
                where group_id=1/2 contains pool of servers serving your
                required destination number!</div>
              <div><br>
              </div>
              <div>I hope this helped.</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>BR,</div>
              <div>Sammy.</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>
                <div class="gmail_quote">
                  <div>
                    <div class="h5">On Thu, Apr 5, 2012 at 12:02 AM, Ali
                      Pey <span dir="ltr">&lt;<a moz-do-not-send="true"
                          href="mailto:alipey@gmail.com" target="_blank">alipey@gmail.com</a>&gt;</span>
                      wrote:<br>
                    </div>
                  </div>
                  <blockquote class="gmail_quote" style="margin: 0pt 0pt
                    0pt 0.8ex; border-left: 1px solid rgb(204, 204,
                    204); padding-left: 1ex;">
                    <div>
                      <div class="h5">Hello,
                        <div><br>
                        </div>
                        <div>I need to match some destination numbers to
                          specific servers.&nbsp;For instance if the call is
                          to 1234567890 go to server 1 and if it is to
                          9876543210 go to server 2, etc.</div>
                        <div><br>
                        </div>
                        <div>The purpose is to look up some numbers or
                          patterns and then route to specific servers
                          and use the load balancer module for any other
                          numbers.</div>
                        <div><br>
                        </div>
                        <div>Can I use the dial plan module to lookup
                          the destinations?</div>
                        <div><br>
                        </div>
                        <div>I don't understand the dpid. Do I need a
                          dpid for each number? Can all my rows have the
                          same dpid?&nbsp;</div>
                        <div>How can I do one look up to see if the
                          dialed number is in the dialplan table? It can
                          be hundreds of numbers.</div>
                        <div><br>
                        </div>
                        <div>Regards,</div>
                        <div>Ali</div>
                        <div><br>
                        </div>
                        <br>
                      </div>
                    </div>
                    _______________________________________________<br>
                    Users mailing list<br>
                    <a moz-do-not-send="true"
                      href="mailto:Users@lists.opensips.org"
                      target="_blank">Users@lists.opensips.org</a><br>
                    <a moz-do-not-send="true"
                      href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                      target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                    <br>
                  </blockquote>
                </div>
                <br>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
  </body>
</html>