Resources.DocsTutLoadbalancing History

Hide minor edits - Show changes to markup

April 24, 2013, at 07:59 PM by 213.233.101.41 -
Changed lines 1-927 from:

Resources -> Documentation -> Tutorials -> Load Balancing

This page has been visited 7552 times. (:toc-float Table of Content:)


This tutorial applies for OpenSIPS versions 1.5, 1.6, 1.7 .

Load Balancing in OpenSIPS

The "load-balancing" module comes to provide traffic routing based on load. Shortly, when OpenSIPS routes calls to a set of destinations, it is able to keep the load status (as number of ongoing calls) of each destination and to choose to route to the less loaded destination (at that moment). OpenSIPS is aware of the capacity of each destination - it is preconfigured with the maximum load accepted by the destinations. To be more precise, when routing, OpenSIPS will consider the less loaded destination not the destination with the smallest number of ongoing calls, but the destination with the largest available slot.

Also, the "load-balancing" (LB) module is able to receive feedback from the destinations (if they are capable of). This mechanism is used for notifying OpenSIPS when the maximum capacity of a destination changed (like a GW with more or less E1 cards).

The "load-balancing" functionality comes to enhance the "dispatcher" one. The difference comes in having or not load information about the destinations where you are routing to:

  • Dispatcher has no load information - it just blindly forwards calls to the destinations based on a probabilistic dispersion logic. It gets no feedback about the load of the destination (like how many calls that were sent actually were established or how many are still going).
  • Load-balancer is load driven - LB routing logic is based primary on the load information. The LB module is using the DIALOG module in order to keep trace of the load (ongoing calls).

A Workshop on this topic was held at Amoocon (former AsteriskTag) in Rostock, 4-5 May 2009


Load Balancing - how it works

When looking at the LB implementation in OpenSIPS, we have 3 aspects:

Destination set

A destination is defined by its address (a SIP URI) and its description as capacity.

Form the LB module perspective, the destinations are not homogeneous - they are not alike; and not only from capacity point of view, but also from what kind of services/resources they offer. For example, you may have a set of Yate/Asterisk boxes for media-related services -some of them are doing transcoding, other voicemail or conference, other simple announcement , other PSTN termination. But you may have mixed boxes - one box may do PSTN and voicemail in the same time. So each destination from the set may offer a different set of services/resources.

So, for each destination, the LB module defines the offered resources, and for each resource, it defines the capacity / maximum load as number of concurrent calls the destination can handle for that resource.

Example:

4 destinations/boxes in the LB set
    1) offers 30 channels for transcoding and 32 for PSTN
    2) offers 100 voicemail channels and 10 for transcoding
    3) offers 50 voicemail channels and 300 for conference
    4) offers 10 voicemail, 10 conference, 10 transcoding and 32 PSTN

This translated into the following setup:

+----+----------+------------------------+---------------------------------+
| id | group_id | dst_uri                | resources                       |
+----+----------+------------------------+---------------------------------+
|  1 |        1 | sip:yate1.mycluset.net | transc=30; pstn=32              |
|  2 |        1 | sip:yate2.mycluset.net | vm=100; transc=10               |
|  3 |        1 | sip:yate3.mycluset.net | vm=50; conf=300                 |
|  4 |        1 | sip:yate4.mycluset.net | vm=10;conf=10;transc=10;pstn=32 |
+----+----------+------------------------+---------------------------------+

For runtime, the LB module provides MI commands for:

  • reloading the definition of destination sets
  • changing the capacity for a resource for a destination

Invoking Load-balancing

Using the LB functionality is very simple - you just have to pass to the LB module what kind of resources the call requires.

The resource detection is done in the OpenSIPS routing script, based on whatever information is appropriated. For example, looking at the RURI (dialed number) you can see if the call must go to PSTN or if it a voicemail or conference number; also, by looking at the codecs advertised in the SDP, you can figure out if transcoding is or not also required.


  if (!load_balance("1","transc;pstn")) {
      sl_send_reply("500","Service full");
      exit;
  }

The first parameter of the function identifies the LB set to be used (see the group_id column in the above DB snapshot). Second parameter is list of the required resource for the call.

The load_balance() will automatically create the dialog state for the call (in order to monitor it) and will also allocate the requested resources for it (from the selected box).
The function will set as destination URI ($du) the address of the selected destination/box.

The resources will be automatically released when the call terminates.

The LB module provides an MI function that allows the admin to inspect the current load over the destinations.

The LB logic

The logic used by the LB module to select the destination is:

  1. gets the destination set based on the group_id (first parameter of the load_balance() function)
  2. selects from the set only the destinations that are able to provide the requested resources (second parameter of the load_balance() function)
  3. for the selected destinations, it evaluated the current load for each requested resource
  4. the winning destination is the one with the biggest value for the minimum available load per resources.
Example:

4 destinations/boxes in the LB set
    1) offers 30 channels for transcoding and 32 for PSTN
    2) offers 100 voicemail channels and 10 for transcoding
    3) offers 50 voicemail channels and 300 for conference
    4) offers 10 voicemail, 10 conference, 10 transcoding and 32 PSTN

when calling load_balance("1","transc;pstn") ->

1) only boxes (1) and (4) will be selected at as they offer both transcoding and pstn

2) evaluating the load  :
    (1) transcoding - 10 channels used; PSTN - 18 used 
    (4) transcoding - 9 channels used; PSTN - 16 used 

   evaluating available load (capacity-load) :
    (1) transcoding - 20 channels used; PSTN - 14 used 
    (4) transcoding - 1 channels used; PSTN - 16 used 

3) for each box, the minimum available load (through all resources)
    (1) 14 (PSTN)
    (2) 1 (transcoding) 

4) final selected box in (1) as it has the the biggest (=14) available load for the most loaded resource.

The selection algorithm tries to avoid the intensive usage of a resource per box.


Study Case: routing the media gateways

Here is the full configuration and script for performing LB between media peers.

Configuration

Let's consider the case previously described:

4 destinations/boxes in the LB set
    1) offers 30 channels for transcoding and 32 for PSTN
    2) offers 100 voicemail channels and 10 for transcoding
    3) offers 50 voicemail channels and 300 for conference
    4) offers 10 voicemail, 10 conference, 10 transcoding and 32 PSTN

This translated into the following setup:

+----+----------+------------------------+---------------------------------+
| id | group_id | dst_uri                | resources                       |
+----+----------+------------------------+---------------------------------+
|  1 |        1 | sip:yate1.mycluset.net | transc=30; pstn=32              |
|  2 |        1 | sip:yate2.mycluset.net | vm=100; transc=10               |
|  3 |        1 | sip:yate3.mycluset.net | vm=50; conf=300                 |
|  4 |        1 | sip:yate4.mycluset.net | vm=10;conf=10;transc=10;pstn=32 |
+----+----------+------------------------+---------------------------------+

OpenSIPS Scripting

debug=1
memlog=1

fork=yes
children=2
log_stderror=no
log_facility=LOG_LOCAL0

disable_tcp=yes
disable_dns_blacklist = yes

auto_aliases=no

check_via=no
dns=off
rev_dns=off

listen=udp:xxx.xxx.xxx.xxx:5060



loadmodule "modules/maxfwd/maxfwd.so"
loadmodule "modules/sl/sl.so"
loadmodule "modules/db_mysql/db_mysql.so"
loadmodule "modules/tm/tm.so"
loadmodule "modules/xlog/xlog.so"
loadmodule "modules/uri/uri.so"
loadmodule "modules/rr/rr.so"
loadmodule "modules/dialog/dialog.so"
loadmodule "modules/mi_fifo/mi_fifo.so"
loadmodule "modules/mi_xmlrpc/mi_xmlrpc.so"
loadmodule "modules/signaling/signaling.so"
loadmodule "modules/textops/textops.so"
loadmodule "modules/load_balancer/load_balancer.so"



modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

modparam("dialog", "dlg_flag", 13)
modparam("dialog", "db_mode", 1)
modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")

modparam("rr","enable_double_rr",1)
modparam("rr","append_fromtag",1)

modparam("load_balancer", "db_url","mysql://opensips:opensipsrw@localhost/opensips")


route{
	if (!mf_process_maxfwd_header("3")) {
		sl_send_reply("483","looping");
		exit;
	}


	if (!has_totag()) {
                # initial request
		record_route();
	} else {
		# sequential request -> obey Route indication
		loose_route();
                t_relay();
                exit;
        }

        # handle cancel and re-transmissions
	if ( is_method("CANCEL") ) {
		if ( t_check_trans() )
			t_relay();
		exit;
	}


        # from now on we have only the initial requests
        if (!is_method("INVITE")) {
                send_reply("405","Method Not Allowed");
                exit;
        }

        # detect resources and do balancing
        if ($rU=~"^1") {
                # looks like a Conference call
                load_balance("1","conf");
        } else if ($rU=~"^2") {
                # looks like a VoiceMail call
                load_balance("1","vm");
        } else {
                # PSTN call, but the GWs supports only G711
                # for calls without G711, transcoding will be used on the GW
                if ( !search_body("G711") ) {
                       load_balance("1","transc;pstn");
                } else {
                       load_balance("1","pstn");
                }
        }

        # LB function returns negative if no suitable destination (for requested resources) is found,
        # or if all destinations are full
        if ($retcode<0) {
             sl_send_reply("500","Service full");
             exit;
        }

	xlog("Selected destination is: $du\n");

        # send it out
	if (!t_relay()) {
		sl_reply_error();
	}
}



Comments

(:nl:)>>messagehead<<

Gavin?15 March 2009, 23:41

Does this have to use Yate? Can Asterisk or FreeSwitch be used?

[bogdan] - there is no dependency (regarding the application you LB) - so you can have Yate, Asterisk, FreeSwitch, Cisco GW, Audiocodec GW, etc

(:nl:)>>messagehead<<

20 March 2009, 02:41

This is nice and simple. I am still learning OpenSIPs, but is it possible to combine this with a registrar function? Looking how to combine Load Balancing to a few Asterisk servers with OpenSIP also performing the registration.

[bogdan] - Of course it is possible - if you look at the default opensips cfg (that has the registrar capabilities), for processing the INVITE requests you can use load_balancing() function. If you have issues, use the mailing list for getting help

(:nl:)>>messagehead<<

haidavila?04 April 2009, 04:21

Hi. I´ve installed the new version (1.5) and I'm using load_balancer module but I'm having a problem... When a SIP server goes down and if it had the best attributes, load_balancer keeps sending the calls to it and all my calls drop. Is this normal? Can Opensips notices that this server is not working and pass it to the next sip server?

Thank you!

[bogdan]- unfortunately in the current version (1.5) you can not disable from script a destination; but you can do it from outside, via MI command (lb_resize to 0); you can use exec() from script to run the opensipsctl and resize the 0 the guilty server. Hope it will help. - btw, we can do disable from script with 1.6

(:nl:)>>messagehead<<

haidavila?11 April 2009, 03:21

Thank you bogdan, it really helped me.

Regards!

(:nl:)>>messagehead<<

elred?14 April 2009, 19:01

What if you have, let's say, 3 phones. You want each phone being able to contact each others. BUT, if you don't fall on the same server where the REGISTER was broadcasted, the PABX won't know the IP of the callee, and call won't be achieved. Is there a way to bounce REGISTER to multiple PABX ? Thanks !

[bogdan] - I do not think this is a typical case of LB (as there is some relation between the PBX you balance). What you can do is to separately deal with REGISTER and fork it (from LB server, with no LB) to all PBX and to do do LB only for INVITEs. Just an idea

(:nl:)>>messagehead<<

asterisktech?21 April 2009, 14:25

Hi,

I also would appreciate if someone could post here a howto of integration of opensips with asterisk.

asterisktech

[bogdan] - what kind of "integration" you have in mind? I mean what opensips to do and what asterisk to do.

(:nl:)>>messagehead<<

geejee?10 May 2009, 10:35

Hi,

what I like to do is to connect more than one client (e.g. desktop phone and soft phone) to one asterisk sip account. Asterisk cannot handle this because only one client can register. So opensips should work as sort of client inbetween. Username/password verification should be done by Asterisk. Does anyone know how to do this and give me a sample configuration for opensips?

Thanks

(:nl:)>>messagehead<<

sriram?09 June 2009, 18:15

HI,

I am load balancing the calls between gateways with different port values. Say I have total of 15 ports, the load balance modules works fine till 15th call. At 16th call load balance fails(this is the only call made,means all 15 ports are free ) and I am not getting calls on the gateway if I don't issue lb_reload command. I would appreciate if someone could let me know any other method to call get the current load status automatically set without entering the lb_reload comman statement.

thanks

[bogdan] - upgrade from svn to the latest version and if you still have issue, pleas post on the users mailing list

(:nl:)>>messagehead<<

Javier?31 July 2009, 02:25

Hi,

I'm getting the error: ERROR:core:yyparse: module 'mi_xmlrpc.so' not found in '/usr/local/lib/opensips/modules/' all the time whenever I try to use the load_balancer module. This is something I got since 1.5.1 and thought was a bug in that version and used dispatcher instead. Today, I made a fresh install of opensips 1.5.2 over a Centos 5.1 and got the same error. Could somebody point me in the right direction to solve this problem ?

thanks!

(:nl:)>>messagehead<<

vaitek?01 August 2009, 10:17

Hello Bogdan, Great work... what if one of balanced server has ended the call in case of the limit call time ? - OpenSIPS doesn't release resources as I realised... - how can I tell LB module that it should release resources? Is there any way to shere information about resources between LB and VOIP(switches,gateways,etc) ?

[bogdan] - if the call is release properly (from signalling point of view, with a BYE) the LB will see the call as terminated and release the resources.

(:nl:)>>messagehead<<

plimaye?02 August 2009, 20:33

Javier,

You need to uncomment mi_xmlrpc in Makefile to compile the module , but you will require xmlrpc-c and xmlrpc-c-devel installed ( I am using xmlrpc-c-1.16.6-1.1582 on Centos 5.3) to compile 1.5.2. So far its working but its not supported. Will update this if I find issues with xmlrpc-c version.

(:nl:)>>messagehead<<

Javier?04 August 2009, 17:40

Plimaye, Thank you very much for your help. I did that and certainly, it was in the exclude modules at makefile. I commented it. After that, I ran make clean, make and make install again and compiled ok (no errors) but I can't find xmlrpc-c and xmlrpc-c-devel to install.

and every time I try to run opensips, I get:

ERROR:core:sr_load_module: could not open module <mi_xmlrpc.so>: mi_xmlrpc.so: cannot open shared object file: No such file or directory

and really mi_xmlrpc.so is there in the modules folder!!!

If you have any other suggestion, please let me know.

Thanks a lot again!

[bogdan] - check if your cfg file is pointing to the right directory for loading the modules

(:nl:)>>messagehead<<

Alp?06 August 2009, 16:49

Hello, I am getting this error while initializing LB module. I couldnt find anything wrong why its getting me this error.

Aug 6 17:44:49 ubuntu /sbin/opensips[7696]: INFO:load_balancer:mod_init: Load-Balancer module - initializing Aug 6 17:44:49 ubuntu /sbin/opensips[7696]: ERROR:load_balancer:mod_init: Can't load dialog hooks Aug 6 17:44:49 ubuntu /sbin/opensips[7696]: ERROR:core:init_mod: failed to initialize module load_balancer Aug 6 17:44:49 ubuntu /sbin/opensips[7696]: ERROR:core:main: error while initializing modules

(:nl:)>>messagehead<<

Alp?06 August 2009, 17:32

I added module Dialog.so and add modparam("dialog", "dlg_flag", 4) in opensips.cfg file and it works!!

(:nl:)>>messagehead<<

Alp?06 August 2009, 18:04

There is one more bracket ')' in line if (!search_body("G711") )) {. It gives error.

[bogdan] - fixed, thank you

(:nl:)>>messagehead<<

motto?08 August 2009, 00:52

Hey,

 default load_balance configuration doesn't process "ACK" SIP packet from the Asterisk END, so the Asterisk after SIP ACK retransmiting several times hangup a call.
 Any idea on that ?

[bogdan] - the ACK (if properly formed by caller device) should contain the Route header and OpenSIPS will route it as sequential request (via loose_route() )

(:nl:)>>messagehead<<

ravi?14 August 2009, 17:04

is there anyway, loadbalancer can get destination ip address dynamically. Ex: i have 3 asterisk servers to be load balanced but some time i want to upgrade one asterisk server that case i want to remove that asterisk server ip address from load balancer database is that possible?

[bogdan] - update the IPs in DB and do via MI a "lb_reload"

(:nl:)>>messagehead<<

Javier?18 August 2009, 15:24

Hi Bogdan,

Thank you for your suggestion "Javier, check if your cfg file is pointing to the right directory for loading the modules." Really, the opensips.cfg is pointing properly to the modules directory.

Any other suggestion ?

Thank you,

Javier.

[bogdan] - check if the mi_xmlrpc.so file really exists in the directory you configured

(:nl:)>>messagehead<<

Ricardo?18 August 2009, 20:27

Hi Bogdan. Is possible to mix the load_balancer module with the LCR module?... i need the features from the LCR to route the calls, but also i need to know the status of a GW with E1/T1 and balance the load between several Gw's. Is this possible? Thanks

Ricardo.-

[bogdan] - that is a bit tricky as you have two engines for doing routing (but on different criteria) DR - prefix routing, LB - load routing; only if you chain them, like first DR to select a set of GWs(per prefix) and after that LB to choose one of the GWs from the DR set

(:nl:)>>messagehead<<

ravi?26 August 2009, 17:47

Hi Bogdan, is possible to assign variable in load_balance("$var(a0)","vm") or load_balance("$avp(i:55)","vm") function?

Ravi

[bogdan] - starting with 1.6 yes

(:nl:)>>messagehead<<

Raj?30 October 2009, 10:14

Hi Bogdam, I am using OpenSIPSv1.5.3 on centOS. If I load load_balancer.so the server start is failed. loadmodule "modules/load_balancer/load_balancer.so" modparam("load_balancer", "db_url","mysql://opensips:opensipsw@localhost/opensips"), I have created opensips user and password in db. Please suggest me with a solution if possible.

Raj

[bogdan] - see http://www.opensips.org/Resources/DocsTsStart ; it must be an error reported %%

(:nl:)>>messagehead<<

JG?12 November 2009, 21:41

I just installed OpenSips but i just don't understand the configuration part for the LB, i just want to do something like this:

prefix 044 redirect to ZAP Channel 37 and ZAP Channel 38

One call to 37 and the next to 38 and if both are busy to the default unicall

Can you guys help me out...

Thanks in advanced

JG

[bogdan] - post your question on the user mailing list

(:nl:)>>messagehead<<

LouisFox?11 March 2010, 09:10

I have a PSTN VoIP Gateway that is sending and receiving VoIP SIP calls to a SIP Gateway on the internet. I have 3 WAN connections. Can I use the load balancer to do call load balancing between the VoIP Gateway and the SIP Proxy. Can the load balancer distribute the VoIP load between the 3 connections equally and then also to receive and forward calls from the SIP Gateway to the VoIP PSTN Gateway. It is a single Internet SIP Proxy Service. 8 Calls per link

(:nl:)>>messagehead<<

16 July 2010, 19:49

is there a way to load balance based on calls per second (CPS) instead of total concurrent call? i have two sip carrier with 50 cps each and my auto dealers are dialing @ 60 calls per second.

[bogdan] - no, it is not possible

(:nl:)>>messagehead<<

Anh Ha?22 July 2010, 08:43

In the Load_balancer tables :

 4  	 2  	 sip:192.168.1.1  	 pstn=300  	 0  	 VNP #1

In opensips.cfg:

if (uri=~"^sip:.....9[0-2]*@")

     {
   xlog("route to Vinaphone");
          load_balance("2","pstn");
        # route(4);
     }

when i call 99984917xxxx , it matches the condition but it doesn't route the call to 192.168.1.1 If i have "route(4);" bellow "load_balance("2","pstn");", then it routes follow route(4)

Please help me Tks

[bogdan] - post your question on the user mailing list

(:nl:)>>messagehead<<

h3xd?22 September 2010, 05:21

Can the LB be used to balance between multiple NAT traversal systems?

[bogdan] - no, as a nat traversal system must be directly linked to the nated entity, so adding a LB between NAT traversal system and nated entity will break the NAT visibility at network level

(:nl:)>>messagehead<<

opensipnewbie?29 September 2010, 11:45

Is it possible to load balance in stateless mode?

[bogdan] - not with LB module (as the load is the number of calls, it must be dialog stateful) ; for stateless approaches, see the dispatcher module

(:nl:)>>messagehead<<

merik?19 October 2010, 16:38

it's very hard for me to configure opensips with module load_balance .someone have a good tutorial or a typical config of opensip.cfg to load_balance 3 asterisk

[bogdan] - if this tutorial (which will cover your case) does not help you, use the mailing lists

(:nl:)>>messagehead<<

elwan?08 December 2010, 23:31

its work with me but sometime i got no sound :( and also i see the opensips ip not the user ip what it's worng ??

(:nl:)>>messagehead<<

dcola?06 January 2011, 23:23

Is it possible to use the load balancer for failover to maintain a call dialog? In other words load_balance() an initial INVITE to one server and when that server goes down and a BYE comes into opensips from the user agent, lb_disable() that dead server and route the BYE to another server with the same call dialog using failure_route?

(:nl:)>>messagehead<<

Mesha?19 January 2011, 13:07

Registered OpenSIPS user. Incoming call on registered any softphone = everything ok. Registered OpenSIPS user. Incoming call on registered any hardphone (Grandstream (handytone,GXVxxx), matrix, hanglong) = no audio both ways??? Problem!!! What can be a solution?

(:nl:)>>messagehead<<

chaithu1987?17 March 2011, 22:11

I am new to opensips,can any one give me some idea which version of opensips to use for sip dialog(invite---100 trying----bye) and registration.

(:nl:)>>messagehead<<

jarce?07 April 2011, 22:11

???

(:nl:)>>messagehead<<

jarce?07 April 2011, 22:15

hello, there are forums in Spanish on this site?

(:nl:)>>messagehead<<

ThienVo?26 April 2011, 16:23

Hi sir Bongdan I have this problem,please help me. I use LB for 2 asterisk gateway.But when call terminal BYE package throught direct from asterisk to user not throught opensips.So resources can't release and finally after any call opensips notify serveice full untill i restart opensips.How to make opensips receive BYE package to release resources. Thanks alot

(:nl:)>>messagehead<<

sd?23 June 2011, 12:11

sd

(:nl:)>>messagehead<<

Sanjeev?23 June 2011, 12:22

Hi Sir,

i wanted to setup loadblanacer, i am using two server for load balancing, 10.0.3.30 & 10.0.12.75, in live scenario 400 calls will come, i want 200 calls on 10.0.3.30 server and 200 calls 10.0.12.75 server, i have installed openser on 10.0.1.138 server now when i edit following lines then getting following error

if (loose_route()) { t_relay(); }; ds_select_dst("1", "0"); record_route(); t_relay(); Jun 22 16:10:18 Testing openser: parse error (101,1-2): syntax error Jun 22 16:10:18 Testing openser: parse error (101,1-2):

Error Jun 22 16:10:18 Testing openser: INFO:mi_fifo:mi_destroy:memory for the child's mi_fifo_pid was not allocated -> nothing to destroy Jun 22 16:10:30 Testing openser: parse error (101,1-2): syntax error Jun 22 16:10:30 Testing openser: parse error (101,1-2): Jun 22 16:10:30 Testing openser: INFO:mi_fifo:mi_destroy:memory for the child's mi_fifo_pid was not allocated ->

Can you please share sample file with below configuration or let me know how i can achive this

(:nl:)>>messagehead<<

Sanjeev?24 June 2011, 06:47

do i have to register UA client with OpenSER for using LoadBalancing Feature?

(:nl:)>>messagehead<<

Khainou?04 August 2011, 13:52

I set up this feature, but the number of "load" in opensipsctl lb_list fifo does not decrease.

So, resources are always used. To reset, I have to restart.

How can I do to make this work?

Thank you!

Here is my configuration file:

route{

 if ($rU=="dialog") {
                xlog("L_INFO","---------dialog---------");
                if (load_balance("1","dialog"))
                        route(1);
                else
                        route(2);
        }
        else {
                xlog("L_INFO","---------conf---------");
                if (load_balance("1","conf"))
                        route(1);
                else
                        route(2);
        }

} route[1] {

        xlog("l'appel est dirige vers :  $dun");
        t_relay();
        exit();

}

route[2] {

        xlog(" ---- Service Full ---- ");
        sl_send_reply("500","Service full");
        exit();

}

And lb_list : Destination:: sip:X.X.X.X:5060 id=1 group=1 enabled=yes auto-re=on

        Resource:: dialog max=2 load=0

Destination:: sip:X.X.X.X:5060 id=1 group=1 enabled=yes auto-re=on

        Resource:: dialog max=2 load=0

Destination:: sip:X.X.X.X:5060 id=2 group=1 enabled=yes auto-re=on

        Resource:: conf max=2 load=0

Destination:: sip:X.X.X.X:5060 id=2 group=1 enabled=yes auto-re=on

        Resource:: conf max=2 load=0

(:nl:)>>messagehead<<

Khainou?04 August 2011, 15:14

Thanks to the forum, I solved the problem!

;)

(:nl:)>>messagehead<<

Suman Singh Rana?02 December 2011, 12:31

Can we run OpenSip 1.6.4 run on 64 bit linux machine (x86_64 GNU/Linux.

I am using opensips-1.6.4-2-notls_src.tar right on 32bit Linux machine ( i386 GNU/Linux )

[bogdan] - yes, you can

(:nl:)>>messagehead<<

Allen Ford?06 December 2011, 22:17

Im getting error :

Dec 6 15:58:04 c-24-30-48-18 /sbin/opensips[25235]: ERROR:load_balancer:do_load_balance: unknown resource in input string

[bogdan] - this error means you ask for a resource (in load_balance() function), that does not appear in the definition of the peers/destinations

(:nl:)>>messagehead<<

Rana?08 December 2011, 08:28

Can we run OpenSip LB on 64 bit linux machine ?

[bogdan] - yes, you can

(:nl:)>>messagehead<<

Allen Ford?09 December 2011, 14:56

Im unable to recieve calls with this setup... is there anyway we can intergrate nathelper and rtpproxy in here? been trying too do it for 2 days

(:nl:)>>messagehead<<

Allen Ford?11 December 2011, 21:31

i found my problem, when 2 extensions call each other it goes to asterisk via the load balancer, then asterisk sends it back since it shows registered via opensips... im getting loop

[bogdan] - please do not post net traces here (because of size) - better use the "users" mailing list.

(:nl:)>>messagehead<<

Tim Burke?11 January 2012, 19:25

Is there any means of keeping two instances of OpenSIPS synchronized in terms of the current call count of a destination? I'm wondering about the fault tolerance of losing one instance and having the other instance pick up the load balancing. Or perhaps even active/active operation of multiple instances of OpenSIPS.

[bogdan] - the possibility the exchange load information between multiple load-balancers will be available with 1.8 version (via distributed dialog profiles).

(:nl:)>>messagehead<<

Ionut Muntean?25 April 2012, 14:12

Hello all! Need to do some simple, round-robin load balancing to a cluster of Yate servers, no load check, just take the calls and give them to the next Yate in the list. Is there a simple example for this somewhere?

(:nl:)>>messagehead<<

Tim Burke?17 July 2012, 16:43

"Also, the "load-balancing" (LB) module is able to receive feedback from the destinations (if they are capable of)."

Does anyone know more details about that? Is this referring to updating and reloading the LB database?

(:nl:)>>messagehead<<

Pepper?20 August 2012, 03:46

That really captures the spriit of it. Thanks for posting.

(:nl:)>>messagehead<<

Terje?20 August 2012, 04:19

For xmpp to PSTN, you can simply use asertisk to convert jingle to sip, and then sip to anything you want, provided you have the proper hardware. I assume that others sip servers can do it ( callweaver, opensip, etc ), since both sip, jingle and the regular telephone are standardized features.

(:nl:)>>messagehead<<

Jean?20 August 2012, 13:33

I managed to dig up those two files I've only ineucdld the parts that you might need to change (I didn't include the entire file just the statements concerning the two IP phones I setup.You'll need to find their MAC address (on the back of the phone) and then depending on software version the phone is running you may need to tweak the rtp_method.unistim.conf[phone1] ; name of the devicedevice=001765ffe0fc ; mac address of the phonertp_port=10000 ; RTP port used by the phone, default = 10000. RTCP = rtp_port+1rtp_method=3 ; If you don't have sound, you can try 1, 2 or 3, default = 0status_method=0 ; If you don't see status text, try 1, default = 0titledefault=Asterisk ; default = "TimeZone (your time zone)". 12 characters maxmaintext0="Asterisk PBX" ; default = "Welcome", 24 characters max;maintext1="a custom text" ; default = the name of the device, 24 characters max;maintext2="(main page)" ; default = the public IP of the phone, 24 characters max;dateformat=1 ; 0 = month/day, 1 (default) = day/month;timeformat=1 ; 0 = 0:00am ; 1 (default) = 0h00, 2 = 0:00;contrast=8 ; define the contrast of the LCD. From 0 to 15. Default = 8;country=us ; country (ccTLD) for dial tone frequency. See README, default = us;ringvolume=2 ; ring volume : 0,1,2,3, can be overrided by Dial(), default = 2ringstyle=3 ; ring style : 0 to 7, can be overrided by Dial(), default = 3callhistory=1 ; 0 = disable, 1 = enable call history, default = 1callerid="Customer Support" <555-234-5678>context=michael ; context, default="default"mailbox=2000 ; Specify the mailbox number. Used by Message Waiting Indication;linelabel="Support" ; Softkey label for the next line=> entry, 9 char max.;extension=line ; Add an extension into the dialplan. Only valid in context specified previously. ; none=don't add (default), ask=prompt user, line=use the line numberline => 100 ; Only one line by device is currently supported. ; Beware ! only bookmark and softkey entries are allowed after line=>;bookmark=Hans C.@123 ; Use a softkey to dial 123. Name : 9 char max;bookmark=Mailbox@011@54 ; 54 shows a mailbox icon. See #define FAV_ICON_ for other values (32 to 63)bookmark=Test@*@USTM/phone2 ; Display an icon if violet is connected (dynamic), only for unistim device;bookmark=4@Pager@54321@51 ; Display a pager icon and dial 54321 when softkey 4 is pressed[phone2] ; name of the devicedevice=0018b0342c34 ; mac address of the phonertp_port=10000 ; RTP port used by the phone, default = 10000. RTCP = rtp_port+1rtp_method=3 ; If you don't have sound, you can try 1, 2 or 3, default = 0status_method=0 ; If you don't see status text, try 1, default = 0titledefault=Asterisk ; default = "TimeZone (your time zone)". 12 characters maxmaintext0="Asterisk PBX" ; default = "Welcome", 24 characters max;maintext1="a custom text" ; default = the name of the device, 24 characters max;maintext2="(main page)" ; default = the public IP of the phone, 24 characters max;dateformat=1 ; 0 = month/day, 1 (default) = day/month;timeformat=1 ; 0 = 0:00am ; 1 (default) = 0h00, 2 = 0:00;contrast=8 ; define the contrast of the LCD. From 0 to 15. Default = 8;country=us ; country (ccTLD) for dial tone frequency. See README, default = us;ringvolume=2 ; ring volume : 0,1,2,3, can be overrided by Dial(), default = 2ringstyle=3 ; ring style : 0 to 7, can be overrided by Dial(), default = 3callhistory=1 ; 0 = disable, 1 = enable call history, default = 1callerid="Customer Support" <555-234-5678>context=michael ; context, default="default"mailbox=2001 ; Specify the mailbox number. Used by Message Waiting Indication;linelabel="Support" ; Softkey label for the next line=> entry, 9 char max.;extension=line ; Add an extension into the dialplan. Only valid in context specified previously. ; none=don't add (default), ask=prompt user, line=use the line numberline => 101 ; Only one line by device is currently supported. ; Beware ! only bookmark and softkey entries are allowed after line=>;bookmark=Hans C.@123 ; Use a softkey to dial 123. Name : 9 char max;bookmark=Mailbox@011@54 ; 54 shows a mailbox icon. See #define FAV_ICON_ for other values (32 to 63)bookmark=Test@*@USTM/phone1 ; Display an icon if violet is connected (dynamic), only for unistim device;bookmark=4@Pager@54321@51 ; Display a pager icon and dial 54321 when softkey 4 is pressedI then added the following lines in the extensions.conf file;exten => 100,1,Dial(USTM/100@phone1)exten => 101,1,Dial(USTM/101@phone2)It's not to complicated after you spend some time with it.Good Luck!

(:nl:)>>messagehead<<

Sandeep?22 August 2012, 05:14

Hi Mark,What's really neat is that the i2002 pnoehs were still running the UNIStim stack with firmware 0604DAD and 0604DBG (no SIP firmware available for the i2002/i2004 pnoehs). Thanks to the efforts of and others they were able to reverse engineer the UNIStim stack and provide the channel driver for using Nortel's proprietary protocol on Asterisk.I will comment that it took me about 30 minutes to realize that you couldn't just pickup the handset and dial a number. You had to pickup the handset, dial the phone number and then select the softkey labeled Call . I spent that first 30 minutes running packet traces trying to figure out if I had a G.711/GSM codec issue or what the problem was.Thanks again for the comment!

(:nl:)>>messagehead<<

Mulker?22 August 2012, 06:00

I am just installing an asetsirk server into my small business, I have 8 Grandstream 2000 phones for hte initial deployment. These are configured and working fine. I am replaceing a Nortel BCM50 and I have 3 IP phones I would LOVE to get working on the system.I am on CentOS 5.2 like you, and used hte AsteriskNOW 1.6Beta for my base intstall of everything.Can I get a DETAILED instruction on how you got the nortels to work? Heck I would even pay you fo rhte consult to help me.. I truely like the nortel phones and it would save me about $400 if I can re-use the 3 IP phones I have.[removed by moderator]PS: I am not a Phone Guy' so this is all new to me, I am a MCSE/T type.

(:nl:)>>messagehead<<

Mohammed?29 August 2012, 10:06

Hi Sir, I need to know how to register outbound trunk in Opensips which required username and password? for example in asterisk it is (register => username:password@server-ip:5060), How can i do this in Opensips?

Thanks in advanced Mohammed

(:nl:)>>messagehead<<

Johan?04 September 2012, 15:20

I have the basic load-balance configuration as written above. One proxy, two end servers.

As test I have setup a call to server1 and server2. Then I pull the network cable out of server2.

Problem is that the call stays connected to server2. How can I configure that the proxy will send a BYE to both ends, when a server is down (lb_status sees it's down). I want the call to disconnect, not to proceed on the other server.

(:nl:)>>messagehead<<

anand?11 February 2013, 10:26

hiii

(:nl:)>>messagehead<<

sonu?11 February 2013, 12:01

I have two asterisk box,How i can verify both are alive or any one goesdown using opensips.cgf

(:nl:)>>messagehead<<

BFSP?24 February 2013, 01:58

Is there a way to use the receiving interface IP as the resource parameter in LB? This would greatly simplify using the correct table when listening on multiple interfaces on a single server.

if (!load_balance($Ri,"transc;pstn")) {

      sl_send_reply("500","Service full");
      exit;

}

(:nl:)>>messagehead<<

BFSP?24 February 2013, 02:07

Looks like there is a solution using a transformation.

$var(ip) = $Ri{ip.pton};

if (!load_balance("$var(ip)","transc;pstn")) {

      sl_send_reply("500","Service full");
      exit;

}

(:nl:)>>messagehead<<

BFSP?28 February 2013, 04:05

Big let down. Doesn't work. I didn't realize the {ip.pton} transformation literally transforms the value into ASCII characters representing the binary value.

(:commentboxchrono:)

to:

(:redirect Documentation.Tutorials-LoadBalancing quiet=1 :)

February 28, 2013, at 05:05 AM by BFSP - Comment added
Added lines 919-924:

(:nl:)>>messagehead<<

BFSP?28 February 2013, 04:05

Big let down. Doesn't work. I didn't realize the {ip.pton} transformation literally transforms the value into ASCII characters representing the binary value.

February 24, 2013, at 03:07 AM by BFSP - Comment added
Added lines 906-918:

(:nl:)>>messagehead<<

BFSP?24 February 2013, 02:07

Looks like there is a solution using a transformation.

$var(ip) = $Ri{ip.pton};

if (!load_balance("$var(ip)","transc;pstn")) {

      sl_send_reply("500","Service full");
      exit;

}

February 24, 2013, at 02:58 AM by BFSP - Comment added
Added lines 894-905:

(:nl:)>>messagehead<<

BFSP?24 February 2013, 01:58

Is there a way to use the receiving interface IP as the resource parameter in LB? This would greatly simplify using the correct table when listening on multiple interfaces on a single server.

if (!load_balance($Ri,"transc;pstn")) {

      sl_send_reply("500","Service full");
      exit;

}

February 17, 2013, at 08:05 PM by bogdan -
Added lines 5-6:

This tutorial applies for OpenSIPS versions 1.5, 1.6, 1.7 .

February 11, 2013, at 01:01 PM by sonu - Comment added
Added lines 886-891:

(:nl:)>>messagehead<<

sonu?11 February 2013, 12:01

I have two asterisk box,How i can verify both are alive or any one goesdown using opensips.cgf

February 11, 2013, at 11:26 AM by anand - Comment added
Added lines 880-885:

(:nl:)>>messagehead<<

anand?11 February 2013, 10:26

hiii

November 26, 2012, at 11:24 PM by bogdan -
Deleted lines 879-884:

(:nl:)>>messagehead<<

Irene?26 November 2012, 15:22

If only there were more clever peolpe like you!

November 26, 2012, at 04:22 PM by Irene - Comment added
Added lines 880-885:

(:nl:)>>messagehead<<

Irene?26 November 2012, 15:22

If only there were more clever peolpe like you!

September 04, 2012, at 04:20 PM by Johan - Comment added
Added lines 866-879:

(:nl:)>>messagehead<<

Johan?04 September 2012, 15:20

I have the basic load-balance configuration as written above. One proxy, two end servers.

As test I have setup a call to server1 and server2. Then I pull the network cable out of server2.

Problem is that the call stays connected to server2. How can I configure that the proxy will send a BYE to both ends, when a server is down (lb_status sees it's down). I want the call to disconnect, not to proceed on the other server.

August 29, 2012, at 11:06 AM by Mohammed - Comment added
Added lines 855-865:

(:nl:)>>messagehead<<

Mohammed?29 August 2012, 10:06

Hi Sir, I need to know how to register outbound trunk in Opensips which required username and password? for example in asterisk it is (register => username:password@server-ip:5060), How can i do this in Opensips?

Thanks in advanced Mohammed

August 22, 2012, at 07:00 AM by Mulker - Comment added
Added lines 849-854:

(:nl:)>>messagehead<<

Mulker?22 August 2012, 06:00

I am just installing an asetsirk server into my small business, I have 8 Grandstream 2000 phones for hte initial deployment. These are configured and working fine. I am replaceing a Nortel BCM50 and I have 3 IP phones I would LOVE to get working on the system.I am on CentOS 5.2 like you, and used hte AsteriskNOW 1.6Beta for my base intstall of everything.Can I get a DETAILED instruction on how you got the nortels to work? Heck I would even pay you fo rhte consult to help me.. I truely like the nortel phones and it would save me about $400 if I can re-use the 3 IP phones I have.[removed by moderator]PS: I am not a Phone Guy' so this is all new to me, I am a MCSE/T type.

August 22, 2012, at 06:14 AM by Sandeep - Comment added
Added lines 843-848:

(:nl:)>>messagehead<<

Sandeep?22 August 2012, 05:14

Hi Mark,What's really neat is that the i2002 pnoehs were still running the UNIStim stack with firmware 0604DAD and 0604DBG (no SIP firmware available for the i2002/i2004 pnoehs). Thanks to the efforts of and others they were able to reverse engineer the UNIStim stack and provide the channel driver for using Nortel's proprietary protocol on Asterisk.I will comment that it took me about 30 minutes to realize that you couldn't just pickup the handset and dial a number. You had to pickup the handset, dial the phone number and then select the softkey labeled Call . I spent that first 30 minutes running packet traces trying to figure out if I had a G.711/GSM codec issue or what the problem was.Thanks again for the comment!

August 20, 2012, at 02:33 PM by Jean - Comment added
Added lines 837-842:

(:nl:)>>messagehead<<

Jean?20 August 2012, 13:33

I managed to dig up those two files I've only ineucdld the parts that you might need to change (I didn't include the entire file just the statements concerning the two IP phones I setup.You'll need to find their MAC address (on the back of the phone) and then depending on software version the phone is running you may need to tweak the rtp_method.unistim.conf[phone1] ; name of the devicedevice=001765ffe0fc ; mac address of the phonertp_port=10000 ; RTP port used by the phone, default = 10000. RTCP = rtp_port+1rtp_method=3 ; If you don't have sound, you can try 1, 2 or 3, default = 0status_method=0 ; If you don't see status text, try 1, default = 0titledefault=Asterisk ; default = "TimeZone (your time zone)". 12 characters maxmaintext0="Asterisk PBX" ; default = "Welcome", 24 characters max;maintext1="a custom text" ; default = the name of the device, 24 characters max;maintext2="(main page)" ; default = the public IP of the phone, 24 characters max;dateformat=1 ; 0 = month/day, 1 (default) = day/month;timeformat=1 ; 0 = 0:00am ; 1 (default) = 0h00, 2 = 0:00;contrast=8 ; define the contrast of the LCD. From 0 to 15. Default = 8;country=us ; country (ccTLD) for dial tone frequency. See README, default = us;ringvolume=2 ; ring volume : 0,1,2,3, can be overrided by Dial(), default = 2ringstyle=3 ; ring style : 0 to 7, can be overrided by Dial(), default = 3callhistory=1 ; 0 = disable, 1 = enable call history, default = 1callerid="Customer Support" <555-234-5678>context=michael ; context, default="default"mailbox=2000 ; Specify the mailbox number. Used by Message Waiting Indication;linelabel="Support" ; Softkey label for the next line=> entry, 9 char max.;extension=line ; Add an extension into the dialplan. Only valid in context specified previously. ; none=don't add (default), ask=prompt user, line=use the line numberline => 100 ; Only one line by device is currently supported. ; Beware ! only bookmark and softkey entries are allowed after line=>;bookmark=Hans C.@123 ; Use a softkey to dial 123. Name : 9 char max;bookmark=Mailbox@011@54 ; 54 shows a mailbox icon. See #define FAV_ICON_ for other values (32 to 63)bookmark=Test@*@USTM/phone2 ; Display an icon if violet is connected (dynamic), only for unistim device;bookmark=4@Pager@54321@51 ; Display a pager icon and dial 54321 when softkey 4 is pressed[phone2] ; name of the devicedevice=0018b0342c34 ; mac address of the phonertp_port=10000 ; RTP port used by the phone, default = 10000. RTCP = rtp_port+1rtp_method=3 ; If you don't have sound, you can try 1, 2 or 3, default = 0status_method=0 ; If you don't see status text, try 1, default = 0titledefault=Asterisk ; default = "TimeZone (your time zone)". 12 characters maxmaintext0="Asterisk PBX" ; default = "Welcome", 24 characters max;maintext1="a custom text" ; default = the name of the device, 24 characters max;maintext2="(main page)" ; default = the public IP of the phone, 24 characters max;dateformat=1 ; 0 = month/day, 1 (default) = day/month;timeformat=1 ; 0 = 0:00am ; 1 (default) = 0h00, 2 = 0:00;contrast=8 ; define the contrast of the LCD. From 0 to 15. Default = 8;country=us ; country (ccTLD) for dial tone frequency. See README, default = us;ringvolume=2 ; ring volume : 0,1,2,3, can be overrided by Dial(), default = 2ringstyle=3 ; ring style : 0 to 7, can be overrided by Dial(), default = 3callhistory=1 ; 0 = disable, 1 = enable call history, default = 1callerid="Customer Support" <555-234-5678>context=michael ; context, default="default"mailbox=2001 ; Specify the mailbox number. Used by Message Waiting Indication;linelabel="Support" ; Softkey label for the next line=> entry, 9 char max.;extension=line ; Add an extension into the dialplan. Only valid in context specified previously. ; none=don't add (default), ask=prompt user, line=use the line numberline => 101 ; Only one line by device is currently supported. ; Beware ! only bookmark and softkey entries are allowed after line=>;bookmark=Hans C.@123 ; Use a softkey to dial 123. Name : 9 char max;bookmark=Mailbox@011@54 ; 54 shows a mailbox icon. See #define FAV_ICON_ for other values (32 to 63)bookmark=Test@*@USTM/phone1 ; Display an icon if violet is connected (dynamic), only for unistim device;bookmark=4@Pager@54321@51 ; Display a pager icon and dial 54321 when softkey 4 is pressedI then added the following lines in the extensions.conf file;exten => 100,1,Dial(USTM/100@phone1)exten => 101,1,Dial(USTM/101@phone2)It's not to complicated after you spend some time with it.Good Luck!

August 20, 2012, at 05:19 AM by Terje - Comment added
Added lines 831-836:

(:nl:)>>messagehead<<

Terje?20 August 2012, 04:19

For xmpp to PSTN, you can simply use asertisk to convert jingle to sip, and then sip to anything you want, provided you have the proper hardware. I assume that others sip servers can do it ( callweaver, opensip, etc ), since both sip, jingle and the regular telephone are standardized features.

August 20, 2012, at 04:46 AM by Pepper - Comment added
Added lines 825-830:

(:nl:)>>messagehead<<

Pepper?20 August 2012, 03:46

That really captures the spriit of it. Thanks for posting.

July 17, 2012, at 05:43 PM by 199.4.160.10 - Comment added
Added lines 817-824:

(:nl:)>>messagehead<<

Tim Burke?17 July 2012, 16:43

"Also, the "load-balancing" (LB) module is able to receive feedback from the destinations (if they are capable of)."

Does anyone know more details about that? Is this referring to updating and reloading the LB database?

April 25, 2012, at 03:12 PM by Ionut Muntean - Comment added
Added lines 811-816:

(:nl:)>>messagehead<<

Ionut Muntean?25 April 2012, 14:12

Hello all! Need to do some simple, round-robin load balancing to a cluster of Yate servers, no load check, just take the calls and give them to the next Yate in the list. Is there a simple example for this somewhere?

January 12, 2012, at 06:06 PM by bogdan -
Added lines 809-810:

[bogdan] - the possibility the exchange load information between multiple load-balancers will be available with 1.8 version (via distributed dialog profiles).

January 11, 2012, at 08:25 PM by Tim Burke - Comment added
Added lines 803-808:

(:nl:)>>messagehead<<

Tim Burke?11 January 2012, 19:25

Is there any means of keeping two instances of OpenSIPS synchronized in terms of the current call count of a destination? I'm wondering about the fault tolerance of losing one instance and having the other instance pick up the load balancing. Or perhaps even active/active operation of multiple instances of OpenSIPS.

December 12, 2011, at 11:29 AM by bogdan -
Changed lines 802-813 from:

011-12-11 15:08:57 011c487e1336c70b43abd71e1be8d3fb@24.98.174.228

	INVITE sip:2001@24.98.175.41:40868;rinstance=23db30f3c1031726 SIP/2.0 Record-Route: <sip:24.30.48.18;lr;ftag=as7cdc21f8;did=5c1.5ed2d731> Via: SIP/2.0/UDP 24.30.48.18;branch=z9hG4bK690a.2ab77367.0 Via: SIP/2.0/UDP 24.98.174.228:5060;received=24.98.174.228;branch=z9hG4bK049016ed;rport=5060 Max-Forwards: 68 From: "Cyford Technologies LLC" <sip:2000@24.98.174.228>;tag=as7cdc21f8 To: <sip:2001@24.98.175.41:40868;rinstance=23db30f3c1031726> Contact: <sip:2000@24.98.174.228> Call-ID: 011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 CSeq: 102 INVITE User-Agent: FPBX-2.9.0(1.6.2.20) Date: Sun, 11 Dec 2011 20:08:57 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO Supported: replaces, timer Content-Type: application/sdp Content-Length: 260 v=0 o=root 289653242 289653242 IN IP4 24.98.174.228 s=Asterisk PBX 1.6.2.20 c=IN IP4 24.98.174.228 t=0 0 m=audio 16648 RTP/AVP 0 3 101 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/800 ... 	INVITE 	
	udp:24.30.48.18:5060 	udp:192.168.111.108:5060 	as7cdc21f8 	out
	1038 	2011-12-11 15:08:57 	011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 	
	SIP/2.0 482 Loop Detected Via: SIP/2.0/UDP 24.30.48.18;branch=z9hG4bK690a.2ab77367.0;received=24.30.48.18 Via: SIP/2.0/UDP 24.98.174.228:5060;received=24.98.174.228;branch=z9hG4bK049016ed;rport=5060 From: "Cyford Technologies LLC" <sip:2000@24.98.174.228>;tag=as7cdc21f8 To: <sip:2001@24.98.175.41:40868;rinstance=23db30f3c1031726>;tag=as7cdc21f8 Call-ID: 011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 CSeq: 102 INVITE Server: FPBX-2.9.0(1.6.2.20) Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO Supported: replaces, timer Content-Length: 0 	INVITE 	482 	udp:24.98.174.228:5060 	udp:24.30.48.18:5060 	as7cdc21f8 	in
	1039 	2011-12-11 15:08:57 	011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 	
	SIP/2.0 482 Loop Detected Via: SIP/2.0/UDP 24.98.174.228:5060;received=24.98.174.228;branch=z9hG4bK049016ed;rport=5060 From: "Cyford Technologies LLC" <sip:2000@24.98.174.228>;tag=as7cdc21f8 To: <sip:2001@24.98.175.41:40868;rinstance=23db30f3c1031726>;tag=as7cdc21f8 Call-ID: 011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 CSeq: 102 INVITE Server: FPBX-2.9.0(1.6.2.20) Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO Supported: replaces, timer Content-Length: 0 	INVITE 	482 	udp:24.30.48.18:5060 	udp:24.98.174.228:5060 	as7cdc21f8 	out
to:

[bogdan] - please do not post net traces here (because of size) - better use the "users" mailing list.

December 11, 2011, at 10:31 PM by Allen Ford - Comment added
Added lines 794-813:

(:nl:)>>messagehead<<

Allen Ford?11 December 2011, 21:31

i found my problem, when 2 extensions call each other it goes to asterisk via the load balancer, then asterisk sends it back since it shows registered via opensips... im getting loop

011-12-11 15:08:57 011c487e1336c70b43abd71e1be8d3fb@24.98.174.228

	INVITE sip:2001@24.98.175.41:40868;rinstance=23db30f3c1031726 SIP/2.0 Record-Route: <sip:24.30.48.18;lr;ftag=as7cdc21f8;did=5c1.5ed2d731> Via: SIP/2.0/UDP 24.30.48.18;branch=z9hG4bK690a.2ab77367.0 Via: SIP/2.0/UDP 24.98.174.228:5060;received=24.98.174.228;branch=z9hG4bK049016ed;rport=5060 Max-Forwards: 68 From: "Cyford Technologies LLC" <sip:2000@24.98.174.228>;tag=as7cdc21f8 To: <sip:2001@24.98.175.41:40868;rinstance=23db30f3c1031726> Contact: <sip:2000@24.98.174.228> Call-ID: 011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 CSeq: 102 INVITE User-Agent: FPBX-2.9.0(1.6.2.20) Date: Sun, 11 Dec 2011 20:08:57 GMT Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO Supported: replaces, timer Content-Type: application/sdp Content-Length: 260 v=0 o=root 289653242 289653242 IN IP4 24.98.174.228 s=Asterisk PBX 1.6.2.20 c=IN IP4 24.98.174.228 t=0 0 m=audio 16648 RTP/AVP 0 3 101 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/800 ... 	INVITE 	
	udp:24.30.48.18:5060 	udp:192.168.111.108:5060 	as7cdc21f8 	out
	1038 	2011-12-11 15:08:57 	011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 	
	SIP/2.0 482 Loop Detected Via: SIP/2.0/UDP 24.30.48.18;branch=z9hG4bK690a.2ab77367.0;received=24.30.48.18 Via: SIP/2.0/UDP 24.98.174.228:5060;received=24.98.174.228;branch=z9hG4bK049016ed;rport=5060 From: "Cyford Technologies LLC" <sip:2000@24.98.174.228>;tag=as7cdc21f8 To: <sip:2001@24.98.175.41:40868;rinstance=23db30f3c1031726>;tag=as7cdc21f8 Call-ID: 011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 CSeq: 102 INVITE Server: FPBX-2.9.0(1.6.2.20) Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO Supported: replaces, timer Content-Length: 0 	INVITE 	482 	udp:24.98.174.228:5060 	udp:24.30.48.18:5060 	as7cdc21f8 	in
	1039 	2011-12-11 15:08:57 	011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 	
	SIP/2.0 482 Loop Detected Via: SIP/2.0/UDP 24.98.174.228:5060;received=24.98.174.228;branch=z9hG4bK049016ed;rport=5060 From: "Cyford Technologies LLC" <sip:2000@24.98.174.228>;tag=as7cdc21f8 To: <sip:2001@24.98.175.41:40868;rinstance=23db30f3c1031726>;tag=as7cdc21f8 Call-ID: 011c487e1336c70b43abd71e1be8d3fb@24.98.174.228 CSeq: 102 INVITE Server: FPBX-2.9.0(1.6.2.20) Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO Supported: replaces, timer Content-Length: 0 	INVITE 	482 	udp:24.30.48.18:5060 	udp:24.98.174.228:5060 	as7cdc21f8 	out
December 09, 2011, at 03:56 PM by Allen Ford - Comment added
Added lines 788-793:

(:nl:)>>messagehead<<

Allen Ford?09 December 2011, 14:56

Im unable to recieve calls with this setup... is there anyway we can intergrate nathelper and rtpproxy in here? been trying too do it for 2 days

December 08, 2011, at 11:41 AM by bogdan -
Deleted line 765:
Added lines 767-768:

[bogdan] - yes, you can

Added lines 777-779:

[bogdan] - this error means you ask for a resource (in load_balance() function), that does not appear in the definition of the peers/destinations

Added lines 786-787:

[bogdan] - yes, you can

December 08, 2011, at 09:28 AM by Rana - Comment added
Added lines 776-781:

(:nl:)>>messagehead<<

Rana?08 December 2011, 08:28

Can we run OpenSip LB on 64 bit linux machine ?

December 06, 2011, at 11:17 PM by Allen Ford - Comment added
Added lines 768-775:

(:nl:)>>messagehead<<

Allen Ford?06 December 2011, 22:17

Im getting error :

Dec 6 15:58:04 c-24-30-48-18 /sbin/opensips[25235]: ERROR:load_balancer:do_load_balance: unknown resource in input string

December 02, 2011, at 01:31 PM by Suman Singh Rana - Comment added
Added lines 759-767:

(:nl:)>>messagehead<<

Suman Singh Rana?02 December 2011, 12:31

Can we run OpenSip 1.6.4 run on 64 bit linux machine (x86_64 GNU/Linux.

I am using opensips-1.6.4-2-notls_src.tar right on 32bit Linux machine ( i386 GNU/Linux )

August 04, 2011, at 04:14 PM by 80.12.110.201 - Comment added
Added lines 751-758:

(:nl:)>>messagehead<<

Khainou?04 August 2011, 15:14

Thanks to the forum, I solved the problem!

;)

August 04, 2011, at 02:52 PM by Khainou - Comment added
Added lines 694-750:

(:nl:)>>messagehead<<

Khainou?04 August 2011, 13:52

I set up this feature, but the number of "load" in opensipsctl lb_list fifo does not decrease.

So, resources are always used. To reset, I have to restart.

How can I do to make this work?

Thank you!

Here is my configuration file:

route{

 if ($rU=="dialog") {
                xlog("L_INFO","---------dialog---------");
                if (load_balance("1","dialog"))
                        route(1);
                else
                        route(2);
        }
        else {
                xlog("L_INFO","---------conf---------");
                if (load_balance("1","conf"))
                        route(1);
                else
                        route(2);
        }

} route[1] {

        xlog("l'appel est dirige vers :  $dun");
        t_relay();
        exit();

}

route[2] {

        xlog(" ---- Service Full ---- ");
        sl_send_reply("500","Service full");
        exit();

}

And lb_list : Destination:: sip:X.X.X.X:5060 id=1 group=1 enabled=yes auto-re=on

        Resource:: dialog max=2 load=0

Destination:: sip:X.X.X.X:5060 id=1 group=1 enabled=yes auto-re=on

        Resource:: dialog max=2 load=0

Destination:: sip:X.X.X.X:5060 id=2 group=1 enabled=yes auto-re=on

        Resource:: conf max=2 load=0

Destination:: sip:X.X.X.X:5060 id=2 group=1 enabled=yes auto-re=on

        Resource:: conf max=2 load=0
June 24, 2011, at 07:47 AM by Sanjeev - Comment added
Added lines 688-693:

(:nl:)>>messagehead<<

Sanjeev?24 June 2011, 06:47

do i have to register UA client with OpenSER for using LoadBalancing Feature?

June 23, 2011, at 01:22 PM by Sanjeev - Comment added
Added lines 662-687:

(:nl:)>>messagehead<<

Sanjeev?23 June 2011, 12:22

Hi Sir,

i wanted to setup loadblanacer, i am using two server for load balancing, 10.0.3.30 & 10.0.12.75, in live scenario 400 calls will come, i want 200 calls on 10.0.3.30 server and 200 calls 10.0.12.75 server, i have installed openser on 10.0.1.138 server now when i edit following lines then getting following error

if (loose_route()) { t_relay(); }; ds_select_dst("1", "0"); record_route(); t_relay(); Jun 22 16:10:18 Testing openser: parse error (101,1-2): syntax error Jun 22 16:10:18 Testing openser: parse error (101,1-2):

Error Jun 22 16:10:18 Testing openser: INFO:mi_fifo:mi_destroy:memory for the child's mi_fifo_pid was not allocated -> nothing to destroy Jun 22 16:10:30 Testing openser: parse error (101,1-2): syntax error Jun 22 16:10:30 Testing openser: parse error (101,1-2): Jun 22 16:10:30 Testing openser: INFO:mi_fifo:mi_destroy:memory for the child's mi_fifo_pid was not allocated ->

Can you please share sample file with below configuration or let me know how i can achive this

June 23, 2011, at 01:11 PM by sd - Comment added
Added lines 656-661:

(:nl:)>>messagehead<<

sd?23 June 2011, 12:11

sd

May 12, 2011, at 12:29 PM by bogdan - Comments Cleanup
Deleted lines 655-666:

(:nl:)>>messagehead<<

Navid?11 May 2011, 18:12

What a joy to find smoenoe else who thinks this way.

(:nl:)>>messagehead<<

Tibbie?11 May 2011, 18:52

Very true! Makes a caghne to see someone spell it out like that. :)

May 11, 2011, at 07:52 PM by Tibbie - Comment added
Added lines 662-667:

(:nl:)>>messagehead<<

Tibbie?11 May 2011, 18:52

Very true! Makes a caghne to see someone spell it out like that. :)

May 11, 2011, at 07:12 PM by Navid - Comment added
Added lines 656-661:

(:nl:)>>messagehead<<

Navid?11 May 2011, 18:12

What a joy to find smoenoe else who thinks this way.

May 11, 2011, at 10:17 AM by bogdan - Comments Cleanup
Deleted lines 655-672:

(:nl:)>>messagehead<<

Bubi?10 May 2011, 05:35

Thanks for the inigsht. It brings light into the dark!

(:nl:)>>messagehead<<

Brandilyn?10 May 2011, 08:03

Now thatÂ’s sulbte! Great to hear from you.

(:nl:)>>messagehead<<

Tilly?10 May 2011, 10:53

With the bases loaded you stcruk us out with that answer!

May 10, 2011, at 11:53 AM by Tilly - Comment added
Added lines 668-673:

(:nl:)>>messagehead<<

Tilly?10 May 2011, 10:53

With the bases loaded you stcruk us out with that answer!

May 10, 2011, at 09:03 AM by Brandilyn - Comment added
Added lines 662-667:

(:nl:)>>messagehead<<

Brandilyn?10 May 2011, 08:03

Now thatÂ’s sulbte! Great to hear from you.

May 10, 2011, at 06:35 AM by Bubi - Comment added
Added lines 656-661:

(:nl:)>>messagehead<<

Bubi?10 May 2011, 05:35

Thanks for the inigsht. It brings light into the dark!

April 26, 2011, at 05:23 PM by ThienVo - Comment added
Added lines 647-655:

(:nl:)>>messagehead<<

ThienVo?26 April 2011, 16:23

Hi sir Bongdan I have this problem,please help me. I use LB for 2 asterisk gateway.But when call terminal BYE package throught direct from asterisk to user not throught opensips.So resources can't release and finally after any call opensips notify serveice full untill i restart opensips.How to make opensips receive BYE package to release resources. Thanks alot

April 07, 2011, at 11:15 PM by jarce - Comment added
Added lines 641-646:

(:nl:)>>messagehead<<

jarce?07 April 2011, 22:15

hello, there are forums in Spanish on this site?

April 07, 2011, at 11:11 PM by jarce - Comment added
Added lines 635-640:

(:nl:)>>messagehead<<

jarce?07 April 2011, 22:11

???

March 17, 2011, at 11:11 PM by chaithu1987 - Comment added
Added lines 629-634:

(:nl:)>>messagehead<<

chaithu1987?17 March 2011, 22:11

I am new to opensips,can any one give me some idea which version of opensips to use for sip dialog(invite---100 trying----bye) and registration.

January 19, 2011, at 02:07 PM by Mesha - Comment added
Added lines 622-628:

(:nl:)>>messagehead<<

Mesha?19 January 2011, 13:07

Registered OpenSIPS user. Incoming call on registered any softphone = everything ok. Registered OpenSIPS user. Incoming call on registered any hardphone (Grandstream (handytone,GXVxxx), matrix, hanglong) = no audio both ways??? Problem!!! What can be a solution?

January 07, 2011, at 12:23 AM by dcola - Comment added
Added lines 616-621:

(:nl:)>>messagehead<<

dcola?06 January 2011, 23:23

Is it possible to use the load balancer for failover to maintain a call dialog? In other words load_balance() an initial INVITE to one server and when that server goes down and a BYE comes into opensips from the user agent, lb_disable() that dead server and route the BYE to another server with the same call dialog using failure_route?

December 09, 2010, at 12:31 AM by elwan - Comment added
Added lines 608-615:

(:nl:)>>messagehead<<

elwan?08 December 2010, 23:31

its work with me but sometime i got no sound :( and also i see the opensips ip not the user ip what it's worng ??

November 10, 2010, at 09:57 AM by bogdan -
Added lines 555-556:

[bogdan] - no, it is not possible

Added lines 582-583:

[bogdan] - post your question on the user mailing list

Added lines 590-591:

[bogdan] - no, as a nat traversal system must be directly linked to the nated entity, so adding a LB between NAT traversal system and nated entity will break the NAT visibility at network level

Added lines 598-599:

[bogdan] - not with LB module (as the load is the number of calls, it must be dialog stateful) ; for stateless approaches, see the dispatcher module

Added lines 606-607:

[bogdan] - if this tutorial (which will cover your case) does not help you, use the mailing lists

October 19, 2010, at 05:38 PM by merik - Comment added
Added lines 592-597:

(:nl:)>>messagehead<<

merik?19 October 2010, 16:38

it's very hard for me to configure opensips with module load_balance .someone have a good tutorial or a typical config of opensip.cfg to load_balance 3 asterisk

September 29, 2010, at 12:45 PM by opensipnewbie - Comment added
Added lines 586-591:

(:nl:)>>messagehead<<

opensipnewbie?29 September 2010, 11:45

Is it possible to load balance in stateless mode?

September 22, 2010, at 06:21 AM by h3xd - Comment added
Added lines 580-585:

(:nl:)>>messagehead<<

h3xd?22 September 2010, 05:21

Can the LB be used to balance between multiple NAT traversal systems?

July 22, 2010, at 09:43 AM by Anh Ha - Comment added
Added lines 555-579:

(:nl:)>>messagehead<<

Anh Ha?22 July 2010, 08:43

In the Load_balancer tables :

 4  	 2  	 sip:192.168.1.1  	 pstn=300  	 0  	 VNP #1

In opensips.cfg:

if (uri=~"^sip:.....9[0-2]*@")

     {
   xlog("route to Vinaphone");
          load_balance("2","pstn");
        # route(4);
     }

when i call 99984917xxxx , it matches the condition but it doesn't route the call to 192.168.1.1 If i have "route(4);" bellow "load_balance("2","pstn");", then it routes follow route(4)

Please help me Tks

July 16, 2010, at 08:49 PM by SenthilO - Comment added
Added lines 549-554:

(:nl:)>>messagehead<<

16 July 2010, 19:49

is there a way to load balance based on calls per second (CPS) instead of total concurrent call? i have two sip carrier with 50 cps each and my auto dealers are dialing @ 60 calls per second.

March 11, 2010, at 10:10 AM by LouisFox - Comment added
Added lines 541-548:

(:nl:)>>messagehead<<

LouisFox?11 March 2010, 09:10

I have a PSTN VoIP Gateway that is sending and receiving VoIP SIP calls to a SIP Gateway on the internet. I have 3 WAN connections. Can I use the load balancer to do call load balancing between the VoIP Gateway and the SIP Proxy. Can the load balancer distribute the VoIP load between the 3 connections equally and then also to receive and forward calls from the SIP Gateway to the VoIP PSTN Gateway. It is a single Internet SIP Proxy Service. 8 Calls per link

February 18, 2010, at 01:50 PM by bogdan - removed, not related to LB topic
Changed line 253 from:
                if (!search_body("G711") )) {
to:
                if ( !search_body("G711") ) {
Added lines 363-364:

[bogdan] - upgrade from svn to the latest version and if you still have issue, pleas post on the users mailing list

Added lines 388-389:

[bogdan] - if the call is release properly (from signalling point of view, with a BYE) the LB will see the call as terminated and release the resources.

Added line 448:

[bogdan] - fixed, thank you

Added lines 457-459:

[bogdan] - the ACK (if properly formed by caller device) should contain the Route header and OpenSIPS will route it as sequential request (via loose_route() )

Added lines 467-468:

[bogdan] - update the IPs in DB and do via MI a "lb_reload"

Added lines 484-485:

[bogdan] - check if the mi_xmlrpc.so file really exists in the directory you configured

Added lines 497-498:

[bogdan] - that is a bit tricky as you have two engines for doing routing (but on different criteria) DR - prefix routing, LB - load routing; only if you chain them, like first DR to select a set of GWs(per prefix) and after that LB to choose one of the GWs from the DR set

Changed lines 504-505 from:

Hi Bogdan, is possible to assign variable in load_balance("$var(a0","vm") or load_balance("$avp(i:55)","vm") function?

to:

Hi Bogdan, is possible to assign variable in load_balance("$var(a0)","vm") or load_balance("$avp(i:55)","vm") function?

Added lines 507-509:

[bogdan] - starting with 1.6 yes

Changed lines 521-522 from:
to:

[bogdan] - see http://www.opensips.org/Resources/DocsTsStart ; it must be an error reported %%

Added lines 539-540:

[bogdan] - post your question on the user mailing list

February 18, 2010, at 01:33 PM by bogdan - removed, not related to LB topic
Deleted lines 325-330:

(:nl:)>>messagehead<<

Ken?19 April 2009, 04:25

Does anyone know where I can find a good instruction on how to successfully integrate OpenSIPS with Asterisk & A2Billing systems that would enable me use OpenSIPS for SIP registration while A2Billing + Asterisk perform billing/VoIP functions?

February 18, 2010, at 01:32 PM by bogdan - comments compacted
Changed lines 19-21 from:

A Workshop on this topic will be hold at Amoocon (former AsteriskTag) in Rostock, 4-5 May 2009

to:

A Workshop on this topic was held at Amoocon (former AsteriskTag) in Rostock, 4-5 May 2009

Added lines 286-287:

[bogdan] - there is no dependency (regarding the application you LB) - so you can have Yate, Asterisk, FreeSwitch, Cisco GW, Audiocodec GW, etc

Changed lines 290-291 from:

(:nl:)>>messagehead<<

bogdan18 March 2009, 10:35
to:

(:nl:)>>messagehead<<

20 March 2009, 02:41
Changed lines 293-295 from:

there is no dependency (regarding the application you LB) - so you can have Yate, Asterisk, FreeSwitch, Cisco GW, Audiocodec GW, etc

to:

This is nice and simple. I am still learning OpenSIPs, but is it possible to combine this with a registrar function? Looking how to combine Load Balancing to a few Asterisk servers with OpenSIP also performing the registration.

[bogdan] - Of course it is possible - if you look at the default opensips cfg (that has the registrar capabilities), for processing the INVITE requests you can use load_balancing() function. If you have issues, use the mailing list for getting help

Changed lines 298-299 from:

(:nl:)>>messagehead<<

20 March 2009, 02:41
to:

(:nl:)>>messagehead<<

haidavila?04 April 2009, 04:21
Changed lines 301-305 from:

This is nice and simple. I am still learning OpenSIPs, but is it possible to combine this with a registrar function? Looking how to combine Load Balancing to a few Asterisk servers with OpenSIP also performing the registration.

to:

Hi. I´ve installed the new version (1.5) and I'm using load_balancer module but I'm having a problem... When a SIP server goes down and if it had the best attributes, load_balancer keeps sending the calls to it and all my calls drop. Is this normal? Can Opensips notices that this server is not working and pass it to the next sip server?

Thank you!

[bogdan]- unfortunately in the current version (1.5) you can not disable from script a destination; but you can do it from outside, via MI command (lb_resize to 0); you can use exec() from script to run the opensipsctl and resize the 0 the guilty server. Hope it will help. - btw, we can do disable from script with 1.6

Changed lines 308-309 from:

(:nl:)>>messagehead<<

bogdan23 March 2009, 11:59
to:

(:nl:)>>messagehead<<

haidavila?11 April 2009, 03:21
Changed lines 311-313 from:

Of course it is possible - if you look at the default opensips cfg (that has the registrar capabilities), for processing the INVITE requests you can use load_balancing() function. If you have issues, use the mailing list for getting help

to:

Thank you bogdan, it really helped me.

Regards!

Changed lines 316-317 from:

(:nl:)>>messagehead<<

haidavila?04 April 2009, 04:21
to:

(:nl:)>>messagehead<<

elred?14 April 2009, 19:01
Changed lines 319-321 from:

Hi. I´ve installed the new version (1.5) and I'm using load_balancer module but I'm having a problem... When a SIP server goes down and if it had the best attributes, load_balancer keeps sending the calls to it and all my calls drop. Is this normal? Can Opensips notices that this server is not working and pass it to the next sip server?

Thank you!

to:

What if you have, let's say, 3 phones. You want each phone being able to contact each others. BUT, if you don't fall on the same server where the REGISTER was broadcasted, the PABX won't know the IP of the callee, and call won't be achieved. Is there a way to bounce REGISTER to multiple PABX ? Thanks !

[bogdan] - I do not think this is a typical case of LB (as there is some relation between the PBX you balance). What you can do is to separately deal with REGISTER and fork it (from LB server, with no LB) to all PBX and to do do LB only for INVITEs. Just an idea

Changed lines 326-327 from:

(:nl:)>>messagehead<<

bogdan06 April 2009, 21:16
to:

(:nl:)>>messagehead<<

Ken?19 April 2009, 04:25
Changed lines 330-331 from:

Hi haidavila, unfortunately in the current version (1.5) you can not disable from script a destination; but you can do it from outside, via MI command (lb_resize to 0); you can use exec() from script to run the opensipsctl and resize the 0 the guilty server. Hope it will help.

to:

Does anyone know where I can find a good instruction on how to successfully integrate OpenSIPS with Asterisk & A2Billing systems that would enable me use OpenSIPS for SIP registration while A2Billing + Asterisk perform billing/VoIP functions?

Changed lines 333-334 from:

(:nl:)>>messagehead<<

haidavila?11 April 2009, 03:21
to:

(:nl:)>>messagehead<<

asterisktech?21 April 2009, 14:25
Changed lines 336-338 from:

Thank you bogdan, it really helped me.

Regards!

to:

Hi,

I also would appreciate if someone could post here a howto of integration of opensips with asterisk.

asterisktech

[bogdan] - what kind of "integration" you have in mind? I mean what opensips to do and what asterisk to do.

Changed lines 345-346 from:

(:nl:)>>messagehead<<

elred?14 April 2009, 19:01
to:

(:nl:)>>messagehead<<

geejee?10 May 2009, 10:35
Changed lines 349-351 from:

What if you have, let's say, 3 phones. You want each phone being able to contact each others. BUT, if you don't fall on the same server where the REGISTER was broadcasted, the PABX won't know the IP of the callee, and call won't be achieved. Is there a way to bounce REGISTER to multiple PABX ? Thanks !

to:

Hi,

what I like to do is to connect more than one client (e.g. desktop phone and soft phone) to one asterisk sip account. Asterisk cannot handle this because only one client can register. So opensips should work as sort of client inbetween. Username/password verification should be done by Asterisk. Does anyone know how to do this and give me a sample configuration for opensips?

Thanks

Changed lines 360-361 from:

(:nl:)>>messagehead<<

bogdan15 April 2009, 11:50
to:

(:nl:)>>messagehead<<

sriram?09 June 2009, 18:15
Changed lines 363-368 from:

Elred, I do not think this is a typical case of LB (as there is some relation between the PBX you balance). What you can do is to separately deal with REGISTER and fork it (from LB server, with no LB) to all PBX and to do do LB only for INVITEs. Just an idea

to:

HI,

I am load balancing the calls between gateways with different port values. Say I have total of 15 ports, the load balance modules works fine till 15th call. At 16th call load balance fails(this is the only call made,means all 15 ports are free ) and I am not getting calls on the gateway if I don't issue lb_reload command. I would appreciate if someone could let me know any other method to call get the current load status automatically set without entering the lb_reload comman statement.

thanks

Changed lines 371-372 from:

(:nl:)>>messagehead<<

Ken?19 April 2009, 04:25
to:

(:nl:)>>messagehead<<

Javier?31 July 2009, 02:25
Deleted lines 374-379:

Does anyone know where I can find a good instruction on how to successfully integrate OpenSIPS with Asterisk & A2Billing systems that would enable me use OpenSIPS for SIP registration while A2Billing + Asterisk perform billing/VoIP functions?

(:nl:)>>messagehead<<

asterisktech?21 April 2009, 14:25
Changed lines 377-379 from:

I also would appreciate if someone could post here a howto of integration of opensips with asterisk.

asterisktech

to:

I'm getting the error: ERROR:core:yyparse: module 'mi_xmlrpc.so' not found in '/usr/local/lib/opensips/modules/' all the time whenever I try to use the load_balancer module. This is something I got since 1.5.1 and thought was a bug in that version and used dispatcher instead. Today, I made a fresh install of opensips 1.5.2 over a Centos 5.1 and got the same error. Could somebody point me in the right direction to solve this problem ?

thanks!

Changed lines 387-388 from:

(:nl:)>>messagehead<<

bogdan23 April 2009, 11:14
to:

(:nl:)>>messagehead<<

vaitek?01 August 2009, 10:17
Changed lines 390-391 from:

Hi asterisktech - what kind of "integration" you have in mind? I mean what opensips to do and what asterisk to do. Regards, Bogdan

to:

Hello Bogdan, Great work... what if one of balanced server has ended the call in case of the limit call time ? - OpenSIPS doesn't release resources as I realised... - how can I tell LB module that it should release resources? Is there any way to shere information about resources between LB and VOIP(switches,gateways,etc) ?

Changed lines 394-395 from:

(:nl:)>>messagehead<<

geejee?10 May 2009, 10:35
to:

(:nl:)>>messagehead<<

plimaye?02 August 2009, 20:33
Changed lines 397-405 from:

Hi,

what I like to do is to connect more than one client (e.g. desktop phone and soft phone) to one asterisk sip account. Asterisk cannot handle this because only one client can register. So opensips should work as sort of client inbetween. Username/password verification should be done by Asterisk. Does anyone know how to do this and give me a sample configuration for opensips?

Thanks

to:

Javier,

You need to uncomment mi_xmlrpc in Makefile to compile the module , but you will require xmlrpc-c and xmlrpc-c-devel installed ( I am using xmlrpc-c-1.16.6-1.1582 on Centos 5.3) to compile 1.5.2. So far its working but its not supported. Will update this if I find issues with xmlrpc-c version.

Changed lines 402-403 from:

(:nl:)>>messagehead<<

sriram?09 June 2009, 18:15
to:

(:nl:)>>messagehead<<

Javier?04 August 2009, 17:40
Changed lines 405-410 from:

HI,

I am load balancing the calls between gateways with different port values. Say I have total of 15 ports, the load balance modules works fine till 15th call. At 16th call load balance fails(this is the only call made,means all 15 ports are free ) and I am not getting calls on the gateway if I don't issue lb_reload command. I would appreciate if someone could let me know any other method to call get the current load status automatically set without entering the lb_reload comman statement.

thanks

to:

Plimaye, Thank you very much for your help. I did that and certainly, it was in the exclude modules at makefile. I commented it. After that, I ran make clean, make and make install again and compiled ok (no errors) but I can't find xmlrpc-c and xmlrpc-c-devel to install.

and every time I try to run opensips, I get:

ERROR:core:sr_load_module: could not open module <mi_xmlrpc.so>: mi_xmlrpc.so: cannot open shared object file: No such file or directory

and really mi_xmlrpc.so is there in the modules folder!!!

If you have any other suggestion, please let me know.

Thanks a lot again!

[bogdan] - check if your cfg file is pointing to the right directory for loading the modules

Deleted lines 422-476:

(:nl:)>>messagehead<<

Javier?31 July 2009, 02:25

Hi,

I'm getting the error: ERROR:core:yyparse: module 'mi_xmlrpc.so' not found in '/usr/local/lib/opensips/modules/' all the time whenever I try to use the load_balancer module. This is something I got since 1.5.1 and thought was a bug in that version and used dispatcher instead. Today, I made a fresh install of opensips 1.5.2 over a Centos 5.1 and got the same error. Could somebody point me in the right direction to solve this problem ?

thanks!

(:nl:)>>messagehead<<

vaitek?01 August 2009, 10:17

Hello Bogdan, Great work... what if one of balanced server has ended the call in case of the limit call time ? - OpenSIPS doesn't release resources as I realised... - how can I tell LB module that it should release resources? Is there any way to shere information about resources between LB and VOIP(switches,gateways,etc) ?

(:nl:)>>messagehead<<

plimaye?02 August 2009, 20:33

Javier,

You need to uncomment mi_xmlrpc in Makefile to compile the module , but you will require xmlrpc-c and xmlrpc-c-devel installed ( I am using xmlrpc-c-1.16.6-1.1582 on Centos 5.3) to compile 1.5.2. So far its working but its not supported. Will update this if I find issues with xmlrpc-c version.

(:nl:)>>messagehead<<

Javier?04 August 2009, 17:40

Plimaye, Thank you very much for your help. I did that and certainly, it was in the exclude modules at makefile. I commented it. After that, I ran make clean, make and make install again and compiled ok (no errors) but I can't find xmlrpc-c and xmlrpc-c-devel to install.

and every time I try to run opensips, I get:

ERROR:core:sr_load_module: could not open module <mi_xmlrpc.so>: mi_xmlrpc.so: cannot open shared object file: No such file or directory

and really mi_xmlrpc.so is there in the modules folder!!!

If you have any other suggestion, please let me know.

Thanks a lot again!

(:nl:)>>messagehead<<

bogdan06 August 2009, 15:49

Javier, check if your cfg file is pointing to the right directory for loading the modules.

November 12, 2009, at 10:41 PM by JG - Comment added
Added lines 534-550:

(:nl:)>>messagehead<<

JG?12 November 2009, 21:41

I just installed OpenSips but i just don't understand the configuration part for the LB, i just want to do something like this:

prefix 044 redirect to ZAP Channel 37 and ZAP Channel 38

One call to 37 and the next to 38 and if both are busy to the default unicall

Can you guys help me out...

Thanks in advanced

JG

October 30, 2009, at 11:14 AM by Raj - Comment added
Added lines 521-533:

(:nl:)>>messagehead<<

Raj?30 October 2009, 10:14

Hi Bogdam, I am using OpenSIPSv1.5.3 on centOS. If I load load_balancer.so the server start is failed. loadmodule "modules/load_balancer/load_balancer.so" modparam("load_balancer", "db_url","mysql://opensips:opensipsw@localhost/opensips"), I have created opensips user and password in db. Please suggest me with a solution if possible.

Raj

October 23, 2009, at 01:37 PM by anca_vamanu -
Changed lines 31-32 from:

Form the LB module perspective, the destinations are not homogeneous - they are not alike; and not only from capacity point of view, but also from what kind of services/resources they offer. For example, you may have a set of Yate/Asterisk boxes for media-related services -s ome of them are doing transcoding, other voicemail or conference, other simple announcement , other PSTN termination. But you may have mixed boxes - one box may do PSTN and voicemail in the same time. So each destination from the set may offer a different set of services/resources.

to:

Form the LB module perspective, the destinations are not homogeneous - they are not alike; and not only from capacity point of view, but also from what kind of services/resources they offer. For example, you may have a set of Yate/Asterisk boxes for media-related services -some of them are doing transcoding, other voicemail or conference, other simple announcement , other PSTN termination. But you may have mixed boxes - one box may do PSTN and voicemail in the same time. So each destination from the set may offer a different set of services/resources.

Changed line 64 from:

The resource detection is done in the OpenSIPS routing script, based on whatever information is appropriated. For example, looking at the RURI (dialled number) you can see if the call must go to PSTN or if it a voicemail or conference number; also, by looking at the codecs advertised in the SDP, you can figure out if transcoding is or not also required.

to:

The resource detection is done in the OpenSIPS routing script, based on whatever information is appropriated. For example, looking at the RURI (dialed number) you can see if the call must go to PSTN or if it a voicemail or conference number; also, by looking at the codecs advertised in the SDP, you can figure out if transcoding is or not also required.

October 23, 2009, at 01:36 PM by anca_vamanu -
Changed line 31 from:

Form the LB module perspective, the destinations are not homogeneous - they are not alike; and not only from capacity point of view, but also from what kind of services/resources they do offer. For example, you may have a set of Yate/Asterisk boxes for media-related services -s ome of them are doing transcoding, other voicemail or conference, other simple announcement , other PSTN termination. But you may have mixed boxes - one box may do PSTN and voicemail in the same time. So each destination from the set may offer a different set of services/resources.

to:

Form the LB module perspective, the destinations are not homogeneous - they are not alike; and not only from capacity point of view, but also from what kind of services/resources they offer. For example, you may have a set of Yate/Asterisk boxes for media-related services -s ome of them are doing transcoding, other voicemail or conference, other simple announcement , other PSTN termination. But you may have mixed boxes - one box may do PSTN and voicemail in the same time. So each destination from the set may offer a different set of services/resources.

October 23, 2009, at 01:35 PM by anca_vamanu -
Changed line 31 from:

Form the LB module perspective, the destinations are not homogeneous - they are not a like; and not only from capacity point of view, but also from what kind of services/resources they do offer. For example, you may have a set of Yate/Asterisk boxes for media-related services -s ome of them are doing transcoding, other voicemail or conference, other simple announcement , other PSTN termination. But you may have mixed boxes - one box may do PSTN and voicemail in the same time. So each destination from the set may offer a different set of services/resources.

to:

Form the LB module perspective, the destinations are not homogeneous - they are not alike; and not only from capacity point of view, but also from what kind of services/resources they do offer. For example, you may have a set of Yate/Asterisk boxes for media-related services -s ome of them are doing transcoding, other voicemail or conference, other simple announcement , other PSTN termination. But you may have mixed boxes - one box may do PSTN and voicemail in the same time. So each destination from the set may offer a different set of services/resources.

September 24, 2009, at 01:14 PM by bogdan - fixed CANCEL processing in script
Changed lines 230-232 from:
	if ( !t_check_trans() ) {
		if (is_method("CANCEL"))
			exit;
to:
	if ( is_method("CANCEL") ) {
		if ( t_check_trans() )
			t_relay();
		exit;
August 26, 2009, at 06:47 PM by ravi - Comment added
Added lines 512-519:

(:nl:)>>messagehead<<

ravi?26 August 2009, 17:47

Hi Bogdan, is possible to assign variable in load_balance("$var(a0","vm") or load_balance("$avp(i:55)","vm") function?

Ravi

August 18, 2009, at 09:27 PM by Ricardo - Comment added
Added lines 501-511:

(:nl:)>>messagehead<<

Ricardo?18 August 2009, 20:27

Hi Bogdan. Is possible to mix the load_balancer module with the LCR module?... i need the features from the LCR to route the calls, but also i need to know the status of a GW with E1/T1 and balance the load between several Gw's. Is this possible? Thanks

Ricardo.-

August 18, 2009, at 04:24 PM by Javier - Comment added
Added lines 486-500:

(:nl:)>>messagehead<<

Javier?18 August 2009, 15:24

Hi Bogdan,

Thank you for your suggestion "Javier, check if your cfg file is pointing to the right directory for loading the modules." Really, the opensips.cfg is pointing properly to the modules directory.

Any other suggestion ?

Thank you,

Javier.

August 14, 2009, at 06:04 PM by ravi - Comment added
Added lines 479-485:

(:nl:)>>messagehead<<

ravi?14 August 2009, 17:04

is there anyway, loadbalancer can get destination ip address dynamically. Ex: i have 3 asterisk servers to be load balanced but some time i want to upgrade one asterisk server that case i want to remove that asterisk server ip address from load balancer database is that possible?

August 08, 2009, at 01:52 AM by motto - Comment added
Added lines 471-478:

(:nl:)>>messagehead<<

motto?08 August 2009, 00:52

Hey,

 default load_balance configuration doesn't process "ACK" SIP packet from the Asterisk END, so the Asterisk after SIP ACK retransmiting several times hangup a call.
 Any idea on that ?
August 06, 2009, at 07:04 PM by Alp - Comment added
Added lines 463-469:

(:nl:)>>messagehead<<

Alp?06 August 2009, 18:04

There is one more bracket ')' in line if (!search_body("G711") )) {. It gives error.

August 06, 2009, at 06:32 PM by Alp - Comment added
Added lines 456-462:

(:nl:)>>messagehead<<

Alp?06 August 2009, 17:32

I added module Dialog.so and add modparam("dialog", "dlg_flag", 4) in opensips.cfg file and it works!!

August 06, 2009, at 05:49 PM by Alp - Comment added
Added lines 443-456:

(:nl:)>>messagehead<<

Alp?06 August 2009, 16:49

Hello, I am getting this error while initializing LB module. I couldnt find anything wrong why its getting me this error.

Aug 6 17:44:49 ubuntu /sbin/opensips[7696]: INFO:load_balancer:mod_init: Load-Balancer module - initializing Aug 6 17:44:49 ubuntu /sbin/opensips[7696]: ERROR:load_balancer:mod_init: Can't load dialog hooks Aug 6 17:44:49 ubuntu /sbin/opensips[7696]: ERROR:core:init_mod: failed to initialize module load_balancer Aug 6 17:44:49 ubuntu /sbin/opensips[7696]: ERROR:core:main: error while initializing modules

August 06, 2009, at 04:49 PM by bogdan - Comment added
Added lines 437-442:

(:nl:)>>messagehead<<

bogdan06 August 2009, 15:49

Javier, check if your cfg file is pointing to the right directory for loading the modules.

August 04, 2009, at 06:40 PM by Javier - Comment added
Added lines 418-436:

(:nl:)>>messagehead<<

Javier?04 August 2009, 17:40

Plimaye, Thank you very much for your help. I did that and certainly, it was in the exclude modules at makefile. I commented it. After that, I ran make clean, make and make install again and compiled ok (no errors) but I can't find xmlrpc-c and xmlrpc-c-devel to install.

and every time I try to run opensips, I get:

ERROR:core:sr_load_module: could not open module <mi_xmlrpc.so>: mi_xmlrpc.so: cannot open shared object file: No such file or directory

and really mi_xmlrpc.so is there in the modules folder!!!

If you have any other suggestion, please let me know.

Thanks a lot again!

August 02, 2009, at 09:33 PM by plimaye - Comment added
Added lines 410-417:

(:nl:)>>messagehead<<

plimaye?02 August 2009, 20:33

Javier,

You need to uncomment mi_xmlrpc in Makefile to compile the module , but you will require xmlrpc-c and xmlrpc-c-devel installed ( I am using xmlrpc-c-1.16.6-1.1582 on Centos 5.3) to compile 1.5.2. So far its working but its not supported. Will update this if I find issues with xmlrpc-c version.

August 01, 2009, at 11:17 AM by vaitek - Comment added
Added lines 403-409:

(:nl:)>>messagehead<<

vaitek?01 August 2009, 10:17

Hello Bogdan, Great work... what if one of balanced server has ended the call in case of the limit call time ? - OpenSIPS doesn't release resources as I realised... - how can I tell LB module that it should release resources? Is there any way to shere information about resources between LB and VOIP(switches,gateways,etc) ?

July 31, 2009, at 03:25 AM by Javier - Comment added
Added lines 389-403:

(:nl:)>>messagehead<<

Javier?31 July 2009, 02:25

Hi,

I'm getting the error: ERROR:core:yyparse: module 'mi_xmlrpc.so' not found in '/usr/local/lib/opensips/modules/' all the time whenever I try to use the load_balancer module. This is something I got since 1.5.1 and thought was a bug in that version and used dispatcher instead. Today, I made a fresh install of opensips 1.5.2 over a Centos 5.1 and got the same error. Could somebody point me in the right direction to solve this problem ?

thanks!

July 13, 2009, at 04:13 PM by bogdan -
Added line 190:

loadmodule "modules/rr/rr.so"

June 23, 2009, at 12:24 PM by bogdan -
Deleted lines 387-392:

(:nl:)>>messagehead<<

Helen?23 June 2009, 05:27

into the cigar likethe veins that drain<a href=www.youtube.com/orderviagraonline1>order viagra online</a>the penis; in thisarteries going tothat the pressurized [url=www.youtube.com/orderviagraonline1]order viagra usa[/url]close off. The bloodstiffens. That means

June 23, 2009, at 06:27 AM by Helen - Comment added
Added lines 386-392:

(:nl:)>>messagehead<<

Helen?23 June 2009, 05:27

into the cigar likethe veins that drain<a href=www.youtube.com/orderviagraonline1>order viagra online</a>the penis; in thisarteries going tothat the pressurized [url=www.youtube.com/orderviagraonline1]order viagra usa[/url]close off. The bloodstiffens. That means

June 09, 2009, at 07:15 PM by sriram - Comment added
Added lines 375-385:

(:nl:)>>messagehead<<

sriram?09 June 2009, 18:15

HI,

I am load balancing the calls between gateways with different port values. Say I have total of 15 ports, the load balance modules works fine till 15th call. At 16th call load balance fails(this is the only call made,means all 15 ports are free ) and I am not getting calls on the gateway if I don't issue lb_reload command. I would appreciate if someone could let me know any other method to call get the current load status automatically set without entering the lb_reload comman statement.

thanks

May 10, 2009, at 11:35 AM by geejee - Comment added
Added lines 361-374:

(:nl:)>>messagehead<<

geejee?10 May 2009, 10:35

Hi,

what I like to do is to connect more than one client (e.g. desktop phone and soft phone) to one asterisk sip account. Asterisk cannot handle this because only one client can register. So opensips should work as sort of client inbetween. Username/password verification should be done by Asterisk. Does anyone know how to do this and give me a sample configuration for opensips?

Thanks

April 23, 2009, at 12:14 PM by bogdan - Comment added
Added lines 355-360:

(:nl:)>>messagehead<<

bogdan23 April 2009, 11:14

Hi asterisktech - what kind of "integration" you have in mind? I mean what opensips to do and what asterisk to do. Regards, Bogdan

April 21, 2009, at 03:25 PM by asterisktech - Comment added
Added lines 345-354:

(:nl:)>>messagehead<<

asterisktech?21 April 2009, 14:25

Hi,

I also would appreciate if someone could post here a howto of integration of opensips with asterisk.

asterisktech

April 19, 2009, at 05:25 AM by Ken - Comment added
Added lines 339-344:

(:nl:)>>messagehead<<

Ken?19 April 2009, 04:25

Does anyone know where I can find a good instruction on how to successfully integrate OpenSIPS with Asterisk & A2Billing systems that would enable me use OpenSIPS for SIP registration while A2Billing + Asterisk perform billing/VoIP functions?

April 15, 2009, at 12:50 PM by bogdan - Comment added
Added lines 333-338:

(:nl:)>>messagehead<<

bogdan15 April 2009, 11:50

Elred, I do not think this is a typical case of LB (as there is some relation between the PBX you balance). What you can do is to separately deal with REGISTER and fork it (from LB server, with no LB) to all PBX and to do do LB only for INVITEs. Just an idea

April 14, 2009, at 08:01 PM by elred - Comment added
Added lines 325-332:

(:nl:)>>messagehead<<

elred?14 April 2009, 19:01

What if you have, let's say, 3 phones. You want each phone being able to contact each others. BUT, if you don't fall on the same server where the REGISTER was broadcasted, the PABX won't know the IP of the callee, and call won't be achieved. Is there a way to bounce REGISTER to multiple PABX ? Thanks !

April 11, 2009, at 04:21 AM by haidavila - Comment added
Added lines 317-324:

(:nl:)>>messagehead<<

haidavila?11 April 2009, 03:21

Thank you bogdan, it really helped me.

Regards!

April 06, 2009, at 10:16 PM by bogdan - Comment added
Added lines 310-316:

(:nl:)>>messagehead<<

bogdan06 April 2009, 21:16

Hi haidavila, unfortunately in the current version (1.5) you can not disable from script a destination; but you can do it from outside, via MI command (lb_resize to 0); you can use exec() from script to run the opensipsctl and resize the 0 the guilty server. Hope it will help.

April 04, 2009, at 05:21 AM by haidavila - Comment added
Added lines 302-309:

(:nl:)>>messagehead<<

haidavila?04 April 2009, 04:21

Hi. I´ve installed the new version (1.5) and I'm using load_balancer module but I'm having a problem... When a SIP server goes down and if it had the best attributes, load_balancer keeps sending the calls to it and all my calls drop. Is this normal? Can Opensips notices that this server is not working and pass it to the next sip server?

Thank you!

March 23, 2009, at 12:59 PM by bogdan - Comment added
Added lines 296-301:

(:nl:)>>messagehead<<

bogdan23 March 2009, 11:59

Of course it is possible - if you look at the default opensips cfg (that has the registrar capabilities), for processing the INVITE requests you can use load_balancing() function. If you have issues, use the mailing list for getting help

March 20, 2009, at 03:41 AM by Ian C - Comment added
Added lines 290-295:

(:nl:)>>messagehead<<

20 March 2009, 02:41

This is nice and simple. I am still learning OpenSIPs, but is it possible to combine this with a registrar function? Looking how to combine Load Balancing to a few Asterisk servers with OpenSIP also performing the registration.

March 18, 2009, at 11:35 AM by bogdan - Comment added
Added lines 284-289:

(:nl:)>>messagehead<<

bogdan18 March 2009, 10:35

there is no dependency (regarding the application you LB) - so you can have Yate, Asterisk, FreeSwitch, Cisco GW, Audiocodec GW, etc

March 18, 2009, at 11:34 AM by bogdan -
Changed line 19 from:
A Workshop on this topic will be hold at Amoocon (former AsteriskTag) in Rostock, 4-5 May 2009>><<
to:

A Workshop on this topic will be hold at Amoocon (former AsteriskTag) in Rostock, 4-5 May 2009

March 16, 2009, at 12:41 AM by Gavin - Comment added
Added lines 279-284:

(:nl:)>>messagehead<<

Gavin?15 March 2009, 23:41

Does this have to use Yate? Can Asterisk or FreeSwitch be used?

March 11, 2009, at 10:54 AM by bogdan -
Changed line 19 from:
[http://www.amoocon.de/talks/8|A Workshop on this topic] will be hold at Amoocon (former AsteriskTag) in Rostock, 4-5 May 2009>><<
to:
A Workshop on this topic will be hold at Amoocon (former AsteriskTag) in Rostock, 4-5 May 2009>><<
March 11, 2009, at 10:53 AM by bogdan -
Added lines 18-19:
[http://www.amoocon.de/talks/8|A Workshop on this topic] will be hold at Amoocon (former AsteriskTag) in Rostock, 4-5 May 2009>><<
March 09, 2009, at 08:30 PM by bogdan -
Added line 2:

This page has been visited 7552 times.

March 09, 2009, at 04:35 PM by bogdan -
Added line 192:

loadmodule "modules/load_balancer/load_balancer.so"

March 04, 2009, at 09:23 PM by bogdan -
Changed line 12 from:

The "load-balancing" functionality comes to replace the "dispatcher" one. The difference comes in having or not load information about the destinations where you are routing to:

to:

The "load-balancing" functionality comes to enhance the "dispatcher" one. The difference comes in having or not load information about the destinations where you are routing to:

March 04, 2009, at 09:04 PM by bogdan -
Changed lines 273-276 from:

to:

Comments

(:commentboxchrono:)

March 04, 2009, at 09:03 PM by bogdan -
Changed line 19 from:
to:

Changed line 125 from:
to:

Changed lines 129-273 from:

Here is the full configuration

to:

Here is the full configuration and script for performing LB between media peers.

Configuration

Let's consider the case previously described:

4 destinations/boxes in the LB set
    1) offers 30 channels for transcoding and 32 for PSTN
    2) offers 100 voicemail channels and 10 for transcoding
    3) offers 50 voicemail channels and 300 for conference
    4) offers 10 voicemail, 10 conference, 10 transcoding and 32 PSTN

This translated into the following setup:

+----+----------+------------------------+---------------------------------+
| id | group_id | dst_uri                | resources                       |
+----+----------+------------------------+---------------------------------+
|  1 |        1 | sip:yate1.mycluset.net | transc=30; pstn=32              |
|  2 |        1 | sip:yate2.mycluset.net | vm=100; transc=10               |
|  3 |        1 | sip:yate3.mycluset.net | vm=50; conf=300                 |
|  4 |        1 | sip:yate4.mycluset.net | vm=10;conf=10;transc=10;pstn=32 |
+----+----------+------------------------+---------------------------------+

OpenSIPS Scripting

debug=1
memlog=1

fork=yes
children=2
log_stderror=no
log_facility=LOG_LOCAL0

disable_tcp=yes
disable_dns_blacklist = yes

auto_aliases=no

check_via=no
dns=off
rev_dns=off

listen=udp:xxx.xxx.xxx.xxx:5060



loadmodule "modules/maxfwd/maxfwd.so"
loadmodule "modules/sl/sl.so"
loadmodule "modules/db_mysql/db_mysql.so"
loadmodule "modules/tm/tm.so"
loadmodule "modules/xlog/xlog.so"
loadmodule "modules/uri/uri.so"
loadmodule "modules/dialog/dialog.so"
loadmodule "modules/mi_fifo/mi_fifo.so"
loadmodule "modules/mi_xmlrpc/mi_xmlrpc.so"
loadmodule "modules/signaling/signaling.so"
loadmodule "modules/textops/textops.so"



modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

modparam("dialog", "dlg_flag", 13)
modparam("dialog", "db_mode", 1)
modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")

modparam("rr","enable_double_rr",1)
modparam("rr","append_fromtag",1)

modparam("load_balancer", "db_url","mysql://opensips:opensipsrw@localhost/opensips")


route{
	if (!mf_process_maxfwd_header("3")) {
		sl_send_reply("483","looping");
		exit;
	}


	if (!has_totag()) {
                # initial request
		record_route();
	} else {
		# sequential request -> obey Route indication
		loose_route();
                t_relay();
                exit;
        }

        # handle cancel and re-transmissions
	if ( !t_check_trans() ) {
		if (is_method("CANCEL"))
			exit;
	}


        # from now on we have only the initial requests
        if (!is_method("INVITE")) {
                send_reply("405","Method Not Allowed");
                exit;
        }

        # detect resources and do balancing
        if ($rU=~"^1") {
                # looks like a Conference call
                load_balance("1","conf");
        } else if ($rU=~"^2") {
                # looks like a VoiceMail call
                load_balance("1","vm");
        } else {
                # PSTN call, but the GWs supports only G711
                # for calls without G711, transcoding will be used on the GW
                if (!search_body("G711") )) {
                       load_balance("1","transc;pstn");
                } else {
                       load_balance("1","pstn");
                }
        }

        # LB function returns negative if no suitable destination (for requested resources) is found,
        # or if all destinations are full
        if ($retcode<0) {
             sl_send_reply("500","Service full");
             exit;
        }

	xlog("Selected destination is: $du\n");

        # send it out
	if (!t_relay()) {
		sl_reply_error();
	}
}



March 04, 2009, at 08:33 PM by bogdan -
Changed lines 53-56 from:
to:

For runtime, the LB module provides MI commands for:

  • reloading the definition of destination sets
  • changing the capacity for a resource for a destination
Changed lines 79-81 from:
to:

The LB module provides an MI function that allows the admin to inspect the current load over the destinations.

Changed lines 91-92 from:
  1. the winning destination is the one with the the biggest value for the minimum available load per resources.
to:
  1. the winning destination is the one with the biggest value for the minimum available load per resources.
Added lines 124-125:
Added lines 128-129:

Here is the full configuration

March 04, 2009, at 08:27 PM by bogdan -
Added lines 78-117:

The logic used by the LB module to select the destination is:

  1. gets the destination set based on the group_id (first parameter of the load_balance() function)
  2. selects from the set only the destinations that are able to provide the requested resources (second parameter of the load_balance() function)
  3. for the selected destinations, it evaluated the current load for each requested resource
  4. the winning destination is the one with the the biggest value for the minimum available load per resources.
Example:

4 destinations/boxes in the LB set
    1) offers 30 channels for transcoding and 32 for PSTN
    2) offers 100 voicemail channels and 10 for transcoding
    3) offers 50 voicemail channels and 300 for conference
    4) offers 10 voicemail, 10 conference, 10 transcoding and 32 PSTN

when calling load_balance("1","transc;pstn") ->

1) only boxes (1) and (4) will be selected at as they offer both transcoding and pstn

2) evaluating the load  :
    (1) transcoding - 10 channels used; PSTN - 18 used 
    (4) transcoding - 9 channels used; PSTN - 16 used 

   evaluating available load (capacity-load) :
    (1) transcoding - 20 channels used; PSTN - 14 used 
    (4) transcoding - 1 channels used; PSTN - 16 used 

3) for each box, the minimum available load (through all resources)
    (1) 14 (PSTN)
    (2) 1 (transcoding) 

4) final selected box in (1) as it has the the biggest (=14) available load for the most loaded resource.

The selection algorithm tries to avoid the intensive usage of a resource per box.

March 04, 2009, at 07:48 PM by bogdan -
Changed lines 71-74 from:
to:

The load_balance() will automatically create the dialog state for the call (in order to monitor it) and will also allocate the requested resources for it (from the selected box).
The function will set as destination URI ($du) the address of the selected destination/box.

The resources will be automatically released when the call terminates.

March 04, 2009, at 07:45 PM by bogdan -
Changed lines 16-19 from:
  • Load-balancer is load driven - LB routing logic is based primary on the load information.
to:
  • Load-balancer is load driven - LB routing logic is based primary on the load information. The LB module is using the DIALOG module in order to keep trace of the load (ongoing calls).
Added lines 55-72:

Using the LB functionality is very simple - you just have to pass to the LB module what kind of resources the call requires.

The resource detection is done in the OpenSIPS routing script, based on whatever information is appropriated. For example, looking at the RURI (dialled number) you can see if the call must go to PSTN or if it a voicemail or conference number; also, by looking at the codecs advertised in the SDP, you can figure out if transcoding is or not also required.


  if (!load_balance("1","transc;pstn")) {
      sl_send_reply("500","Service full");
      exit;
  }

The first parameter of the function identifies the LB set to be used (see the group_id column in the above DB snapshot). Second parameter is list of the required resource for the call.

March 04, 2009, at 07:36 PM by bogdan -
Added lines 31-52:

Example:

4 destinations/boxes in the LB set
    1) offers 30 channels for transcoding and 32 for PSTN
    2) offers 100 voicemail channels and 10 for transcoding
    3) offers 50 voicemail channels and 300 for conference
    4) offers 10 voicemail, 10 conference, 10 transcoding and 32 PSTN

This translated into the following setup:

+----+----------+------------------------+---------------------------------+
| id | group_id | dst_uri                | resources                       |
+----+----------+------------------------+---------------------------------+
|  1 |        1 | sip:yate1.mycluset.net | transc=30; pstn=32              |
|  2 |        1 | sip:yate2.mycluset.net | vm=100; transc=10               |
|  3 |        1 | sip:yate3.mycluset.net | vm=50; conf=300                 |
|  4 |        1 | sip:yate4.mycluset.net | vm=10;conf=10;transc=10;pstn=32 |
+----+----------+------------------------+---------------------------------+

March 04, 2009, at 07:26 PM by bogdan -
Changed lines 22-23 from:

When looking at the LB implementation in OpenSIPS we have 3 aspects:

to:

When looking at the LB implementation in OpenSIPS, we have 3 aspects:

Changed lines 26-32 from:

Requesting Load-balancing (resources)

to:

A destination is defined by its address (a SIP URI) and its description as capacity.

Form the LB module perspective, the destinations are not homogeneous - they are not a like; and not only from capacity point of view, but also from what kind of services/resources they do offer. For example, you may have a set of Yate/Asterisk boxes for media-related services -s ome of them are doing transcoding, other voicemail or conference, other simple announcement , other PSTN termination. But you may have mixed boxes - one box may do PSTN and voicemail in the same time. So each destination from the set may offer a different set of services/resources.

So, for each destination, the LB module defines the offered resources, and for each resource, it defines the capacity / maximum load as number of concurrent calls the destination can handle for that resource.

Invoking Load-balancing

March 04, 2009, at 07:05 PM by bogdan -
Added line 19:
Changed lines 22-23 from:
to:

When looking at the LB implementation in OpenSIPS we have 3 aspects:

Destination set

Requesting Load-balancing (resources)

The LB logic

March 04, 2009, at 06:43 PM by bogdan -
March 04, 2009, at 06:43 PM by bogdan -
Changed lines 7-8 from:

The "load-balancing" module comes to provide traffic routing based on load. Shortly, when OpenSIPS routes calls to a set of destinations, it is able to keep the load (as number of ongoing calls) The "load-balancing" functionality comes to replace the "dispatcher".

to:

The "load-balancing" module comes to provide traffic routing based on load. Shortly, when OpenSIPS routes calls to a set of destinations, it is able to keep the load status (as number of ongoing calls) of each destination and to choose to route to the less loaded destination (at that moment). OpenSIPS is aware of the capacity of each destination - it is preconfigured with the maximum load accepted by the destinations. To be more precise, when routing, OpenSIPS will consider the less loaded destination not the destination with the smallest number of ongoing calls, but the destination with the largest available slot.

Also, the "load-balancing" (LB) module is able to receive feedback from the destinations (if they are capable of). This mechanism is used for notifying OpenSIPS when the maximum capacity of a destination changed (like a GW with more or less E1 cards).

The "load-balancing" functionality comes to replace the "dispatcher" one. The difference comes in having or not load information about the destinations where you are routing to:

  • Dispatcher has no load information - it just blindly forwards calls to the destinations based on a probabilistic dispersion logic. It gets no feedback about the load of the destination (like how many calls that were sent actually were established or how many are still going).
  • Load-balancer is load driven - LB routing logic is based primary on the load information.
March 04, 2009, at 06:08 PM by bogdan -
Changed lines 7-8 from:
to:

The "load-balancing" module comes to provide traffic routing based on load. Shortly, when OpenSIPS routes calls to a set of destinations, it is able to keep the load (as number of ongoing calls) The "load-balancing" functionality comes to replace the "dispatcher".

March 04, 2009, at 05:57 PM by bogdan -
Deleted lines 4-6:

Load Balancing Intro

Added lines 6-12:

Load Balancing - how it works

March 04, 2009, at 05:35 PM by bogdan -
Added lines 6-11:

Load Balancing in OpenSIPS

Study Case: routing the media gateways

March 04, 2009, at 05:23 PM by bogdan -
Added lines 1-6:

Resources -> Documentation -> Tutorials -> Load Balancing

(:toc-float Table of Content:)


Load Balancing Intro


Page last modified on April 24, 2013, at 07:59 PM