[Serusers] ACK and BYE being sent to private IP of UA

Nhadie nhadie at tbgi.net.ph
Sat Jun 2 11:29:09 CEST 2007


hi,

how can i fix ACK and BYE being sent to private IP of UA? here's sample
sniff:

caller - 1000 - pap2
callee - 1002 - x-lite

caller and callee on the same nat router - public IP -- 222.127.83.25
sip server -- 210.1.71.3

i know there's something wrong with my config i just don't know what.

hope anyone can help me

U 210.1.71.3:5060 -> 222.127.83.25:60149
SIP/2.0 180 Ringing..Via: SIP/2.0/UDP
222.127.83.25:60149;branch=z9hG4bK-33496bfb..From: 1000 <
sip:1000 at sip.tbgi.net.ph>;tag=183e34c24b4aa0afo0..To:
<sip:1002 at sip.tbgi.net.ph>;tag=3030149153
..Contact: <sip:1002 at 222.127.83.25:61984>..Record-Route:
<sip:210.1.71.3;ftag=183e34c24b4aa0afo
0;lr=on>..Call-ID: a8c6587e-dc2c7023 at 222.127.83.25..CSeq: 102
INVITE..Server: X-Lite release 11
03m..Content-Length: 0....
#
U 222.127.83.25:61984 -> 210.1.71.3:5060
SIP/2.0 200 Ok..Via: SIP/2.0/UDP
210.1.71.3;branch=z9hG4bK5e5d.f1f4dec7.0..Via: SIP/2.0/UDP 222
.127.83.25:60149;branch=z9hG4bK-33496bfb..From: 1000
<sip:1000 at sip.tbgi.net.ph>;tag=183e34c24b4
aa0afo0..To: <sip:1002 at sip.tbgi.net.ph>;tag=3030149153..Contact:
<sip:1002 at 222.127.83.25:61984>
..Record-Route: <sip:210.1.71.3;ftag=183e34c24b4aa0afo0;lr=on>..Call-ID:
a8c6587e-dc2c7023 at 222.
127.83.25..CSeq: 102 INVITE..Content-Type: application/sdp..Server: X-Lite
release 1103m..Conte
nt-Length: 296....v=0..o=1002 26427691 26433779 IN IP4
222.127.83.25..s=X-Lite..c=IN IP4 222.12
7.83.25..t=0 0..m=audio 60272 RTP/AVP 0 8 3 98 97 101..a=rtpmap:0
pcmu/8000..a=rtpmap:8 pcma/80
00..a=rtpmap:3 gsm/8000..a=rtpmap:98 iLBC/8000..a=rtpmap:97
speex/8000..a=rtpmap:101 telephone-
event/8000..a=fmtp:101 0-15..
#
U 210.1.71.3:5060 -> 222.127.83.25:60149
SIP/2.0 200 Ok..Via: SIP/2.0/UDP
222.127.83.25:60149;branch=z9hG4bK-33496bfb..From: 1000 <sip:1
000 at sip.tbgi.net.ph>;tag=183e34c24b4aa0afo0..To:
<sip:1002 at sip.tbgi.net.ph>;tag=3030149153..Con
tact: <sip:1002 at 222.127.83.25:61984>..Record-Route:
<sip:210.1.71.3;ftag=183e34c24b4aa0afo0;lr=
on>..Call-ID: a8c6587e-dc2c7023 at 222.127.83.25..CSeq: 102
INVITE..Content-Type: application/sdp.
.Server: X-Lite release 1103m..Content-Length: 316....v=0..o=1002 26427691
26433779 IN IP4 222.
127.83.25..s=X-Lite..c=IN IP4 222.127.83.25..t=0 0..m=audio 60272 RTP/AVP 0
8 3 98 97 101..a=rt
pmap:0 pcmu/8000..a=rtpmap:8 pcma/8000..a=rtpmap:3 gsm/8000..a=rtpmap:98
iLBC/8000..a=rtpmap:97
speex/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101
0-15..a=direction:active..
#
U 222.127.83.25:60149 -> 210.1.71.3:5060
ACK sip:1002 at 192.168.254.7:5062 SIP/2.0..Via: SIP/2.0/UDP
222.127.83.25:60149;branch=z9hG4bK-a2
95ad98..From: 1000 <sip:1000 at sip.tbgi.net.ph>;tag=183e34c24b4aa0afo0..To:
<sip:1002 at sip.tbgi.ne
t.ph>;tag=3030149153..Call-ID: a8c6587e-dc2c7023 at 222.127.83.25..CSeq: 102
ACK..Max-Forwards: 70
..Route: <sip:210.1.71.3;ftag=183e34c24b4aa0afo0;lr=on>..Authorization:
Digest username="1000",
realm="tbgi.net.ph",nonce="466102f26d432f3f1214359a01eaa784e208caa7",uri="sip:1002 at 192.168.254.
7:5062",algorithm=MD5,response="ff4da318be9647ed5506b3a6ed042f65"..Contact:
1000 <sip:1000 at 222.
127.83.25:60149>..User-Agent: Linksys/PAP2-3.1.3(LS)..Content-Length: 0....
#
U 210.1.71.3:5060 -> 192.168.254.7:5062
ACK sip:1002 at 192.168.254.7:5062 SIP/2.0..Record-Route:
<sip:210.1.71.3;ftag=183e34c24b4aa0afo0;
lr=on>..Via: SIP/2.0/UDP 210.1.71.3;branch=0..Via: SIP/2.0/UDP
222.127.83.25:60149;branch=z9hG4
bK-a295ad98..From: 1000
<sip:1000 at sip.tbgi.net.ph>;tag=183e34c24b4aa0afo0..To: <sip:1002 at sip.tb
gi.net.ph>;tag=3030149153..Call-ID: a8c6587e-dc2c7023 at 222.127.83.25..CSeq:
102 ACK..Max-Forward
s: 16..Authorization: Digest
username="1000",realm="tbgi.net.ph",nonce="466102f26d432f3f1214359
a01eaa784e208caa7",uri="sip:1002 at 192.168.254.7:5062",algorithm=MD5,response="ff4da318be9647ed55
06b3a6ed042f65"..Contact: 1000 <sip:1000 at 222.127.83.25:60149>..User-Agent:
Linksys/PAP2-3.1.3(L
S)..Content-Length: 0..P-hint: rr-enforced....

--- config start --

# main routing logic

route{

setflag(8); # Turn on XLOG Debugging

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
break;
};

if (msg:len >=  2048 ) {
sl_send_reply("513", "Message too big");
break;
};

if (!method=="REGISTER") {
setflag(9);
record_route();
}

if (loose_route()) {

if ((method=="INVITE" || method=="REFER") && !has_totag()) {
sl_send_reply("403", "Forbidden");
break;
};

if ((method=="BYE") || (method=="CANCEL")) {
setflag(9);
};

append_hf("P-hint: rr-enforced\r\n");
route(1);
break;
};

if (src_ip==XX.XX.XX.XX) {
if (isflagset(8)) {xlog("L_INFO","From ASTERISK");};
setflag(1);
};

if (!uri==myself) {
# mark routing logic in request
append_hf("P-hint: outbound\r\n");
route(1);
break;
};

if (uri==myself) {

if (method=="REGISTER") {

if (isflagset(8)) {xlog("L_INFO","UA Trying to Register...");};

if (!www_authorize("tbgi.net.ph", "subscriber")) {
www_challenge("tbgi.net.ph", "0");
break;
};

if (!search("^Contact:[ ]*\*") && nat_uac_test("19")) {
if (isflagset(8)) {xlog("L_INFO","UA Behind NAT\n");};
setflag(6);
fix_nated_register();
force_rport();
} else {
if (isflagset(8)) {xlog("L_INFO","UA not Behind NAT");};
};

save("location");
break;

};

if (uri=~"^(sip:)?[1-8]...@(([a-z]+\.)?tbgi.net.ph|210\.1\.71\.3)") {
if (isflagset(8)) {xlog("L_INFO","CALL TO LOCAL DESTINATION\n");};
setflag(2);

if (method=="INVITE") {
if (!www_authorize("tbgi.net.ph", "subscriber")) {
www_challenge("tbgi.net.ph", "0");
break;
};

if (nat_uac_test("19")) {
if (isflagset(8)) {xlog("L_INFO","INVITE FROM NATTED UA\n");};
setflag(6);
fix_nated_contact();
force_rport();
fix_nated_sdp("3");
};

};

if (!lookup("location")) {
sl_send_reply("404", "Not Found");
break;
};
route(1);
break;

} else if (uri=~"^(sip:)?00[0-9]*@(([a-z]+\.)?tbgi.net.ph|210\.1\.71\.3)") {
if (isflagset(8)) {xlog("L_INFO","CALL TO INTERNATIONAL\n");};
setflag(3);

if (method=="INVITE") {
if (!www_authorize("tbgi.net.ph", "subscriber")) {
www_challenge("tbgi.net.ph", "0");
break;
};

if (nat_uac_test("19")) {
if (isflagset(8)) {xlog("L_INFO","INVITE FROM NATTED UA\n");};
setflag(6);
fix_nated_contact();
force_rport();
fix_nated_sdp("3");
};

};

prefix("9");
rewritehostport("XX.XX.XX.XX:5060");
t_relay_to_udp("XX.XX.XX.XX", "5060");
break;

};
route(1);
break;
};

lookup("aliases");
if (!uri==myself) {
append_hf("P-hint: outbound alias\r\n");
route(1);
break;
};

# native SIP destinations are handled using our USRLOC DB
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
break;
};

append_hf("P-hint: usrloc applied\r\n");
route(1);
}

route[1] {
t_on_reply("1");
if (!t_relay()) {
sl_reply_error();
};
}


onreply_route[1] {

if (isflagset(6) && status=~"(183)|2[0-9][0-9]" &&
!search("^Content-Length:\ +0")) {
if (isflagset(8)) {xlog("L_INFO","ON REPLY FROM NATTED UA\n");};
fix_nated_contact();
fix_nated_sdp("3");
} else if (nat_uac_test("1")) {
if (isflagset(8)) {xlog("L_INFO","ON REPLY FROM NATTED UA ALTERNATIVE\n");};
fix_nated_contact();
};

}

________________________________________________
Message sent using UebiMiau 2.7




More information about the sr-users mailing list