Re: [OpenSIPS-Users] Problem with nat_traversal module

2010-12-08 Thread Peter P GMX
That did the trick


  |I had set rtpproxy_sock to 'NONE'
  |

Best regards
Peter

Duane Larson schrieb:
> For some reason OpenSIPS thinks you want to use RTP proxy.  Do you
> have anything in your config set up to use RTP Proxy.  Like any of the
> Exported Parameters or Exported Functions on this page
> http://www.opensips.org/html/docs/modules/1.6.x/nathelper.html
>  
>
>
>  
> On Tue, Dec 7, 2010 at 5:26 PM, Peter Steinbach  > wrote:
>
> Hi,
>
> I have enabled the nat_traversal module and installed mediaproxy.
>
> OpenSips starts but I get an error:
> Dec  8 02:04:48 bravis /usr/sbin/opensips[21198]:
> ERROR:nathelper:send_rtpp_command: can't connect to RTP proxy
> Dec  8 02:04:48 bravis /usr/sbin/opensips[21198]:
> ERROR:nathelper:send_rtpp_command: proxy  does not respond,
> disable it
>
> The configuration params are as follows:
> modparam("nat_traversal", "keepalive_state_file",
> "/var/run/opensips/keepalive_state")
> modparam("nat_traversal", "keepalive_interval", 90)
> modparam("nat_traversal", "keepalive_method", "OPTIONS")
>
> What am I missing here?
>
> --
> With kind regards
> Peter Steinbach
>
> Telefaks Services GmbH
> Theo-Geisel-Strasse 25
> D 61250 Usingen, Germany
> mailto:lists  (att) telefaks.de 
> Internet: www.telefaks.de 
>
>
>
> ___
> Users mailing list
> Users@lists.opensips.org 
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
>
> -- 
> --
> *--*--*--*--*--*
> Duane
> *--*--*--*--*--*
> --
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   

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


Re: [OpenSIPS-Users] Opensips 1.6.2 64bit debian package?

2010-10-08 Thread Peter P GMX
When installing via apt-get it only offers 1.6.0 for 64 bit. On a 32bit
machine it offers 1.6.2.
That's the reasion I am asking.

Best regards
Peter

Duane Larson schrieb:
>
> I believe the package you download from opensips is 32 and 64.  When
> you compile it on the server it will see that your platform is 64
> bit.  I've installed opensips on rackspace.com <http://rackspace.com>
> on debian 5 and it is 64 bit
>
>> On Oct 8, 2010 7:19 AM, "Peter P GMX" > <mailto:prometheus...@gmx.net>> wrote:
>>
>> Anybody knows where I can get an opensips 1.6.2 64bit debian package?
>>
>> Best regards
>> Peter
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org <mailto:Users@lists.opensips.org>
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   

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


[OpenSIPS-Users] Opensips 1.6.2 64bit debian package?

2010-10-08 Thread Peter P GMX
Anybody knows where I can get an opensips 1.6.2 64bit debian package?

Best regards
Peter

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


Re: [OpenSIPS-Users] 3 Questions about dispatcher module

2010-07-31 Thread Peter P GMX
Thanks,

we are on 1.5 now, so we will update to a more recent version then.

Best regards
Peter

Bogdan-Andrei Iancu schrieb:
> Hi Peter,
>
> I remember a recent fix about that and the fix was backported to 1.6 
> only days ago..
>
> I'm not sure what version (trunk / 1.6) and what release are you using, 
> but update from SVN and try again.
>
> Best regards,
> Bogdan
>
> Peter P GMX wrote:
>   
>> Hello Bogdan,
>>
>> thanks for this info.
>> Concerning Question 2 I try to find an example with opensipsctl to
>> disable a destination address (destination address are in the database):
>> opensipsctl fifo ds_set_state i 1sip:127.0.0.1:5080 # set inactive
>> Or am I doing wrong something here? Does this also update the database
>> table 'dispatcher' or is this non-persistent?
>>
>> Best regards
>> Peter
>>
>>
>> Bogdan-Andrei Iancu schrieb:
>>   
>> 
>>> Hi Peter,
>>>
>>> Peter P GMX wrote:
>>> 
>>>   
>>>> Hello,
>>>>
>>>> we want to use the dispatcher module for a very simple load balancing
>>>> with hash over callid or round robin (we have also tried the
>>>> load-balancer module but have problems when we want to use it for
>>>> generating 302 redirects).
>>>>
>>>> I have read that the dispatcher module "can be used as a stateless load
>>>> balancer, having no guarantee of fair distribution". However googling
>>>> around I have seen that nevertheless can handle
>>>> invites,progress,ringing,cancels,byes etc. correctly.
>>>>
>>>> Question #1:
>>>> Can I use e.g.
>>>>   if (method=="REGISTER" || method=="INVITE" || method=="CANCEL") {
>>>> ds_select_dst("2", "0");
>>>> forward();
>>>>   }
>>>> for this kind of routing in order to ensure that all messages belonging
>>>> to one call are always routed to the same destination?
>>>>   
>>>>   
>>>> 
>>> yes, that is correct, but include all methods (like ACK, BYE, UPDATE,
>>> PRACK, REFER, etc)
>>> 
>>>   
>>>> Question #2:
>>>> When using dispatcher with a database table for the proxies and gateways
>>>> we would like to disable certain proxies on the fly via the database by
>>>> an external application. Do we have to reload parts of OpenSIPS in order
>>>> to make the dispatcher module become aware of it? How can we do that?
>>>>   
>>>>   
>>>> 
>>> just use the "ds_set_state" MI command to enable/disable destinations
>>> at runtime - see
>>> http://www.opensips.org/html/docs/modules/1.6.x/dispatcher.html#id262730.
>>>
>>> For more complex changes, use the "ds_reload" to reload the entire table.
>>> 
>>>   
>>>> Question #3:
>>>> We would like to send back "302 redirect" for Invites, which are coming
>>>> from external gateways. Thus external gateways can directly communicate
>>>> with the proxy. How can we use the information (hostname, port etc) from
>>>> "ds_select_dst" in order to send back a 302 redirect message. I know it
>>>> is somehow stored in an AVP, but I have no example how the get the host
>>>> and port part out of it. Can you provide an example?
>>>>   
>>>>   
>>>> 
>>> use ds_select_domain() to get the RURI changed and simply do a
>>> sl_send_reply("302","Redirected"); -> RURI will be automatically
>>> copied as Contact in 30x reply.
>>>
>>> Regards,
>>> Bogdan
>>> 
>>>   
>>>> Best regards
>>>> Peter
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ___
>>>> Users mailing list
>>>> Users@lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>   
>>>>   
>>>> 
>>> 
>>>   
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>   
>> 
>
>
>   

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


Re: [OpenSIPS-Users] 3 Questions about dispatcher module

2010-07-22 Thread Peter P GMX
Hello Bogdan,

thanks for this info.
Concerning Question 2 I try to find an example with opensipsctl to
disable a destination address (destination address are in the database):
opensipsctl fifo ds_set_state i 1sip:127.0.0.1:5080 # set inactive
Or am I doing wrong something here? Does this also update the database
table 'dispatcher' or is this non-persistent?

Best regards
Peter


Bogdan-Andrei Iancu schrieb:
> Hi Peter,
>
> Peter P GMX wrote:
>> Hello,
>>
>> we want to use the dispatcher module for a very simple load balancing
>> with hash over callid or round robin (we have also tried the
>> load-balancer module but have problems when we want to use it for
>> generating 302 redirects).
>>
>> I have read that the dispatcher module "can be used as a stateless load
>> balancer, having no guarantee of fair distribution". However googling
>> around I have seen that nevertheless can handle
>> invites,progress,ringing,cancels,byes etc. correctly.
>>
>> Question #1:
>> Can I use e.g.
>>   if (method=="REGISTER" || method=="INVITE" || method=="CANCEL") {
>> ds_select_dst("2", "0");
>> forward();
>>   }
>> for this kind of routing in order to ensure that all messages belonging
>> to one call are always routed to the same destination?
>>   
> yes, that is correct, but include all methods (like ACK, BYE, UPDATE,
> PRACK, REFER, etc)
>> Question #2:
>> When using dispatcher with a database table for the proxies and gateways
>> we would like to disable certain proxies on the fly via the database by
>> an external application. Do we have to reload parts of OpenSIPS in order
>> to make the dispatcher module become aware of it? How can we do that?
>>   
> just use the "ds_set_state" MI command to enable/disable destinations
> at runtime - see
> http://www.opensips.org/html/docs/modules/1.6.x/dispatcher.html#id262730.
>
> For more complex changes, use the "ds_reload" to reload the entire table.
>> Question #3:
>> We would like to send back "302 redirect" for Invites, which are coming
>> from external gateways. Thus external gateways can directly communicate
>> with the proxy. How can we use the information (hostname, port etc) from
>> "ds_select_dst" in order to send back a 302 redirect message. I know it
>> is somehow stored in an AVP, but I have no example how the get the host
>> and port part out of it. Can you provide an example?
>>   
> use ds_select_domain() to get the RURI changed and simply do a
> sl_send_reply("302","Redirected"); -> RURI will be automatically
> copied as Contact in 30x reply.
>
> Regards,
> Bogdan
>> Best regards
>> Peter
>>
>>
>>
>>
>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>   
>
>


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


[OpenSIPS-Users] 3 Questions about dispatcher module

2010-07-21 Thread Peter P GMX
Hello,

we want to use the dispatcher module for a very simple load balancing
with hash over callid or round robin (we have also tried the
load-balancer module but have problems when we want to use it for
generating 302 redirects).

I have read that the dispatcher module "can be used as a stateless load
balancer, having no guarantee of fair distribution". However googling
around I have seen that nevertheless can handle
invites,progress,ringing,cancels,byes etc. correctly.

Question #1:
Can I use e.g.
  if (method=="REGISTER" || method=="INVITE" || method=="CANCEL") {
ds_select_dst("2", "0");
forward();
  }
for this kind of routing in order to ensure that all messages belonging
to one call are always routed to the same destination?

Question #2:
When using dispatcher with a database table for the proxies and gateways
we would like to disable certain proxies on the fly via the database by
an external application. Do we have to reload parts of OpenSIPS in order
to make the dispatcher module become aware of it? How can we do that?

Question #3:
We would like to send back "302 redirect" for Invites, which are coming
from external gateways. Thus external gateways can directly communicate
with the proxy. How can we use the information (hostname, port etc) from
"ds_select_dst" in order to send back a 302 redirect message. I know it
is somehow stored in an AVP, but I have no example how the get the host
and port part out of it. Can you provide an example?

Best regards
Peter






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


Re: [OpenSIPS-Users] ERROR:load_balancer:do_load_balance: failed to create dialog

2010-06-11 Thread Peter P GMX
Hello Bogdan,

you are right, there were some Registers in between, which caused this
message.

Best regards
Peter

Bogdan-Andrei Iancu schrieb:
> Hi Peter,
>
> if you do not get any prior err msg from create_dialog function, I 
> suspect you call the LB function for something not an initial INVITE - 
> could you check this?
>
> Regards,
> Bogdan
>
> Peter P GMX wrote:
>   
>> After upgrading Opensips from 1.5.3 to 1.6.2 we get the following errors:
>>   ERROR:load_balancer:do_load_balance: failed to create dialog
>>
>> Googling this error showed no results. Any hints where this comes from?
>>
>> here's the (anonymized) config file:
>>
>> 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:xx.xxx.xxx.167:5060
>> alias=udp:my.domain.de:5060
>>
>> mpath="/usr/local/lib64/opensips/modules/"
>>
>> loadmodule "maxfwd.so"
>> loadmodule "sl.so"
>> loadmodule "db_mysql.so"
>> loadmodule "tm.so"
>> loadmodule "xlog.so"
>> loadmodule "uri.so"
>> loadmodule "rr.so"
>> loadmodule "dialog.so"
>> loadmodule "mi_fifo.so"
>> #loadmodule "mi_xmlrpc.so"
>> loadmodule "signaling.so"
>> loadmodule "textops.so"
>> loadmodule "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://odbc:2dsf3f7hn84gh...@10.255.0.197/opensips")
>>
>> modparam("rr","enable_double_rr",1)
>> modparam("rr","append_fromtag",1)
>>
>> modparam("load_balancer",
>> "db_url","mysql://odbc:2dsf3f7hn84gh...@10.255.0.197/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;
>> }
>> }
>>
>># CANCEL processing #  || is_method("RINGING")
>>  if (is_method("CANCEL")) {
>> if (t_check_trans())
>> t_relay();
>> exit;
>>  }
>>
>>
>> # from now on we have only the initial requests
>> if (!is_method("INVITE") && !is_method("REGISTER")){   
>> # && !is_method("CANCEL")) {
>> send_reply("405","Method Not Allowed");
>> exit;
>> }
>>
>> # Load Balancing only for my.domain.de and if coming from external
>> if (!($si =~"^xx.xxx.xxx.16") && ($td=~"^my.domain.de" ||
>> $td=~"^xx.xxx.xxx.167")) {
>> # detect resources and do balancing
>> if ($si=~"^212.91.250.104") {
>> # looks like DNSN
>> append_hf("X-Original-IP: $si\r\n");
>> load_balance("1","external");
>> $ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
>> sl_send_reply("302", "redirect");
>> exit; #exit here as processing stops here
>> } else if ($si=~"^212.91.250.103") { # fill in QSC IP later
>> append_hf("X-Original-IP: $si\r\n");
>> load_balance("1","external");
>>  

Re: [OpenSIPS-Users] ERROR:load_balancer:do_load_balance: failed to create dialog

2010-06-09 Thread Peter P GMX
Nobody has an idea about this message?

Best regards
Peter

Peter P GMX schrieb:
> After upgrading Opensips from 1.5.3 to 1.6.2 we get the following errors:
>   ERROR:load_balancer:do_load_balance: failed to create dialog
>
> Googling this error showed no results. Any hints where this comes from?
>
> here's the (anonymized) config file:
>
> 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:xx.xxx.xxx.167:5060
> alias=udp:my.domain.de:5060
>
> mpath="/usr/local/lib64/opensips/modules/"
>
> loadmodule "maxfwd.so"
> loadmodule "sl.so"
> loadmodule "db_mysql.so"
> loadmodule "tm.so"
> loadmodule "xlog.so"
> loadmodule "uri.so"
> loadmodule "rr.so"
> loadmodule "dialog.so"
> loadmodule "mi_fifo.so"
> #loadmodule "mi_xmlrpc.so"
> loadmodule "signaling.so"
> loadmodule "textops.so"
> loadmodule "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://user:pas...@10.255.0.197/opensips")
>
> modparam("rr","enable_double_rr",1)
> modparam("rr","append_fromtag",1)
>
> modparam("load_balancer",
> "db_url","mysql://user:pas...@10.255.0.197/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;
> }
> }
>
># CANCEL processing #  || is_method("RINGING")
>  if (is_method("CANCEL")) {
> if (t_check_trans())
> t_relay();
> exit;
>  }
>
>
> # from now on we have only the initial requests
> if (!is_method("INVITE") && !is_method("REGISTER")){   
> # && !is_method("CANCEL")) {
> send_reply("405","Method Not Allowed");
> exit;
> }
>
> # Load Balancing only for my.domain.de and if coming from external
> if (!($si =~"^xx.xxx.xxx.16") && ($td=~"^my.domain.de" ||
> $td=~"^xx.xxx.xxx.167")) {
> # detect resources and do balancing
> if ($si=~"^212.91.250.104") {
> # looks like DNSN
> append_hf("X-Original-IP: $si\r\n");
> load_balance("1","external");
> $ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
> sl_send_reply("302", "redirect");
> exit; #exit here as processing stops here
> } else if ($si=~"^212.91.250.103") { # fill in QSC IP later
> append_hf("X-Original-IP: $si\r\n");
> load_balance("1","external");
> $ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
> sl_send_reply("302", "redirect");
> exit; #exit here as processing stops here
> } else if ($si=~"^212.88.143.228") { # VSEN
> append_hf("X-Original-IP: $si\r\n");
> load_balance("1","external");
> $ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
> sl_send_reply("302", "redirect");
> exit; #exit here as processing stops here
> } else {
> # Enter ogiginal IP header
> append_hf("X-Original-IP: $si\r\n");
> # Forward to the freeswitches
> load_balance("1","internal");
> }
> if ($retcode<0) {
> sl_send_reply("500","Service full");
> exit;
> }
> } else { # no load balancing, pass back from HA to public net
> if (($si=~"^xx.xxx.xxx.168") || ($si=~"^xx.xxx.xxx.169")) {
> xlog("ru=$ru Ru=$rU td=$td tn=$tn");
> } else {
> # block these calls
> exit;
> }
> }
> # send it out for all domains
> if (!t_relay()) {
> sl_reply_error();
> }
> }
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   

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


[OpenSIPS-Users] ERROR:load_balancer:do_load_balance: failed to create dialog

2010-06-08 Thread Peter P GMX
After upgrading Opensips from 1.5.3 to 1.6.2 we get the following errors:
  ERROR:load_balancer:do_load_balance: failed to create dialog

Googling this error showed no results. Any hints where this comes from?

here's the (anonymized) config file:

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:xx.xxx.xxx.167:5060
alias=udp:my.domain.de:5060

mpath="/usr/local/lib64/opensips/modules/"

loadmodule "maxfwd.so"
loadmodule "sl.so"
loadmodule "db_mysql.so"
loadmodule "tm.so"
loadmodule "xlog.so"
loadmodule "uri.so"
loadmodule "rr.so"
loadmodule "dialog.so"
loadmodule "mi_fifo.so"
#loadmodule "mi_xmlrpc.so"
loadmodule "signaling.so"
loadmodule "textops.so"
loadmodule "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://odbc:2dsf3f7hn84gh...@10.255.0.197/opensips")

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

modparam("load_balancer",
"db_url","mysql://odbc:2dsf3f7hn84gh...@10.255.0.197/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;
}
}

   # CANCEL processing #  || is_method("RINGING")
 if (is_method("CANCEL")) {
if (t_check_trans())
t_relay();
exit;
 }


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

# Load Balancing only for my.domain.de and if coming from external
if (!($si =~"^xx.xxx.xxx.16") && ($td=~"^my.domain.de" ||
$td=~"^xx.xxx.xxx.167")) {
# detect resources and do balancing
if ($si=~"^212.91.250.104") {
# looks like DNSN
append_hf("X-Original-IP: $si\r\n");
load_balance("1","external");
$ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
sl_send_reply("302", "redirect");
exit; #exit here as processing stops here
} else if ($si=~"^212.91.250.103") { # fill in QSC IP later
append_hf("X-Original-IP: $si\r\n");
load_balance("1","external");
$ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
sl_send_reply("302", "redirect");
exit; #exit here as processing stops here
} else if ($si=~"^212.88.143.228") { # VSEN
append_hf("X-Original-IP: $si\r\n");
load_balance("1","external");
$ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
sl_send_reply("302", "redirect");
exit; #exit here as processing stops here
} else {
# Enter ogiginal IP header
append_hf("X-Original-IP: $si\r\n");
# Forward to the freeswitches
load_balance("1","internal");
}
if ($retcode<0) {
sl_send_reply("500","Service full");
exit;
}
} else { # no load balancing, pass back from HA to public net
if (($si=~"^xx.xxx.xxx.168") || ($si=~"^xx.xxx.xxx.169")) {
xlog("ru=$ru Ru=$rU td=$td tn=$tn");
} else {
# block these calls
exit;
}
}
# send it out for all domains
if (!t_relay()) {
sl_reply_error();
}
}


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


[OpenSIPS-Users] Load balancer - releasing resources

2009-12-23 Thread Peter P GMX
Hello,

we use OpenSIPS as a load balancer in front of a Freeswitch cluster. We
use the load_balancer module for load_balancing and redirecting requests
to this 2 machines.
For each machine we have defined a number of resources (e.g. 3000 for
each server). After a while these resources are full, so the load
balancer module does not balance any more.
Here some extract from the routing:
if ($si=~"^xxx.xx.xxx.xxx") {
# redirect external gateways to the right server
load_balance("1","external");
$ru = "sip:" + $rU + "@" + $dd + ":" + $dp;
sl_send_reply("302", "redirect");
exit;
} else {
} else {
# load balance all registered phones through OpenSIPS
load_balance("1","internal");

 }

if (!t_relay()) {
sl_reply_error();
}

My main question is: Does OpenSIPS automatically release the load
balancer resources after a while? Or does it release when a SIP session
is ended?
We have now set the resources to 3 but we do not know for how
long they may last.

Best regards
Peter

 

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


Re: [OpenSIPS-Users] Load balancer and Access control list

2009-10-19 Thread Peter P GMX
I now implemented a solution in Freeswitch. I created a whitelist based
on defined external gateways and IPs of registered UAs.
Now only whitelisted IPs are routed inside Freeswitch.

I am looking forward to seeing the memcached implementation in the next
OpenSIPS release. That way I can share the whitelisted IPs quickly with
OpenSIPS and may block Invites in OpenSIPS based on a whitelist in
memcached. This is less CPU intensive.

Best regards
Peter


Raúl Alexis Betancor Santana schrieb:
> Bogdan-Andrei Iancu escribió:
>   
>> So, in such a case, a real working solution will be to have opensips to 
>> spoof the source IP of the outbound request? but this may really break 
>> the transaction Only if the spoofing is done with skipping the VIA 
>> insertion.
>>
>> Regards,
>> Bogdan
>>   
>> 
>
> Spoofing IP's is the worst solution, you could not asure that packages 
> will arrive at the gw ... imagine there are firewalls between ... and 
> lot of more problems.
>
>  From my POV, if he need to go throught the proxy ... better to 
> translate the acl validations to the proxy.
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   

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


Re: [OpenSIPS-Users] Load balancer and Access control list

2009-10-19 Thread Peter P GMX
Hello,

I tried the 302 redirect now in 2 different methods:
$ru = "sip:06912345...@yy.yyy.yyy.163:5062"; # rewite complete
contact address
rewritehostport("yy.yyy.yyy.163:5062"); # rewite host
and port
and then
sl_send_reply("302", "redirected");

In all cases OpenSIPS sends back a 302 message with the new contact
information yy.yyy.yyy.163.
The originating UA then takes the contact information into consideration
in the TO: header, however it still sends the message to the previous IP
yy.yyy.yyy.165 (OpenSIPS again) instead of 163 (Freeswitch).

I tried this with 2 SIP clients, they both behave the same.
What am I doing wrong?

Best regards
Peter

Log:

U 21x.xx.xx.189:3072 -> yy.yyy.yyy.165:5060
INVITE sip:06912345...@my.domain.de;user=phone SIP/2.0.
Via: SIP/2.0/UDP 21x.xx.xx.189:3072;branch=z9hG4bK-idw0po3hlbg0;rport.
From: "0691234568" ;tag=cel72sxvyb.
To: .
Call-ID: 3c2f57565d8d-8yv4cbrq6v5b.
CSeq: 1 INVITE.
Max-Forwards: 70.
Contact: ;reg-id=1.
P-Key-Flags: keys="3".
User-Agent: snom320/7.3.23.
Accept: application/sdp.
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE,
PRACK, MESSAGE, INFO.
Allow-Events: talk, hold, refer, call-info.
Supported: timer, 100rel, replaces, from-change.
Session-Expires: 3600;refresher=uas.
Min-SE: 90.
Content-Type: application/sdp.
Content-Length: 438.
.
v=0.
o=root 129069374 129069374 IN IP4 21x.xx.xx.189.
s=call.
c=IN IP4 21x.xx.xx.189.
t=0 0.
m=audio 12656 RTP/AVP 8 0 9 3 18 4 101.
a=rtpmap:8 pcma/8000.
a=rtpmap:0 pcmu/8000.
a=rtpmap:9 g722/8000.
a=rtpmap:3 gsm/8000.
a=rtpmap:18 g729/8000.
a=rtpmap:4 g723/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=alt:1 1.0 : user 9kksj== 21x.xx.xx.189 12656.
a=alt:2 0.9 : user 9kksj== 192.168.178.50 12656.
a=sendrecv.

#
U yy.yyy.yyy.165:5060 -> 21x.xx.xx.189:3072
SIP/2.0 302 redirected.
Via: SIP/2.0/UDP 21x.xx.xx.189:3072;branch=z9hG4bK-idw0po3hlbg0;rport=3072.
From: "0691234568" ;tag=cel72sxvyb.
To:
;tag=6cdcba1e6882dd91c9dc4f84b97dd379.39cc.
Call-ID: 3c2f57565d8d-8yv4cbrq6v5b.
CSeq: 1 INVITE.
Contact: sip:06912345...@yy.yyy.yyy.163:5062.
Server: OpenSIPS (1.5.3-notls (x86_64/linux)).
Content-Length: 0.
.

#
U 21x.xx.xx.189:3072 -> yy.yyy.yyy.165:5060
ACK sip:06912345...@my.domain.de;user=phone SIP/2.0.
Via: SIP/2.0/UDP 21x.xx.xx.189:3072;branch=z9hG4bK-idw0po3hlbg0;rport.
From: "0691234568" ;tag=cel72sxvyb.
To:
;tag=6cdcba1e6882dd91c9dc4f84b97dd379.39cc.
Call-ID: 3c2f57565d8d-8yv4cbrq6v5b.
CSeq: 1 ACK.
Max-Forwards: 70.
Contact: ;reg-id=1.
Content-Length: 0.
.

#
U 21x.xx.xx.189:3072 -> yy.yyy.yyy.165:5060
INVITE sip:06912345...@yy.yyy.yyy.163:5062 SIP/2.0.
Via: SIP/2.0/UDP 21x.xx.xx.189:3072;branch=z9hG4bK-xeu8ee8qazdw;rport.
From: "0691234568" ;tag=do1om35a01.
To: sip:06912345...@yy.yyy.yyy.163:5062.
Call-ID: 3c2f5756b590-r2mmsx66il1v.
CSeq: 1 INVITE.
Max-Forwards: 70.
Contact: ;reg-id=1.
P-Key-Flags: keys="3".
User-Agent: snom320/7.3.23.
Accept: application/sdp.
Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE,
PRACK, MESSAGE, INFO.
Allow-Events: talk, hold, refer, call-info.
Supported: timer, 100rel, replaces, from-change.
Session-Expires: 3600;refresher=uas.
Min-SE: 90.
Content-Type: application/sdp.
Content-Length: 438.
.
v=0.
o=root 129069374 129069375 IN IP4 21x.xx.xx.189.
s=call.
c=IN IP4 21x.xx.xx.189.
t=0 0.
m=audio 12656 RTP/AVP 8 0 9 3 18 4 101.
a=rtpmap:8 pcma/8000.
a=rtpmap:0 pcmu/8000.
a=rtpmap:9 g722/8000.
a=rtpmap:3 gsm/8000.
a=rtpmap:18 g729/8000.
a=rtpmap:4 g723/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=ptime:20.
a=alt:1 1.0 : user 9kksj== 21x.xx.xx.189 12656.
a=alt:2 0.9 : user 9kksj== 192.168.178.50 12656.
a=sendrecv.

Bogdan-Andrei Iancu schrieb:
> Hi Peter,
>
> Interesting - the LB was not designed to work via 3xx redirect model, 
> even so, with some changes, it is possible to do it.
>
> On the other side, can you trick FS to look for the IP (used for ACLs) 
> somewhere else than the net level (src IP) ? maybe you can configure LB 
> to put the original SRC IP into a SIP header into the request.
>
> Regards,
> Bogdan
>
> Peter P GMX wrote:
>   
>> Hello,
>>
>> I am using OpenSIPS as a load balancer in front of Freeswitch by using
>> the load balancer module.
>> Scenario: All phones are registered at Freeswitch. Some gateways provide
>> calls via registered accounts  and some external gateways are accepted
>> by their IPs (access control list, ACL).
>>
>> When using OpenSIPS in front of Freeswitch I am losing the ACL feature
>> for some external gateways, as from Freeswitch's perpective all calls
>> are now coming from OpenSIPS.
>>
>> Does anybody know how to solve this ACL problem? Is there a way load
>> balance by redirecting invites (302 Moved temporaril

Re: [OpenSIPS-Users] Load balancer and Access control list

2009-10-19 Thread Peter P GMX
I tried this, but Freeswitch doesn't condider the SIP header here. In
the ACL it uses the real IP the request comes from.

Alex Massover schrieb:
>> Do you have a hint how to do that?
>> 
> [Alex]
>
> append_hf("X-Original-IP: $si\r\n");
>
> something like this.
>
> BR,
> Alex.
>
>   
>> Best regards
>> Peter
>>
>> Bogdan-Andrei Iancu schrieb:
>> 
>>> Hi Peter,
>>>
>>> Interesting - the LB was not designed to work via 3xx redirect model,
>>> even so, with some changes, it is possible to do it.
>>>
>>> On the other side, can you trick FS to look for the IP (used for
>>>   
>> ACLs)
>> 
>>> somewhere else than the net level (src IP) ? maybe you can configure
>>>   
>> LB
>> 
>>> to put the original SRC IP into a SIP header into the request.
>>>
>>> Regards,
>>> Bogdan
>>>
>>> Peter P GMX wrote:
>>>
>>>   
>>>> Hello,
>>>>
>>>> I am using OpenSIPS as a load balancer in front of Freeswitch by
>>>> 
>> using
>> 
>>>> the load balancer module.
>>>> Scenario: All phones are registered at Freeswitch. Some gateways
>>>> 
>> provide
>> 
>>>> calls via registered accounts  and some external gateways are
>>>> 
>> accepted
>> 
>>>> by their IPs (access control list, ACL).
>>>>
>>>> When using OpenSIPS in front of Freeswitch I am losing the ACL
>>>> 
>> feature
>> 
>>>> for some external gateways, as from Freeswitch's perpective all
>>>> 
>> calls
>> 
>>>> are now coming from OpenSIPS.
>>>>
>>>> Does anybody know how to solve this ACL problem? Is there a way load
>>>> balance by redirecting invites (302 Moved temporarily) to
>>>> 
>> Freeswitch?
>> 
>>>> Then the gateway will contact Freeswitch directly and ACLs will
>>>> 
>> still apply.
>> 
>>>> So is there any load balancing feature in OpenSIPS which uses
>>>> 
>> redirects
>> 
>>>> or do I have to implement it by myself? E.g. by a perl script which
>>>> changes the redirect IP on every request (e.g. round robin).
>>>>
>>>> Best regards
>>>> Peter
>>>>
>>>>
>>>>
>>>>
>>>> ___
>>>> Users mailing list
>>>> Users@lists.opensips.org
>>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>>
>>>> 
>>> ___
>>> Users mailing list
>>> Users@lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>   
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>> This mail was received via Mail-SeCure System.
>>
>> 
>
>
> This mail was sent via Mail-SeCure System.
>
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   

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


Re: [OpenSIPS-Users] Load balancer and Access control list

2009-10-19 Thread Peter P GMX
Hello Bogdan,

> maybe you can configure LB 
> to put the original SRC IP into a SIP header into the request.

Do you have a hint how to do that?

Best regards
Peter

Bogdan-Andrei Iancu schrieb:
> Hi Peter,
>
> Interesting - the LB was not designed to work via 3xx redirect model, 
> even so, with some changes, it is possible to do it.
>
> On the other side, can you trick FS to look for the IP (used for ACLs) 
> somewhere else than the net level (src IP) ? maybe you can configure LB 
> to put the original SRC IP into a SIP header into the request.
>
> Regards,
> Bogdan
>
> Peter P GMX wrote:
>   
>> Hello,
>>
>> I am using OpenSIPS as a load balancer in front of Freeswitch by using
>> the load balancer module.
>> Scenario: All phones are registered at Freeswitch. Some gateways provide
>> calls via registered accounts  and some external gateways are accepted
>> by their IPs (access control list, ACL).
>>
>> When using OpenSIPS in front of Freeswitch I am losing the ACL feature
>> for some external gateways, as from Freeswitch's perpective all calls
>> are now coming from OpenSIPS.
>>
>> Does anybody know how to solve this ACL problem? Is there a way load
>> balance by redirecting invites (302 Moved temporarily) to Freeswitch?
>> Then the gateway will contact Freeswitch directly and ACLs will still apply.
>> So is there any load balancing feature in OpenSIPS which uses redirects
>> or do I have to implement it by myself? E.g. by a perl script which
>> changes the redirect IP on every request (e.g. round robin).
>>
>> Best regards
>> Peter
>>
>>
>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>   
>> 
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   

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


[OpenSIPS-Users] Load balancer and Access control list

2009-10-16 Thread Peter P GMX
Hello,

I am using OpenSIPS as a load balancer in front of Freeswitch by using
the load balancer module.
Scenario: All phones are registered at Freeswitch. Some gateways provide
calls via registered accounts  and some external gateways are accepted
by their IPs (access control list, ACL).

When using OpenSIPS in front of Freeswitch I am losing the ACL feature
for some external gateways, as from Freeswitch's perpective all calls
are now coming from OpenSIPS.

Does anybody know how to solve this ACL problem? Is there a way load
balance by redirecting invites (302 Moved temporarily) to Freeswitch?
Then the gateway will contact Freeswitch directly and ACLs will still apply.
So is there any load balancing feature in OpenSIPS which uses redirects
or do I have to implement it by myself? E.g. by a perl script which
changes the redirect IP on every request (e.g. round robin).

Best regards
Peter




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


Re: [OpenSIPS-Users] Load balancer and CANCEL requests

2009-09-23 Thread Peter P GMX
Hello,

I put some additional code to handle the cancel request. Now ist works.
Here is the code I put :
# CANCEL processing
if (is_method("CANCEL")) {
if (t_check_trans())
t_relay();
exit;
}

Best regards
Peter


Peter P GMX schrieb:
> Hello Bogdan,
>
> we only very slightly modified the openser.cfg:
> We only added the
> REGISTER in
> if (!is_method("INVITE") && !is_method("REGISTER")){
> in order to balance resgisters to the Freeswitch cluster.
>
> and added
> # Load Balancing only for my.domain
> if ($td=~"^my.domain") {
> in order to handle outbound requests to other phones through OpenSIPS.
> This is needed to produce our test case when making a call between 2 phones.
>
> While putting in some debugging lines I found out that
> # handle cancel and re-transmissions
> if ( !t_check_trans() ) {
> if (is_method("CANCEL")) {
> is not successful during the cancel request. So !t_check_trans() seems
> to be false in that case as ismethod("CANCEL") is not called.
> Then is continues the script and sends a 405 message.
>
> Howwver the INVITE and CANCEL reequest had the same call-id.
>
> Here's my opensips.conf:
> =
> 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:xx.xx.xx.xx:5060
> alias=udp:my.domain:5060
>
> mpath="/usr/local/lib64/opensips/modules/"
>
> loadmodule "maxfwd.so"
> loadmodule "sl.so"
> loadmodule "db_mysql.so"
> loadmodule "tm.so"
> loadmodule "xlog.so"
> loadmodule "uri.so"
> loadmodule "rr.so"
> loadmodule "dialog.so"
> loadmodule "mi_fifo.so"
> #loadmodule "mi_xmlrpc.so"
> loadmodule "signaling.so"
> loadmodule "textops.so"
> loadmodule "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://user:p...@localhost/opensips")
>
> modparam("rr","enable_double_rr",1)
> modparam("rr","append_fromtag",1)
>
> modparam("load_balancer", "db_url","mysql://user:p...@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") && !is_method("REGISTER")){
> send_reply("405","Method Not Allowed");
> exit;
> }
>
> # Load Balancing only for my.domain
> if ($td=~"^my.domain") {
> # detect resources and do balancing
> if ($rU=~"^conference") {
> # looks like a Conference call
> load_balance("1","conf");
> } else if ($rU=~"^voicemail") {
> # looks like a VoiceMail call
> load_balance("1","vm");
> } else {
> # Forward to the freeswitches
> load_balance("1","freeswitch");
> }
>
> # 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 for all domains
> if (!t_relay()) {
> sl_reply_error();
> }
> }
>
>
> Bogdan-Andrei Iancu schrieb:
>   
>> Hello Peter,
>>
>> First of all the script from the tutorial does LB only for initial 
>> requests, requests that are creating a dialog (like INVITE). All other 
>> sequential requests (in dialog requests) are routed based on Route 
>> header, directly to the FS where the call was sent.
>>
>> The CANCELs are processed in a stateful way. The CANCELs are matched 
>> against the INVITE transaction and automatically sent to the same 
>> destination where the INVITE was sent. The rele

Re: [OpenSIPS-Users] Change SIP response code

2009-09-23 Thread Peter P GMX
Another hint to that,

we have the problem that our B2BUA (Cirpack) send SIP 500 messages when
the SIP Codes does not match the Q.850 reason code when e.g. a user is
busy or unavailable. (e.g. reason Code "16,nomal clearing" in the 486
SIP message when "17, user busy" should be there.)

You may also check if this is the case in your environment.

Best regards
Peter

Mauro Davì schrieb:
> Hi Josip,
>
> I think that the below answer could be the solution:
>
> http://www.openser.org/pipermail/users/2006-January/002692.html
>
> Regards
> MD
>
> Josip Djuricic ha scritto:
>>
>> Dear,
>>
>>  
>>
>> What would be the best way to change SIP response message from 5xx to
>> 4xx. The problem is we have client with a broken b2bua which sends
>> SIP 500 Expired after the user does not answer the phone, so I would
>> like to change it to SIP 480 Temporarily unavailable message before
>> sending it back.
>>
>>  
>>
>> if (search("^Expired*")) {
>>
>> sl_send_reply("480", "Temporarily Unavailable");
>>
>> break;
>>
>> };
>>
>>  
>>
>> I thought about something like that but that would match also the
>> initial invite that has Expired valule in it, so I would need to
>> match only SIP 500 message with string Expired in it.
>>
>>  
>>
>> Thank you
>>
>>  
>>
>> Josip
>>
>> 
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>   
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   

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


Re: [OpenSIPS-Users] Load balancer and CANCEL requests

2009-09-23 Thread Peter P GMX
Hello Bogdan,

we only very slightly modified the openser.cfg:
We only added the
REGISTER in
if (!is_method("INVITE") && !is_method("REGISTER")){
in order to balance resgisters to the Freeswitch cluster.

and added
# Load Balancing only for my.domain
if ($td=~"^my.domain") {
in order to handle outbound requests to other phones through OpenSIPS.
This is needed to produce our test case when making a call between 2 phones.

While putting in some debugging lines I found out that
# handle cancel and re-transmissions
if ( !t_check_trans() ) {
if (is_method("CANCEL")) {
is not successful during the cancel request. So !t_check_trans() seems
to be false in that case as ismethod("CANCEL") is not called.
Then is continues the script and sends a 405 message.

Howwver the INVITE and CANCEL reequest had the same call-id.

Here's my opensips.conf:
=
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:xx.xx.xx.xx:5060
alias=udp:my.domain:5060

mpath="/usr/local/lib64/opensips/modules/"

loadmodule "maxfwd.so"
loadmodule "sl.so"
loadmodule "db_mysql.so"
loadmodule "tm.so"
loadmodule "xlog.so"
loadmodule "uri.so"
loadmodule "rr.so"
loadmodule "dialog.so"
loadmodule "mi_fifo.so"
#loadmodule "mi_xmlrpc.so"
loadmodule "signaling.so"
loadmodule "textops.so"
loadmodule "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://user:p...@localhost/opensips")

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

modparam("load_balancer", "db_url","mysql://user:p...@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") && !is_method("REGISTER")){
send_reply("405","Method Not Allowed");
exit;
}

# Load Balancing only for my.domain
if ($td=~"^my.domain") {
# detect resources and do balancing
if ($rU=~"^conference") {
# looks like a Conference call
load_balance("1","conf");
} else if ($rU=~"^voicemail") {
# looks like a VoiceMail call
load_balance("1","vm");
} else {
# Forward to the freeswitches
load_balance("1","freeswitch");
}

# 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 for all domains
if (!t_relay()) {
sl_reply_error();
}
}


Bogdan-Andrei Iancu schrieb:
> Hello Peter,
>
> First of all the script from the tutorial does LB only for initial 
> requests, requests that are creating a dialog (like INVITE). All other 
> sequential requests (in dialog requests) are routed based on Route 
> header, directly to the FS where the call was sent.
>
> The CANCELs are processed in a stateful way. The CANCELs are matched 
> against the INVITE transaction and automatically sent to the same 
> destination where the INVITE was sent. The relevant script part is:
>
> # handle cancel and re-transmissions
>   if ( !t_check_trans() ) {
>   if (is_method("CANCEL"))
>   exit;
>   }
>
>
> So, the script does properly handle the CANCELs and there is nothing 
> else required to make it work.
>
> My question is, using the script as per tutorial (no changes of yours), 
> what happens when OpenSIPS does receive a CANCEL?
>
> Regards,
> Bogdan
>
> Peter P GMX wrote:
>   
>> Hello,
>>
>> I am using the load balancer in front of a Freeswitch cluster.
>> Freeswitch is always in the SIP route.
>> It handles Registers and Invites quite well.
>>
>> However CANCEL is not working according to the tutorial in
>> http://www.opensips.org/index.php?n=Resources.DocsTutLoadbalanci

[OpenSIPS-Users] Load balancer and CANCEL requests

2009-09-22 Thread Peter P GMX
Hello,

I am using the load balancer in front of a Freeswitch cluster.
Freeswitch is always in the SIP route.
It handles Registers and Invites quite well.

However CANCEL is not working according to the tutorial in
http://www.opensips.org/index.php?n=Resources.DocsTutLoadbalancing

CANCEL requests are aborted with 405 Method Not Allowed.
I understand that CANCELS should not be balanced as it cannot be forseen
which Freeswitch will receive this CANCEL request, right? Or does the
load balancer handle this correctly based on a call id?

So I tried to allow CANCEL in

 if (!is_method("INVITE") && !is_method("REGISTER")) &&
!is_method("CANCEL")) {
...

This leads to "500 Service full", means some error occured.

Question: How can I handle the CANCEL request correctly?

Best regards
Peter



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