Hi Ali,

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 - 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)

Regards,
Bogdan

On 04/05/2012 04:36 PM, Ali Pey wrote:
Hi Sammy,

Thank you for your response but I don't think you understood my question.

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.

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?

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.

Hope I explained it better this time.

Regards,
Ali


On Thu, Apr 5, 2012 at 1:25 AM, SamyGo <govoi...@gmail.com <mailto:govoi...@gmail.com>> wrote:


    Hey,

    I think using this would help

    if( $tU =~ "1234567890")
    {
       $avp(gid) = 1;
    }else if( $tU =~ " 9876543210  "){
        $avp(gid) = 2;
    }
    if (!load_balance("$avp(gid)","transc;pstn")) {
         sl_send_reply("500","Service full");
         exit;
    }

    engage load-balancer
    <http://www.opensips.org/Resources/DocsTutLoadbalancing> to use
    $avp(gid) where group_id=1/2 contains pool of servers serving your
    required destination number!

    I hope this helped.


    BR,
    Sammy.


    On Thu, Apr 5, 2012 at 12:02 AM, Ali Pey <ali...@gmail.com
    <mailto:ali...@gmail.com>> wrote:

        Hello,

        I need to match some destination numbers to specific
        servers. For instance if the call is to 1234567890 go to
        server 1 and if it is to 9876543210 go to server 2, etc.

        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.

        Can I use the dial plan module to lookup the destinations?

        I don't understand the dpid. Do I need a dpid for each number?
        Can all my rows have the same dpid?
        How can I do one look up to see if the dialed number is in the
        dialplan table? It can be hundreds of numbers.

        Regards,
        Ali


        _______________________________________________
        Users mailing list
        Users@lists.opensips.org <mailto:Users@lists.opensips.org>
        http://lists.opensips.org/cgi-bin/mailman/listinfo/users



    _______________________________________________
    Users mailing list
    Users@lists.opensips.org <mailto:Users@lists.opensips.org>
    http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to