[OpenSIPS-Users] combine dialplan and loadbalancer

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Jun 2 20:16:31 CEST 2010


Hi Albert,

you can use (instead of harcoded regexps in script) the dialplan module 
in front of LB for detecting the necessary resource.

Right now, indeed the LB function does not accept the resources list via 
variable, but I can take care of that. What you can do with the current 
code is to use the switch statement:

    dp_translate(....);
    switch ($avp(attrs) ) {
       case "pstn" :
             load_balance("1","pstn");
             break;
        case .....
     }

Regards,
Bogdan

Albert Paijmans wrote:
> Hi,
>
> Is it possible for the Dialplan module and Loadbalancer to work together?
> The loadbalancer 
> tutorial http://www.opensips.org/index.php?n=Resources.DocsTutLoadbalancing is 
> a very small script.
> So for instance a Regular Expression ^883[0-9]{12}.* is given 
> attribute pstn and ^/*68. is media. (this is in Dialplan module)
> In Dialplan (opensips-cp) you can set and modify the attributes, this 
> is with avpops module.
>
> What I am trying to accomplish is a proxy registrar that maintains 
> state with a loadbalancer but sending all calls to Asterisk or Media 
> servers also for nat.
> For usrloc (and db aliasses to) OpenSIPS must check itself and then 
> invite both extensions and send both to a pbx from the loadbalancer set.
>
> I am not sure if this is possible because the loadbalancer tutorial 
> shows  if ($rU=~"^1") {  #looks like a Conference call 
> load_balance("1","conf")
> But could you combine this with Dialplan attributes? So everytime we 
> add a destination set the attribute (usrloc, pstn, media, softswitch) 
> in Dialplan,
> And loadbalancer knows what to do next. This way one could use several 
> distinct destination for attribute.
> The disadvantage of  if ($rU=~"^1") { is that it will becomes a mess 
> once you add to many. With dialplan one can also rewrite and use 
> different dialplans.
>
> So in Dialplan module one sets the following attributes:
> usrloc > local extensions and alias send to a pbx or media server.
> pstn > general pstn 
> media > media servers vm / chat etc
> softswitch > a special pstn destination
> announcements > announcements or something
>
> Any ideas how to set this up?
>
> Thanks 
>
> Albert
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list