load_balancer

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

load_balancer

Miha
Hi,

as I am dealing with opensips for the first time I would ask you for a
little help.
I have installed and configured opensips that works like load_balancer
(http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).

I tested it and works. Than I have created siptrunk and point it to
Opensips. Opensips was balacing the calls to one of the FSs, that I have
set in opensips configuration.

How can I now configure opensips, if the call is made from FS, that
opensips will send it to SBC (from where sip trunk is made), so that the
calls will be working in both direction?


Thanks!

Miha

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: load_balancer

Bogdan-Andrei Iancu-2
Hi Miha,

Well, in your script, when dealing with the initial requests, just look
at the source IP of the INVITEs - if from SBC, do the lb stuff,
otherwise route it back to SBC.
     if (src_ip==11.22.33.44) {
         # do LB
     } else {
          # send to SBC
     }

Regards,
Bogdan

On 04/02/2012 09:30 AM, Miha wrote:

> Hi,
>
> as I am dealing with opensips for the first time I would ask you for a
> little help.
> I have installed and configured opensips that works like load_balancer
> (http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).
>
> I tested it and works. Than I have created siptrunk and point it to
> Opensips. Opensips was balacing the calls to one of the FSs, that I
> have set in opensips configuration.
>
> How can I now configure opensips, if the call is made from FS, that
> opensips will send it to SBC (from where sip trunk is made), so that
> the calls will be working in both direction?
>
>
> Thanks!
>
> Miha
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


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


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: load_balancer

Miha
Hi Bogan,

that is a bit tricky as phones are registering on Opensips server. If I
make this that the phones will not register as FSs servers are on
different ips than SBC.

What would you sugget?

Regards,
Miha

On 4/2/2012 6:30 PM, Bogdan-Andrei Iancu wrote:

> Hi Miha,
>
> Well, in your script, when dealing with the initial requests, just
> look at the source IP of the INVITEs - if from SBC, do the lb stuff,
> otherwise route it back to SBC.
>     if (src_ip==11.22.33.44) {
>         # do LB
>     } else {
>          # send to SBC
>     }
>
> Regards,
> Bogdan
>
> On 04/02/2012 09:30 AM, Miha wrote:
>> Hi,
>>
>> as I am dealing with opensips for the first time I would ask you for
>> a little help.
>> I have installed and configured opensips that works like
>> load_balancer
>> (http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).
>>
>> I tested it and works. Than I have created siptrunk and point it to
>> Opensips. Opensips was balacing the calls to one of the FSs, that I
>> have set in opensips configuration.
>>
>> How can I now configure opensips, if the call is made from FS, that
>> opensips will send it to SBC (from where sip trunk is made), so that
>> the calls will be working in both direction?
>>
>>
>> Thanks!
>>
>> Miha
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: load_balancer

SamyGo
Hi Miha,

I do exactly what Bogdan said, but using DB connecitons. IF its an Initial INVITE connect to DB and query table load_balancer and see if the source ip of INVITE matches any of the load_balanaced FS servers then I know that its from inside-media-serves to outside. 

The next thing is identifying what original destination your FS was trying to send the calls to i.e carrier-ip / uri !

So in your FS dialplan add a sip header where you store the real destination of the SBC/trunk and once you are in the IF condition where you detect your internal FS servers, strip off that header  change the $ru and t-relay the call !!

phone(dial 007@FS )<===> FS (P-Real-DST: CAR.RIE.R.IP & dial 007@OpenSIPS )<====>OpenSIPS([hidden email])<===> ITSP([hidden email] )

I hope this is what you wanted.

Regards,
Sammy

On Wed, Apr 4, 2012 at 11:49 AM, Miha <[hidden email]> wrote:
Hi Bogan,

that is a bit tricky as phones are registering on Opensips server. If I make this that the phones will not register as FSs servers are on different ips than SBC.

What would you sugget?

Regards,
Miha


On 4/2/2012 6:30 PM, Bogdan-Andrei Iancu wrote:
Hi Miha,

Well, in your script, when dealing with the initial requests, just look at the source IP of the INVITEs - if from SBC, do the lb stuff, otherwise route it back to SBC.
   if (src_ip==11.22.33.44) {
       # do LB
   } else {
        # send to SBC
   }

Regards,
Bogdan

On 04/02/2012 09:30 AM, Miha wrote:
Hi,

as I am dealing with opensips for the first time I would ask you for a little help.
I have installed and configured opensips that works like load_balancer (http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).

I tested it and works. Than I have created siptrunk and point it to Opensips. Opensips was balacing the calls to one of the FSs, that I have set in opensips configuration.

How can I now configure opensips, if the call is made from FS, that opensips will send it to SBC (from where sip trunk is made), so that the calls will be working in both direction?


Thanks!

Miha

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: load_balancer

Bogdan-Andrei Iancu-2
In reply to this post by Miha
Hi,

Of course, use the logic I mentioned only for INVITE request, not for
REGISTERs - you can do different routing logics depending on the method.

Regards,
Bogdan

On 04/04/2012 09:49 AM, Miha wrote:

> Hi Bogan,
>
> that is a bit tricky as phones are registering on Opensips server. If
> I make this that the phones will not register as FSs servers are on
> different ips than SBC.
>
> What would you sugget?
>
> Regards,
> Miha
>
> On 4/2/2012 6:30 PM, Bogdan-Andrei Iancu wrote:
>> Hi Miha,
>>
>> Well, in your script, when dealing with the initial requests, just
>> look at the source IP of the INVITEs - if from SBC, do the lb stuff,
>> otherwise route it back to SBC.
>>     if (src_ip==11.22.33.44) {
>>         # do LB
>>     } else {
>>          # send to SBC
>>     }
>>
>> Regards,
>> Bogdan
>>
>> On 04/02/2012 09:30 AM, Miha wrote:
>>> Hi,
>>>
>>> as I am dealing with opensips for the first time I would ask you for
>>> a little help.
>>> I have installed and configured opensips that works like
>>> load_balancer
>>> (http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).
>>>
>>> I tested it and works. Than I have created siptrunk and point it to
>>> Opensips. Opensips was balacing the calls to one of the FSs, that I
>>> have set in opensips configuration.
>>>
>>> How can I now configure opensips, if the call is made from FS, that
>>> opensips will send it to SBC (from where sip trunk is made), so that
>>> the calls will be working in both direction?
>>>
>>>
>>> Thanks!
>>>
>>> Miha
>>>
>>> _______________________________________________
>>> Users mailing list
>>> [hidden email]
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>
>>
>


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


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: load_balancer

Bogdan-Andrei Iancu-2
In reply to this post by SamyGo
Hi Sammy,

I was thinking to simplify a bit this and to add to LB module a function like lb_is_from_peer() , to test if an IP + port matches on of the peers defined in LB...

Regards,
Bogdan

On 04/04/2012 10:23 AM, SamyGo wrote:
Hi Miha,

I do exactly what Bogdan said, but using DB connecitons. IF its an Initial INVITE connect to DB and query table load_balancer and see if the source ip of INVITE matches any of the load_balanaced FS servers then I know that its from inside-media-serves to outside. 

The next thing is identifying what original destination your FS was trying to send the calls to i.e carrier-ip / uri !

So in your FS dialplan add a sip header where you store the real destination of the SBC/trunk and once you are in the IF condition where you detect your internal FS servers, strip off that header  change the $ru and t-relay the call !!

phone(dial 007@FS )<===> FS (P-Real-DST: CAR.RIE.R.IP & dial 007@OpenSIPS )<====>OpenSIPS([hidden email])<===> ITSP([hidden email] )

I hope this is what you wanted.

Regards,
Sammy

On Wed, Apr 4, 2012 at 11:49 AM, Miha <[hidden email]> wrote:
Hi Bogan,

that is a bit tricky as phones are registering on Opensips server. If I make this that the phones will not register as FSs servers are on different ips than SBC.

What would you sugget?

Regards,
Miha


On 4/2/2012 6:30 PM, Bogdan-Andrei Iancu wrote:
Hi Miha,

Well, in your script, when dealing with the initial requests, just look at the source IP of the INVITEs - if from SBC, do the lb stuff, otherwise route it back to SBC.
   if (src_ip==11.22.33.44) {
       # do LB
   } else {
        # send to SBC
   }

Regards,
Bogdan

On 04/02/2012 09:30 AM, Miha wrote:
Hi,

as I am dealing with opensips for the first time I would ask you for a little help.
I have installed and configured opensips that works like load_balancer (http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).

I tested it and works. Than I have created siptrunk and point it to Opensips. Opensips was balacing the calls to one of the FSs, that I have set in opensips configuration.

How can I now configure opensips, if the call is made from FS, that opensips will send it to SBC (from where sip trunk is made), so that the calls will be working in both direction?


Thanks!

Miha

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



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

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: load_balancer

SamyGo

that would be great, in fact I am currently installing latest 1.8 version and I guess I saw these functions appearing somewhere !! - that would really make life easier :)
Thanks Sir. :)

On Wed, Apr 4, 2012 at 1:17 PM, Bogdan-Andrei Iancu <[hidden email]> wrote:
Hi Sammy,

I was thinking to simplify a bit this and to add to LB module a function like lb_is_from_peer() , to test if an IP + port matches on of the peers defined in LB...

Regards,
Bogdan


On 04/04/2012 10:23 AM, SamyGo wrote:
Hi Miha,

I do exactly what Bogdan said, but using DB connecitons. IF its an Initial INVITE connect to DB and query table load_balancer and see if the source ip of INVITE matches any of the load_balanaced FS servers then I know that its from inside-media-serves to outside. 

The next thing is identifying what original destination your FS was trying to send the calls to i.e carrier-ip / uri !

So in your FS dialplan add a sip header where you store the real destination of the SBC/trunk and once you are in the IF condition where you detect your internal FS servers, strip off that header  change the $ru and t-relay the call !!

phone(dial 007@FS )<===> FS (P-Real-DST: CAR.RIE.R.IP & dial 007@OpenSIPS )<====>OpenSIPS([hidden email])<===> ITSP([hidden email] )

I hope this is what you wanted.

Regards,
Sammy

On Wed, Apr 4, 2012 at 11:49 AM, Miha <[hidden email]> wrote:
Hi Bogan,

that is a bit tricky as phones are registering on Opensips server. If I make this that the phones will not register as FSs servers are on different ips than SBC.

What would you sugget?

Regards,
Miha


On 4/2/2012 6:30 PM, Bogdan-Andrei Iancu wrote:
Hi Miha,

Well, in your script, when dealing with the initial requests, just look at the source IP of the INVITEs - if from SBC, do the lb stuff, otherwise route it back to SBC.
   if (src_ip==11.22.33.44) {
       # do LB
   } else {
        # send to SBC
   }

Regards,
Bogdan

On 04/02/2012 09:30 AM, Miha wrote:
Hi,

as I am dealing with opensips for the first time I would ask you for a little help.
I have installed and configured opensips that works like load_balancer (http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).

I tested it and works. Than I have created siptrunk and point it to Opensips. Opensips was balacing the calls to one of the FSs, that I have set in opensips configuration.

How can I now configure opensips, if the call is made from FS, that opensips will send it to SBC (from where sip trunk is made), so that the calls will be working in both direction?


Thanks!

Miha

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



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


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: load_balancer

Bogdan-Andrei Iancu-2
Currently there is no such function in LB (not even in trunk) - I added a "feature request" on tracker, so we will add it in the next versions.

Regards,
Bogdan

On 04/04/2012 12:08 PM, SamyGo wrote:

that would be great, in fact I am currently installing latest 1.8 version and I guess I saw these functions appearing somewhere !! - that would really make life easier :)
Thanks Sir. :)

On Wed, Apr 4, 2012 at 1:17 PM, Bogdan-Andrei Iancu <[hidden email]> wrote:
Hi Sammy,

I was thinking to simplify a bit this and to add to LB module a function like lb_is_from_peer() , to test if an IP + port matches on of the peers defined in LB...

Regards,
Bogdan


On 04/04/2012 10:23 AM, SamyGo wrote:
Hi Miha,

I do exactly what Bogdan said, but using DB connecitons. IF its an Initial INVITE connect to DB and query table load_balancer and see if the source ip of INVITE matches any of the load_balanaced FS servers then I know that its from inside-media-serves to outside. 

The next thing is identifying what original destination your FS was trying to send the calls to i.e carrier-ip / uri !

So in your FS dialplan add a sip header where you store the real destination of the SBC/trunk and once you are in the IF condition where you detect your internal FS servers, strip off that header  change the $ru and t-relay the call !!

phone(dial 007@FS )<===> FS (P-Real-DST: CAR.RIE.R.IP & dial 007@OpenSIPS )<====>OpenSIPS([hidden email])<===> ITSP([hidden email] )

I hope this is what you wanted.

Regards,
Sammy

On Wed, Apr 4, 2012 at 11:49 AM, Miha <[hidden email]> wrote:
Hi Bogan,

that is a bit tricky as phones are registering on Opensips server. If I make this that the phones will not register as FSs servers are on different ips than SBC.

What would you sugget?

Regards,
Miha


On 4/2/2012 6:30 PM, Bogdan-Andrei Iancu wrote:
Hi Miha,

Well, in your script, when dealing with the initial requests, just look at the source IP of the INVITEs - if from SBC, do the lb stuff, otherwise route it back to SBC.
   if (src_ip==11.22.33.44) {
       # do LB
   } else {
        # send to SBC
   }

Regards,
Bogdan

On 04/02/2012 09:30 AM, Miha wrote:
Hi,

as I am dealing with opensips for the first time I would ask you for a little help.
I have installed and configured opensips that works like load_balancer (http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).

I tested it and works. Than I have created siptrunk and point it to Opensips. Opensips was balacing the calls to one of the FSs, that I have set in opensips configuration.

How can I now configure opensips, if the call is made from FS, that opensips will send it to SBC (from where sip trunk is made), so that the calls will be working in both direction?


Thanks!

Miha

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



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



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

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: load_balancer

Miha
Hi @SamyGo and Bodan,

thank you very much for all your help:)

I think I need a bit more reading about opensips configuration. So I will first read few things and that ask questions, I think this would be better:)

Thank you very much for all your help!

Reagrds,
Miha

On 4/4/2012 1:59 PM, Bogdan-Andrei Iancu wrote:
Currently there is no such function in LB (not even in trunk) - I added a "feature request" on tracker, so we will add it in the next versions.

Regards,
Bogdan

On 04/04/2012 12:08 PM, SamyGo wrote:

that would be great, in fact I am currently installing latest 1.8 version and I guess I saw these functions appearing somewhere !! - that would really make life easier :)
Thanks Sir. :)

On Wed, Apr 4, 2012 at 1:17 PM, Bogdan-Andrei Iancu <[hidden email]> wrote:
Hi Sammy,

I was thinking to simplify a bit this and to add to LB module a function like lb_is_from_peer() , to test if an IP + port matches on of the peers defined in LB...

Regards,
Bogdan


On 04/04/2012 10:23 AM, SamyGo wrote:
Hi Miha,

I do exactly what Bogdan said, but using DB connecitons. IF its an Initial INVITE connect to DB and query table load_balancer and see if the source ip of INVITE matches any of the load_balanaced FS servers then I know that its from inside-media-serves to outside. 

The next thing is identifying what original destination your FS was trying to send the calls to i.e carrier-ip / uri !

So in your FS dialplan add a sip header where you store the real destination of the SBC/trunk and once you are in the IF condition where you detect your internal FS servers, strip off that header  change the $ru and t-relay the call !!

phone(dial 007@FS )<===> FS (P-Real-DST: CAR.RIE.R.IP & dial 007@OpenSIPS )<====>OpenSIPS([hidden email])<===> ITSP([hidden email] )

I hope this is what you wanted.

Regards,
Sammy

On Wed, Apr 4, 2012 at 11:49 AM, Miha <[hidden email]> wrote:
Hi Bogan,

that is a bit tricky as phones are registering on Opensips server. If I make this that the phones will not register as FSs servers are on different ips than SBC.

What would you sugget?

Regards,
Miha


On 4/2/2012 6:30 PM, Bogdan-Andrei Iancu wrote:
Hi Miha,

Well, in your script, when dealing with the initial requests, just look at the source IP of the INVITEs - if from SBC, do the lb stuff, otherwise route it back to SBC.
   if (src_ip==11.22.33.44) {
       # do LB
   } else {
        # send to SBC
   }

Regards,
Bogdan

On 04/02/2012 09:30 AM, Miha wrote:
Hi,

as I am dealing with opensips for the first time I would ask you for a little help.
I have installed and configured opensips that works like load_balancer (http://wiki.freeswitch.org/wiki/Enterprise_deployment_OpenSIPS).

I tested it and works. Than I have created siptrunk and point it to Opensips. Opensips was balacing the calls to one of the FSs, that I have set in opensips configuration.

How can I now configure opensips, if the call is made from FS, that opensips will send it to SBC (from where sip trunk is made), so that the calls will be working in both direction?


Thanks!

Miha

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



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



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


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users