Hi Daniel,
it works.
Thanks Thanks Thanks :)
----- Original Message ----
From: Daniel-Constantin Mierla <miconda(a)gmail.com>
To: Dubravko Caric <dubravko_caric(a)yahoo.com>
Cc: kamailio users <users(a)lists.kamailio.org>
Sent: Thursday, August 20, 2009 1:13:34 PM
Subject: Re: [Kamailio-Users] Problem with BYE when using TCP or TLS between two Kamailio
proxies
Hello,
On 20.08.2009 13:56 Uhr, Dubravko Caric wrote:
Hi Daniel,
----- Original Message ----
From: Daniel-Constantin Mierla <miconda(a)gmail.com>
To: Dubravko Caric <dubravko_caric(a)yahoo.com>
Cc: kamailio users <users(a)lists.kamailio.org>
Sent: Thursday, August 20, 2009 12:49:41 PM
Subject: Re: [Kamailio-Users] Problem with BYE when using TCP or TLS between two Kamilio
proxies
Hello,
On 20.08.2009 13:31 Uhr, Dubravko Caric wrote:
Hi all,
I have a problem with
routing BYE messages (when called UAC sends BYE) when connection between two
Kamailio (1.5.1 with identical configurations) proxies is done by TLS/TCP.
WORKING:
UAC#1 <-- UDP/TCP/TLS --> Proxy#1 <--UDP--> Proxy#2 <-- UDP/TCP/TLS
--> UAC#2
NOT WORKING:
UAC#1 <-- UDP/TCP/TLS --> Proxy#1 <-- TCP or TLS --> Proxy#2 <--
UDP/TCP/TLS --> UAC#2
By looking at ngrep
log I found out that when “UAC#1” sends INVITE, “Proxy#1” sends right “Contact”
header (Contact:<sip:bob@IP_ADDRESS_OF_UAC#1:6126;transport=udp>)
to “Proxy#2” , but “Proxy#2” sends wrong “Contact” header
(Contact:<sip:bob@IP_ADDRESS_OF_PROXY#1:39879;transport=udp>)
to “UAC#2”.
When UAC#2 sends BYE,
it is sends message with this wrong header and when it arrives on “Proxy#1” proxy
doesn’t sends BYE message to UAC#1. Or when UACs with TCP, this are “Proxy#1”
errors:
DBG:core:tcp_send: no
open tcp connection found, opening new one ERROR:core:tcp_blocking_connect:
poll error: flags 18 ERROR:core:tcp_blocking_connect:
failed to retrieve SO_ERROR (111) Connection refused ERROR:core:tcpconn_connect:
tcp_blocking_connect failed ERROR:core:tcp_send:
connect failed ERROR:tm:msg_send:
tcp_send failed ERROR:tm:t_forward_nonack:
sending request failed DBG:tm:t_relay_to:
t_forward_nonack returned error
What bothers me is
that when I call the other UAC, he can hangup the call (even when he is CALLED UAC),
then I restart both proxies and it is other way around.
I do not know if I
described problem clearly but I am lost in where to look next so any help would
be appreciated. Why proxy change Contact header when I switch from UDP to TCP
between proxies? I'm not rewriting Contact header and only thing that I change in
configuration when switching from UDP to TCP is this:
if($rd=="example.com")
{
t_relay("tcp: example.com:5063");
exit;
}
do you have NAT travesal logic in config file and use fix_natted_contact()?
yes, I have. both UACs have public IP addresses.
# Caller NAT detection route
route[4] {
xlog("L_INFO","Route 4\n");
force_rport();
force_tcp_alias();
if (nat_uac_test("19")) {
if (method=="REGISTER") {
xlog("L_INFO","REGISTER Route 4\n");
fix_nated_register();
} else {
xlog("L_INFO","NOT REGISTER Route 4\n");
fix_nated_contact();
}
setflag(5);
}
return;
}
you should not do nat processing for messages coming from the other proxy.
Cheers,
Daniel
--
Daniel-Constantin Mierla
*