[Kamailio-Users] Loadbalancer/outbound_proxy and ACK problem
Pavel Miskov
miskov.pavel at gmail.com
Fri Mar 12 10:52:22 CET 2010
Hello list,
let me first show my scenario:
UAC_A ---> LB ---> |
| PROXY+REG #1
| or
| PROXY+REG #2
UAC_B <--- LB <--- |
LB cfg:
modparam("path", "use_received", 1)
loose_route(); #for REG+PROXY
if(is_method("REGISTER")){
add_path_received();
ds_select_dst("1", "0");
fix_nated_register();
} else {
record_route();
add_path();
ds_select_dst("1", "0");
fix_nated_register();
}
PROXY+REG cfg:
-------------
modparam("registrar", "use_path", 1)
modparam("registrar", "path_mode", 0)
modparam("registrar", "path_use_received", 1)
INVITE if working fine until ACK. UAC_A sends ACK to LB "ACK
sip:UAC_B at LB_IP:5678;" insted of "ACK sip:UAC_B at UAC_B_PUB_IP:". In
"200 OK" which PROXY sends to LB Contact is rewritten with ip addres
of LB "Contact: <sip:UAC_B at LB_IP:5678;" and this is why UAC_A sends
wrong ACK. Obviously I miss something so if someone could point me
where to look.
Thanks
Pavel
U UAC_A_PUB_IP:31488 -> LB_IP:5678
INVITE sip:UAC_B at test.com SIP/2.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport..Max-Forwards:
70..Contact: <sip:UAC_A at UAC_A_PRIV_IP:31488>..To:
"UAC_B"<sip:UAC_B at test.com>..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq:
2 INVITE..
#
U LB_IP:5678 -> UAC_A_PUB_IP:31488
SIP/2.0 100 Giving a try..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488;received=UACs_PUB_IP..To:
"UAC_B"<sip:UAC_B at test.com>..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..Server:
Kamailio (1.5.1-tls (x86_64/linux))..Content-Length: 0....
#
U LB_IP:5678 -> REG_PROXY_IP:5166
INVITE sip:UAC_B at test.com SIP/2.0..Record-Route:
<sip:LB_IP:5678;lr=on>..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Max-Forwards:
69..Contact: <sip:UAC_A at UAC_A_PUB_IP:31488>..To:
"UAC_B"<sip:UAC_B at test.com>..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..Path:
<sip:LB_IP:5678;lr>....
#
U REG_PROXY_IP:5166 -> LB_IP:5678
SIP/2.0 100 Giving a try..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..To:
"UAC_B"<sip:UAC_B at test.com>..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..Server:
Kamailio (1.5.1-tls (x86_64/linux))..Content-Length: 0....
#
U REG_PROXY_IP:5166 -> LB_IP:5678
INVITE sip:UAC_B at UAC_B_PRIV_IP:31468;rinstance=ed47096f240b6b6d
SIP/2.0..Record-Route:
<sip:REG_PROXY_IP:5166;lr=on;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Via: SIP/2.0/UDP
REG_PROXY_IP:5166;branch=z9hG4bKa1b1.c7ca19a7.0..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Route:
<sip:LB_IP:5678;lr;received="sip:UAC_B_PUB_IP:31468">..Max-Forwards:
68..Contact: <sip:UAC_A at UAC_A_PUB_IP:31488>..To:
"UAC_B"<sip:UAC_B at test.com>..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..Path:
<sip:LB_IP:5678;lr>....
#
U LB_IP:5678 -> REG_PROXY_IP:5166
SIP/2.0 100 Giving a try..Via: SIP/2.0/UDP
REG_PROXY_IP:5166;branch=z9hG4bKa1b1.c7ca19a7.0;rport=5166;received=REG_PROXY_IP..Via:
SIP/2.0/UDP LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..To:
"UAC_B"<sip:UAC_B at test.com>..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..Server:
Kamailio (1.5.1-tls (x86_64/linux))..Content-Length: 0....
#
U LB_IP:5678 -> UAC_B_PUB_IP:31468
INVITE sip:UAC_B at UAC_B_PRIV_IP:31468;rinstance=ed47096f240b6b6d
SIP/2.0..Record-Route:
<sip:REG_PROXY_IP:5166;lr=on;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.56778065.0..Via: SIP/2.0/UDP
REG_PROXY_IP:5166;rport=5166;received=REG_PROXY_IP;branch=z9hG4bKa1b1.c7ca19a7.0..Via:
SIP/2.0/UDP LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Max-Forwards:
67..Contact: <sip:UAC_A at UAC_A_PUB_IP:31488>..To:
"UAC_B"<sip:UAC_B at test.com>..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..Path:
<sip:LB_IP:5678;lr>....
#
U UAC_B_PUB_IP:31468 -> LB_IP:5678
SIP/2.0 180 Ringing..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.56778065.0..Via: SIP/2.0/UDP
REG_PROXY_IP:5166;rport
=5166;received=REG_PROXY_IP;branch=z9hG4bKa1b1.c7ca19a7.0..Via:
SIP/2.0/UDP LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Record-Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Contact: <sip:UAC_B at UAC_B_PRIV_IP:31
468;rinstance=ed47096f240b6b6d>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..
Call-ID: ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2
INVITE..User-Agent: X-Lite release 1100l stamp 47546..Content-Length:
0....
#
U LB_IP:5678 -> REG_PROXY_IP:5166
SIP/2.0 180 Ringing..Via: SIP/2.0/UDP
REG_PROXY_IP:5166;rport=5166;received=REG_PROXY_IP;branch=z9hG4bKa1b1.c7ca19a7.0..Via:
SIP/2.0/UDP LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Record-Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Record-Route: <sip:
LB_IP:5678;lr=on>..Contact:<sip:UAC_B at UAC_B_PRIV_IP:31468;rinstance=ed47096f240b6b6d>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2
INVITE..User-Agent: X-Lite release 1100l stamp 47546..Content-Length:
0....
#
U REG_PROXY_IP:5166 -> LB_IP:5678
SIP/2.0 180 Ringing..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Record-Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Contact:
<sip:UAC_B at LB_IP:5678;rinstance=ed47096f240b6b6d>..To:"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2
INVITE..User-Agent: X-Lite release 1100l stamp 47546..Content-Length:
0....
#
U LB_IP:5678 -> UAC_A_PUB_IP:31488
SIP/2.0 180 Ringing..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Record-Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Contact:
<sip:UAC_B at LB_IP:5678;rinstance=ed47096f240b6b6d>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2
INVITE..User-Agent: X-Lite release 1100l stamp 47546..Content-Length:
0....
#
U UAC_B_PUB_IP:31468 -> LB_IP:5678
SIP/2.0 200 OK..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.56778065.0..Via: SIP/2.0/UDP
REG_PROXY_IP:5166;rport=5166;received=REG_PROXY_IP;branch=z9hG4bKa1b1.c7ca19a7.0..Via:
SIP/2.0/UDP LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Record-Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Contact: <sip:UAC_B at UAC_B_PRIV_IP:31468;r
instance=ed47096f240b6b6d>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..
#
U LB_IP:5678 -> REG_PROXY_IP:5166
SIP/2.0 200 OK..Via: SIP/2.0/UDP
REG_PROXY_IP:5166;rport=5166;received=REG_PROXY_IP;branch=z9hG4bKa1b1.c7ca19a7.0..Via:
SIP/2.0/UDP LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Record-Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Contact:<sip:UAC_B at UAC_B_PRIV_IP:31468;rinstance=ed47096f240b6b6d>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..
#
U REG_PROXY_IP:5166 -> LB_IP:5678
SIP/2.0 200 OK..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.46778065.0..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Record-Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Contact:
<sip:UAC_B at LB_IP:5678;rinstance=ed47096f240b6b6d>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..
#
U LB_IP:5678 -> UAC_A_PUB_IP:31488
SIP/2.0 200 OK..Via: SIP/2.0/UDP
UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-d33a97176d49f84b-1---d8754z-;rport=31488..Record-Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Record-Route:
<sip:LB_IP:5678;lr=on>..Contact:
<sip:UAC_B at LB_IP:5678;rinstance=ed47096f240b6b6d>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:
"UAC_A"<sip:UAC_A at test.com >;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 INVITE..
#
U UAC_A_PUB_IP:31488 -> LB_IP:5678
ACK sip:UAC_B at LB_IP:5678;rinstance=ed47096f240b6b6d SIP/2.0..Via:
SIP/2.0/UDP UAC_A_PRIV_IP:31488;branch=z9hG4bK-d8754z-0472a03b5d1aa106-1---d8754z-;rport..Max-Forwards:
70..Route: <sip:LB_IP:5678;lr>..Route:
<sip:REG_PROXY_IP:5166;lr;nat=yes>..Contact:
<sip:UAC_A at UAC_A_PRIV_IP:31488>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:
"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 ACK..
#
U LB_IP:5678 -> REG_PROXY_IP:5166
ACK sip:REG_PROXY_IP:5166;lr;nat=yes SIP/2.0..Via: SIP/2.0/UDP
LB_IP:5678;branch=z9hG4bKa1b1.46778065.2..Via: SIP/2.0/UDP
LB_IP:5678;rport=5678;received=LB_IP;branch=z9hG4bKa1b1.46778065.2..Via:
SIP/2.0/UDP UAC_A_PRIV_IP:31488;received=UACs_PUB_IP;branch=z9hG4bK-d8754z-0472a03b5d1aa106-1---d8754z-;rport=31488..Max-Forwards:
68..Contact: <sip:UAC_A at UAC_A_PUB_IP:31488>..To:
"UAC_B"<sip:UAC_B at test.com>;tag=2e79423e..From:"UAC_A"<sip:UAC_A at test.com>;tag=8c3b5c41..Call-ID:
ZTliZWQ4 YTM5MjVkYjUxYTk3MmUxZmVhOGY5MzlmM2Q...CSeq: 2 ACK..
More information about the Users
mailing list