[OpenSIPS-Users] Dialplan module and matching numbers
Ali Pey
alipey at gmail.com
Thu Apr 5 15:36:18 CEST 2012
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 <govoiper at 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 <alipey at 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 at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120405/2eb71991/attachment.htm>
More information about the Users
mailing list