SIP/2.0 477 Send failed (477/TM) - Route

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

SIP/2.0 477 Send failed (477/TM) - Route

leo
Hello,

I'm receiving the following message when a try to place a call:
SIP/2.0 477 Send failed (477/TM)

This is desired issue because the callee UA is not online and in userloc it is not expired yet.

My question is, which would be the process or the route this event (477 Send failed) is processed? I've tried to log on failure_route, onreply_route and even on branch_route but it was unsuccessful.

Thanks a lot,

Leo
Reply | Threaded
Open this post in threaded view
|

Re: SIP/2.0 477 Send failed (477/TM) - Route

Bogdan-Andrei Iancu-2
Hi Leo,

If you look in your logs, you should see some errors where OpenSIPS
complains about not being able to open some TCP connection. Basically
OpenSIPS tried to forward the call by TCP but failed for some reasons
(TCP related). Check the logs.

Regards,

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

On 17.03.2015 18:37, leo wrote:

> Hello,
>
> I'm receiving the following message when a try to place a call:
> SIP/2.0 477 Send failed (477/TM)
>
> This is desired issue because the callee UA is not online and in userloc it
> is not expired yet.
>
> My question is, which would be the process or the route this event (477 Send
> failed) is processed? I've tried to log on failure_route, onreply_route and
> even on branch_route but it was unsuccessful.
>
> Thanks a lot,
>
> Leo
>
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/SIP-2-0-477-Send-failed-477-TM-Route-tp7595929.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


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

Re: SIP/2.0 477 Send failed (477/TM) - Route

leo
Hello Bogdan,

Yes, you're correct. But my point is how could i manage that situation?
From my very little knowledge it won't come as failure_route so my interest is, having that situation: how could i trigger other script options (like redirect to the voicemail or other process)?

Is it in the TM module? From the logs i see this:

Mar 22 14:41:58 sip-lab /usr/sbin/opensips[17721]: DBG:core:tcp_send: no open tcp connection found, opening new one
Mar 22 14:42:09 sip-lab /usr/sbin/opensips[17721]: ERROR:core:tcp_blocking_connect: timeout 10 s elapsed from 10 s
Mar 22 14:42:09 sip-lab /usr/sbin/opensips[17721]: ERROR:core:tcpconn_connect: tcp_blocking_connect failed
Mar 22 14:42:09 sip-lab /usr/sbin/opensips[17721]: ERROR:core:tcp_send: connect failed
Mar 22 14:42:09 sip-lab /usr/sbin/opensips[17721]: ERROR:tm:msg_send: tcp_send failed
Mar 22 14:42:09 sip-lab /usr/sbin/opensips[17721]: ERROR:tm:t_forward_nonack: sending request failed
Mar 22 14:42:09 sip-lab /usr/sbin/opensips[17721]: DBG:tm:t_relay_to: t_forward_nonack returned error


I would, from the this latest TM errors to redirect the call to the voicemail but i don't understand where to place the t_relay.

Thanks a lot!,

Leo
Reply | Threaded
Open this post in threaded view
|

Re: SIP/2.0 477 Send failed (477/TM) - Route

Venkatesh Macha
Hi Leo,

Actually 477 is transport error. The failure route is triggered only when there is a SIP failure.

So if you want to handle the 477 send failed situation, Just use "0x02" flag with t_relay().

Here is the sample script.

if (!t_relay("3"))
{
       #0x02 option will make t_relay() to return failure to script instead of sending the 477 out
       #0x01 skips 100 trying message..
       # So i am using 3, i.e 0x01 and 0x02..
       # so now we can send call to voice mail etc,,
             
       # If you want to remove the user from location table remove it now , So that we can get 477 for next requests.
       
        if (!remove("location", "$ru"))
            sl_reply_error();      
        else
            xlog("L_INFO","AOR of $rU is Removed from DB");

        if((is_method("INVITE")))
        {
            # send to voice mail or do what you want to do.
        }

}

Cheers,
Venkatesh Macha,
VOIP Engineer.
leo
Reply | Threaded
Open this post in threaded view
|

Re: SIP/2.0 477 Send failed (477/TM) - Route

leo
Thanks a lot Venkatesh!!!! That was a fantastic clue!!!

Just one more thing, following your advice, in the INVITE part of the script I'm calling an external app like:

if (!t_relay("3"))
{
        if((is_method("INVITE")))
        {
                exec_avp("some script to wake-up the client");
        }
}

The point is that the called UA wakes-up (so this part is working) but the call (invite) is not arriving, should i use something like:

append_branch();
t_relay();

after my exec_avp("some script to wake-up the client"); ?
leo
Reply | Threaded
Open this post in threaded view
|

Re: SIP/2.0 477 Send failed (477/TM) - Route

leo
Hello Guys,

could you give the last clue on this? The point is once the UA is re-registered, how to forward the call to it?
Thanks,

Leo
Reply | Threaded
Open this post in threaded view
|

Re: SIP/2.0 477 Send failed (477/TM) - Route

Vlad Paiu
Hello,

What you can do is send the call to a destination which is not available
at all, control the amount of time you want to give the client to
register via the fr_timer, and when that timeout is exceeded try to
route the call to the client.

Short snippet of code would be

if (!t_relay("3"))
{
         if((is_method("INVITE")))
         {
                 exec_avp("some script to wake-up the client");
                 # relay to localhost, discart port
                 $du = "sip:127.0.0.1:9";
                 # wait two seconds for the client to register
                 $T_fr_timeout = 2;
                 t_on_failure("route_to_client");
                 t_relay();
                 exit;
         }
}

failure_route[route_to_client] {
     if (t_was_cancelled())
         exit;

     # after two seconds, this will get called
     # see if the client is registered now

     lookup("location");
     t_relay();
     exit;
}

Best Regards,

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

On 13.04.2015 18:20, leo wrote:

> Hello Guys,
>
> could you give the last clue on this? The point is once the UA is
> re-registered, how to forward the call to it?
> Thanks,
>
> Leo
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/SIP-2-0-477-Send-failed-477-TM-Route-tp7595929p7596472.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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

Re: SIP/2.0 477 Send failed (477/TM) - Route

leo
Hello Vlad:

The timer "$T_fr_timeout = 2;" it seems not working. Doing the following:

if (!t_relay("3"))
{
         if((is_method("INVITE")))
         {
                 exec_avp("some script to wake-up the client");
                 # relay to localhost, discart port
                 $du = "sip:127.0.0.1:9";
                 xlog("before timeout\n");
                 # wait two seconds for the client to register
                 $T_fr_timeout = 2;
                 t_on_failure("route_to_client");
                 xlog("after timeout\n");
                 t_relay();
                 exit;
         }
}

In the log file the difference of time between the logs is not 2 sec. And of course, there isn't failure route and the t_relay() is processed.

Thanks,

Leo

leo
Reply | Threaded
Open this post in threaded view
|

Re: SIP/2.0 477 Send failed (477/TM) - Route

leo
Enabling more detailed logs i  think the error would be "$du = "sip:127.0.0.1:9"; "
Wouldn't be $ru instead of $du? And i receive ERROR:core:tcp_blocking_connect: failed to retrieve SO_ERROR [server=127.0.0.1:9] (111) Connection refused

Thanks one more time,

Leo
Reply | Threaded
Open this post in threaded view
|

Re: SIP/2.0 477 Send failed (477/TM) - Route

Vlad Paiu
Hello,

Try to have an OpenSIPS localhost UDP listener, and do
force_send_socket(udp:127.0.0.1:5060) before attempting to relay to
127.0.0.1:9
In your case it fails since you're trying to relay via TCP, which fails
since nobody listens over there - you won't have those issues with UDP.

Best Regards,

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

On 15.04.2015 23:04, leo wrote:

> Enabling more detailed logs i  think the error would be "$du =
> "sip:127.0.0.1:9";"
> Wouldn't be $ru instead of $du? And i receive
> ERROR:core:tcp_blocking_connect: failed to retrieve SO_ERROR
> [server=127.0.0.1:9] (111) Connection refused
>
> Thanks one more time,
>
> Leo
>
>
>
> --
> View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/SIP-2-0-477-Send-failed-477-TM-Route-tp7595929p7596548.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


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

Re: SIP/2.0 477 Send failed (477/TM) - Route - SOLVED

leo
Thanks a lot Vlad!!!, I guess the TCP/UDP was the problem. I followed your advise and now it works.