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] Can you drop a 487 Request Terminated?

2012-03-01 Thread Bogdan-Andrei Iancu

Hi,

any call must have a final response (rejected or answered)...So you can 
discard the 487 from GW, but you need to provide an anwer back to 
callerI guess you do not want to let the guy in dead air :P


Regards,
Bogdan

On 03/01/2012 07:11 PM, discodo...@aol.com wrote:
Thanks.  So other than that there is no way to just discard/drop the 
487 response from the gateway and not pass it to caller. Like send the 
reply to a black hole?



-Original Message-
From: Vlad Paiu 
To: users 
Sent: Thu, Mar 1, 2012 1:41 am
Subject: Re: [OpenSIPS-Users] Can you drop a 487 Request Terminated?

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.



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

___
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



--
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


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

2012-03-01 Thread discodog62
Thanks.  So other than that there is no way to just discard/drop the 487 
response from the gateway and not pass it to caller. Like send the reply to a 
black hole?



-Original Message-
From: Vlad Paiu 
To: users 
Sent: Thu, Mar 1, 2012 1:41 am
Subject: Re: [OpenSIPS-Users] Can you drop a 487 Request Terminated?


  Hello,

You can arm a failure_route for the Invites to the gateways, andinside 
the failure_route change the status code to whatever you wantby 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 letme know if this is possible.   
 







___
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] Can you drop a 487 Request Terminated?

2012-03-01 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.



___
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] Can you drop a 487 Request Terminated?

2012-02-29 Thread discodog62

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")) 
{
xl