[OpenSIPS-Users] 477 send failed with TCP

Anshuman S. Rawat arawat at 3clogic.com
Thu Dec 16 09:00:22 CET 2010


Thanks Bogdan. That fixed most of the problems but not all.

I have a scenario where I make calls without registering (transport is TCP) 
so the contact in INVITE carries local/private IP address. Result: I cannot 
receive in-dailog requests after call in setup. It tried to fix this by 
doing this -

if (method == INVITE) {
                        # Required for TCP - Anshuman
                        xlog("L_INFO", "INVITE: Check for NAT");
                        if (nat_uac_test("1")) {
                                xlog("L_INFO", "NAT: FIXING CONTACT in 
INVITE");
                                fix_nated_contact();
                        };
                };

This is followed by processing by the lcr module  -

if ((method == INVITE) && !(to_uri=~"parallel at .+")){
                        # do lcr
                       # xlog("Message :$tu");
                        if (!load_contacts()){
                                sl_send_reply("500","Unable to load 
contacts");
                                exit;
                        }else{
                                if (next_contacts()){
                                        t_on_failure("1");
                                }#else{
                                #       sl_send_reply("404","Not found ");
                                #       exit;
                        #       }
                        }
                        append_hf("P-hint: lcr applied\r\n");

                }else{
                        append_hf("P-hint: usrloc applied\r\n");
                }


The above does not fix the 'Contact' header in the INVITE (i.e. Contact 
still carries private IP address).

Can anyone help me to identify what's wrong with this picture?

Regards,
Anshuman


----- Original Message ----- 
From: "Bogdan-Andrei Iancu" <bogdan at voice-system.ro>
To: "OpenSIPS users mailling list" <users at lists.opensips.org>
Sent: Thursday, December 09, 2010 5:30 PM
Subject: Re: [OpenSIPS-Users] 477 send failed with TCP


> Hi Anshuman,
>
> do "fix_nated_register()" at registration time (before save("location"))
> if uac_nat_test() function returns true (if nat was detected) - see the
> nathelper module for more details:
>       http://www.opensips.org/html/docs/modules/1.6.x/nathelper.html
>
> Regards,
> Bogdan
>
> Anshuman S. Rawat wrote:
>> Hi,
>>
>> I am trying to use TCP on OpenSIPS 1.6 (with PJSIP as client). Client
>> successfully registers and sends keep-alives to keep the TCP
>> connection open. However, all call attempts (or any other request)
>> fail with a '477 Send Failed'. The logs show this -
>>
>> Dec  8 06:58:18 ip-208-109-177-46 /usr/local/sbin/opensips[15463]:
>> ERROR:core:tcp_blocking_connect: timeout 10 s elapsed from 10 s
>> Dec  8 06:58:18 ip-208-109-177-46 /usr/local/sbin/opensips[15463]:
>> ERROR:core:tcpconn_connect: tcp_blocking_connect failed
>> Dec  8 06:58:18 ip-208-109-177-46 /usr/local/sbin/opensips[15463]:
>> ERROR:core:tcp_send: connect failed
>> Dec  8 06:58:18 ip-208-109-177-46 /usr/local/sbin/opensips[15463]:
>> ERROR:tm:msg_send: tcp_send failed
>>
>> Client is behind a NAT so registers with contact containing the
>> private IP address. It seems that OpenSIPS is trying to connect to the
>> private IP address contained in the REGISTER request rather than
>> reusing the connection the request arrived on.
>>
>> Is this a bug? Or is there a way to configure it to use the
>> established connection?
>>
>> Thanks,
>> Anshuman
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
> -- 
> Bogdan-Andrei Iancu
> OpenSIPS Bootcamp
> 15 - 19 November 2010, Edison, New Jersey, USA
> www.voice-system.ro
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.872 / Virus Database: 271.1.1/3304 - Release Date: 12/08/10 
13:04:00




More information about the Users mailing list