Re: [OpenSIPS-Users] Failover Solution in OpenSIPS

2012-03-05 Thread pa...@eremina.net
I do it with  do_routing, like this:

route {
...
#do lookup with method filtering
...some default config

if (do_routing())  { route(1); } else { sl_send_reply("404","No route"); exit; }
#when routing via usrloc,...

failure_route {
... some default config
#at the end of block
if (t_check_status("(50.)|(40.)|(6..)") {
 if (!use_next_gw()) {
exit;
 } else { route(1); }

}
}

is this solution has some bad code(logicaly)?

2012/3/6 Vlad Paiu :
> Hello,
>
> You have to catch the failure in failure_route, and based on the status code
> ( 408 is internally generated by OpenSIPS in case no reply, or other
> response codes that you want ), mark the trunk as disabled, either by
> lb_disable() or ds_mark_dst(), and call again the load_balance() or
> ds_select_dst() to let OpenSIPS choose another destination.
>
> Regards,
>
> Vlad Paiu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
> Pe 3/5/2012 9:54 PM, Faisal Rehman a scris:
>
> Hi Everyone,
>
> I have different sip trunks, I want to implement the fail over solution with
> dispatcher/load balancer. Means if call fails from one trunk/gateway, like
> if we get 503 Service Un-available from one trunk call should be routed to
> next trunk. Basic routing should be handled from dispatcher but if the call
> is failed the call should be routed to next trunk according to my
> dispatcher. I want to implement both timer based and response based fail
> over, so any suggestions for such implementation?
>
>
> Regards,
>
> Faisal Rehman
>
>
> ___
> 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] Reply Reason in failure route

2012-03-05 Thread Ryan Bullock
Wow, how many times have I missed that line in the docs.

Thank you very much, that was exactly what I needed.

Regards,

Ryan

On Mon, Mar 5, 2012 at 3:20 PM, Vlad Paiu  wrote:
> Hello,
>
> The reason for this is that, in the failure_route, you are working with the
> failed Request, and not with the reply.
> Please go to [1], and check the context part of a pseudovariable.  In short,
> to access the reply code from within failure route, try
>     $(rr)
>
> [1] http://www.opensips.org/Resources/DocsCoreVar
>
> Regards,
>
> Vlad Paiu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
> Pe 3/6/2012 1:13 AM, Ryan Bullock a scris:
>
> Is there anyway to get the reply reason (e.g "Service Unavailable") of
> the current reply in failure_route? $T_reply_code gets me the code,
> but I would like to log/check the reason for some specific responses
> we get.
>
> $rr does not seem to get populated for the failure route either.
>
> Thanks.
>
> Regards,
>
> Ryan
>
> ___
> 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] Reply Reason in failure route

2012-03-05 Thread Vlad Paiu

Hello,

The reason for this is that, in the failure_route, you are working with 
the failed Request, and not with the reply.
Please go to [1], and check the context part of a pseudovariable.  In 
short, to access the reply code from within failure route, try

$(rr)

[1] http://www.opensips.org/Resources/DocsCoreVar

Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com

Pe 3/6/2012 1:13 AM, Ryan Bullock a scris:

Is there anyway to get the reply reason (e.g "Service Unavailable") of
the current reply in failure_route? $T_reply_code gets me the code,
but I would like to log/check the reason for some specific responses
we get.

$rr does not seem to get populated for the failure route either.

Thanks.

Regards,

Ryan

___
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] Reply Reason in failure route

2012-03-05 Thread Ryan Bullock
Is there anyway to get the reply reason (e.g "Service Unavailable") of
the current reply in failure_route? $T_reply_code gets me the code,
but I would like to log/check the reason for some specific responses
we get.

$rr does not seem to get populated for the failure route either.

Thanks.

Regards,

Ryan

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


Re: [OpenSIPS-Users] Can you drop a 487 Request Terminated?

2012-03-05 Thread Vlad Paiu

Hello,

You can arm a failure_route for the Invites to the gateways, and inside 
the failure_route change the status code to whatever you want by doing

t_reply("500","Cannot Route");

or whatever message that you want.

Regards,
Vlad

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com


On 03/01/2012 08:33 AM, discodo...@aol.com wrote:
When I setup a call then cancel the call I am getting a 487 from my 
gateway that is relayed to the client.
I don't wish to show the 487 to the client.  Is it possible to drop 
the reply for the 487?


I am hoping someone could let me know if this is possible.

I am running opensips 1.7  Here is a copy of my config as well.

debug=4
log_stderror=no
log_facility=LOG_LOCAL0

fork=yes
children=4
disable_tcp=yes
auto_aliases=yes
sip_warning=yes

listen=udp:10.8.1.139:5060

group=nobody
user=nobody

server_header="ZZZ"
server_signature = off
user_agent_header="User-Agent: ZZZ"

### Modules Section 

#set module path
mpath="/usr/local/lib64/opensips/modules/"
loadmodule "db_text.so"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri.so"
loadmodule "domain.so"
loadmodule "permissions.so"
loadmodule "userblacklist.so"
loadmodule "dialog.so"

modparam("domain|userblacklist|dialog|permissions", 
"db_url","text:///zxa/server/opensipsDNC")

modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("rr", "append_fromtag", 0)
modparam("uri", "use_uri_table", 0)
modparam("domain", "db_mode", 1)   # Use caching

### Routing Logic 

# main request routing logic

route{

xlog("=== TOP ===");
xlog(" tu= $tu | fu= $fu | od= $od | ReceivedINT: $Ri | 
SourceIP: $si %%%");

if ( $si == "10.8.1.139") && ( $Ri == "10.8.1.139")
{
exit;
}
if (!check_address("1","$si","$sp","$proto"))
{

xlog("=== ACCESS FAILED ===");
xlog("=== $si| $sp | $proto ===");
sl_send_reply("403","Forbidden");
exit;

}

if (!mf_process_maxfwd_header("10"))
{
   xlog("=== TOO MANY HOPS ===");
sl_send_reply("483","Too Many Hops");
exit;
}

#CANCEL processing
if (is_method("CANCEL"))
{
   xlog("=== CANCEL 76 ===");
if (t_check_trans())
t_relay();
exit;
}
if (is_method("PUBLISH"))
{
sl_send_reply("503", "Service Unavailable");
exit;
}
if (has_totag())
{
xlog("=== HAS TO TAG ===");

if (loose_route())
{
xlog("=== HAS LOOSE ===");
if (is_method("BYE"))
{
 xlog("=== LOOSE BYE ===");
 route(3);
 exit;
} else if (is_method("INVITE")) {
xlog("=== RE-INVITE LOOSE ===");
record_route();
}
xlog("In loouse going to Route 1");
route(1);
} else {
if ( is_method("ACK") )
{
xlog("=== LOOSE ELSE ACK ===");
if ( t_check_trans() )
{
t_relay();
exit;
} else {
xlog("=== LOOSE Discard ACK ===");
exit;
}
}

sl_send_reply("404","Not here");
}
exit;
}

t_check_trans();

if (loose_route())
{
xlog("L_ERR","Attempt to route with preloaded Route's 
[$fu/$tu/$ru/$ci]");

if (!is_method("ACK"))
{
sl_send_reply("403","Preload Route denied");
 exit;
}
}

# record routing
if (!is_method("REGISTER|MESSAGE"))
{
record_route();
}

if (!is_uri_host_local())
{
xlog("Not local so lets just see what happens $rd");
route(1);
}

if ($rU==NULL)
{
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
if (is_method("INVITE") && (!has_totag()) )
{
xlog("||  NEW CALL ||");
}
route(2);

send_reply("420", "Invalid Extension");
exit;
}


route[1] {
# RTP Proxy handling ---#
xlog("=== ROUTE 1 ===");
rewritehostport("10.8.1.44:5060");
if (is_method("INVITE")) {
t_on_reply("1");
t_on_failure("1");
}
if (!t_relay())
{
sl_reply_error();
}
exit;
}

route[2] {
xlog("=== ROUTE 2 ===");
if (!check_blacklist("userblacklist"))
{
xlog('~~~  BLACKLISTED DID Forbidden ~~~');
sl_send_reply("403", "DID Forbidden");
exit;
}
route(1);

}

route[3] {
  xlog("=== ROUTE 3 ===");
  t_on_reply("1");
  t_on_failure("1");
  t_relay("udp:10.8.1.44:5060");

}

branch_route[1] {
xlog("new branch at $ru\n");
}


onreply_route[1] {
xlog("=== ON REPLY ROUTE 2  rs= $rs | fu= $fu | si= $si | Ri= $Ri 
===");

if (t_check_status("487"))
{

Re: [OpenSIPS-Users] Failover Solution in OpenSIPS

2012-03-05 Thread Vlad Paiu

Hello,

You have to catch the failure in failure_route, and based on the status 
code ( 408 is internally generated by OpenSIPS in case no reply, or 
other response codes that you want ), mark the trunk as disabled, either 
by lb_disable() or ds_mark_dst(), and call again the load_balance() or 
ds_select_dst() to let OpenSIPS choose another destination.


Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com

Pe 3/5/2012 9:54 PM, Faisal Rehman a scris:

Hi Everyone,

I have different sip trunks, I want to implement the fail over 
solution with dispatcher/load balancer. Means if call fails from one 
trunk/gateway, like if we get 503 Service Un-available from one trunk 
call should be routed to next trunk. Basic routing should be handled 
from dispatcher but if the call is failed the call should be routed to 
next trunk according to my dispatcher. I want to implement both timer 
based and response based fail over, so any suggestions for such 
implementation?


Regards,

Faisal Rehman


___
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] Failover Solution in OpenSIPS

2012-03-05 Thread Faisal Rehman
Hi Everyone,

I have different sip trunks, I want to implement the fail over solution with 
dispatcher/load balancer. Means if call fails from one trunk/gateway, like if 
we get 503 Service Un-available from one trunk call should be routed to next 
trunk. Basic routing should be handled from dispatcher but if the call is 
failed the call should be routed to next trunk according to my dispatcher. I 
want to implement both timer based and response based fail over, so any 
suggestions for such implementation?

 
Regards,


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


[OpenSIPS-Users] Failover Solution in OpenSIPS

2012-03-05 Thread Faisal Rehman
Hi Everyone,

I have different sip trunks, I want to implement the fail over solution with 
dispatcher/load balancer. Means if call fails from one trunk/gateway, like if 
we get 503 Service Un-available from one trunk call should be routed to next 
trunk. Basic routing should be handled from dispatcher but if the call is 
failed the call should be routed to next trunk according to my dispatcher. I 
want to implement both timer based and response based fail over, so any 
suggestions for such implementation?

 
Regards,


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


[OpenSIPS-Users] Fwd: SIPp-OpenSIPS-SIPp TLS problem

2012-03-05 Thread Tarik Tankovic
Hi,

my problem is solved.

I found proposal to increase value of MAX_SSL_RETRIES parameter in the
tls_server.c file in the topic: "Failed INVITE tcp_send" from the
december 2009. I did exactly that, so It is O.K. now.

I also understand that this solution has an impact on the performance
on the TLS OpenSIPS proxy. I am using OpenSIPS 1.6.0 version and I
wonder whether version 1.7.2 of OpenSIPS would work with the older,
smaller value of MAX_SSL_RETRIES parameter?

Thanks,

Tarik

-- Forwarded message --
From: Tarik Tankovic 
Date: Sat, 3 Mar 2012 11:01:50 +0100
Subject: SIPp-OpenSIPS-SIPp TLS problem
To: users 

Hi,

as usual I am having a problem with my SIPp-OpenSIPS-SIPp configuration.

First SIPp is working as UAC and the second one is working as UAS. I
am trying to implement TLS on both links (1. link SIPp(UAC)-OpenSIPS
and 2. link OpenSIPS-SIPp(UAS)).

I managed to implement TLS on the first link and even on the second
one but when OpenSIPS starts to send SIP messages over TCP to second
SIPp (UAS) it failed. You can see log in the attachment. When I change
to TCP on the second link everything works. I am a little bit puzzled
what is a problem.

I even tried to create two TLS domains in the opensips.cfg file
(TLS_server_domain for incoming traffic from the first SIPp and the
TLS_client_domain for outgoing traffic to the second SIPp) but I was
not able. I did something wrong.

Thanks in advance,

Tarik

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


[OpenSIPS-Users] opensipsctl fifo reload_blacklist not reloading

2012-03-05 Thread discodog62
I am having an issue when I update my userblacklist file then call opensipsctl 
fifo reload_blacklist.  I see that the date updates on my FIFO file but when I 
try to test the updated numbers to verify that they are blocked my test fails 
and the number dials.


I then restart opensips and test again and the updated numbers are now blocked.


I am not sure if this matters but the file size of my FIFO is 0. 


I am using dbtext


modparam("userblacklist", "db_url","text:///zxa/server/opensipsdb")


Have I missed a setting?


Thanks,


James






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


Re: [OpenSIPS-Users] Repeating message in logs ...

2012-03-05 Thread Bogdan-Andrei Iancu

Hi Sebastian,

There are things which are initialized per process. And as you have 
multiple processes, it i normal to see such messages several times - but 
if you check, they should be only once per process .


Regards,
Bogdan

On 03/05/2012 04:55 PM, Sebastian Sastre wrote:

Hi,

Im having a some what interesting thing going on a new opensips 
instalation i did. Althought everything seems to work fine (acc module 
leaves CDR's call's get routed and so forth)
In the logs i keep seeing this  "INFO:core:buf_init: initializing... " 
right before a new packet is received.


I have not seen this happen before, however this is the first time 
trying version 1.6.4-2.


Is this normal?  I use mainly *Load_balancer*  , *sip_Trace* and *acc* .

Mar  4 22:59:28 proxybdialer48 /usr/local/sbin/opensips[18303]: 
INFO:core:buf_init: initializing...
Mar  4 22:59:28 proxybdialer48 /usr/local/sbin/opensips[18303]: -> 
Reply(2) - Incoming reply
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18305]: 
INFO:db_mysql:re_init_statement:  query  is (msg,callid,method,status,fromip,toip,time_stamp,direction,fromtag,traced_user 
) values (?,?,?,?,?,?,?,?,?,?)>, ptr=(nil)
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18305]: 
INFO:core:buf_init: initializing...
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18305]: -> 
Reply(2) - Incoming reply
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18307]: 
INFO:db_mysql:re_init_statement:  query  is (msg,callid,method,status,fromip,toip,time_stamp,direction,fromtag,traced_user 
) values (?,?,?,?,?,?,?,?,?,?)>, ptr=(nil)
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18307]: 
INFO:core:buf_init: initializing...
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18307]: -> 
Reply(2) - Incoming reply
Mar  4 22:59:45 proxybdialer48 /usr/local/sbin/opensips[18309]: 
INFO:db_mysql:re_init_statement:  query  is (msg,callid,method,status,fromip,toip,time_stamp,direction,fromtag,traced_user 
) values (?,?,?,?,?,?,?,?,?,?)>, ptr=(nil)
Mar  4 22:59:45 proxybdialer48 /usr/local/sbin/opensips[18309]: 
INFO:core:buf_init: initializing...
Mar  4 22:59:45 proxybdialer48 /usr/local/sbin/opensips[18309]: -> 
Reply(2) - Incoming reply
Mar  4 22:59:45 proxybdialer48 /usr/local/sbin/opensips[18292]: 
INFO:core:buf_init: initializing...



Thanks


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



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

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


[OpenSIPS-Users] Repeating message in logs ...

2012-03-05 Thread Sebastian Sastre
Hi,

Im having a some what interesting thing going on a new opensips instalation
i did. Althought everything seems to work fine (acc module leaves CDR's
call's get routed and so forth)
In the logs i keep seeing this  "INFO:core:buf_init: initializing... "
right before a new packet is received.

I have not seen this happen before, however this is the first time trying
version 1.6.4-2.

Is this normal?  I use mainly *Load_balancer*  , *sip_Trace* and *acc* .

Mar  4 22:59:28 proxybdialer48 /usr/local/sbin/opensips[18303]:
INFO:core:buf_init: initializing...
Mar  4 22:59:28 proxybdialer48 /usr/local/sbin/opensips[18303]: -> Reply(2)
- Incoming reply
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18305]:
INFO:db_mysql:re_init_statement:  query  is , ptr=(nil)
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18305]:
INFO:core:buf_init: initializing...
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18305]: -> Reply(2)
- Incoming reply
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18307]:
INFO:db_mysql:re_init_statement:  query  is , ptr=(nil)
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18307]:
INFO:core:buf_init: initializing...
Mar  4 22:59:31 proxybdialer48 /usr/local/sbin/opensips[18307]: -> Reply(2)
- Incoming reply
Mar  4 22:59:45 proxybdialer48 /usr/local/sbin/opensips[18309]:
INFO:db_mysql:re_init_statement:  query  is , ptr=(nil)
Mar  4 22:59:45 proxybdialer48 /usr/local/sbin/opensips[18309]:
INFO:core:buf_init: initializing...
Mar  4 22:59:45 proxybdialer48 /usr/local/sbin/opensips[18309]: -> Reply(2)
- Incoming reply
Mar  4 22:59:45 proxybdialer48 /usr/local/sbin/opensips[18292]:
INFO:core:buf_init: initializing...


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


[OpenSIPS-Users] to connect sipp-opensips-sipp and trace packets

2012-03-05 Thread prasad kelkar
hello
i did connection between sipp-opensips-sipp, but I am not getting 180 and
200 messages.
i have attached some files.
I also want to trace packets to count number of call per seconds. How can I
do it?
Please help.
Thank you in advance.


opensips.cfg
Description: Binary data


opensipsctlrc
Description: Binary data


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


Re: [OpenSIPS-Users] Opensips 1.7.2 and topology_hiding()

2012-03-05 Thread Vlad Paiu

Hello,

Yes, indeed, the Contact in that 200 Ok is bogus.
Can you please, privately, send me your OpenSIPS script ? There have 
recently been some fixes that should allow the use of topology_hiding() 
and mangling of the Contact header.
But a requirement for this to work is that topology_hiding() is the last 
function that modifies the Contact header.


Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com


On 03/05/2012 08:02 AM, dpa wrote:


Hello!

I am trying to use Opensips 1.7.2 with topology_hiding() and the 
result is in attachment


2.2.2.2 – Some gateway

1.1.1.1 – Opensips

3.3.3.3 – my softphone

Call direction

Caller (softphone) – Opensips -  Callee (some gateway)

I want to pay attention on 200 ОК which was sent from Opensips to the 
caller, particularly to Contact header.


I think because of the Contact my softphone does not sent ACK.

Thank toy for any help.


___
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