Hi Daniel,
thank you for your reply. So, now i'am using rtpproxy, started like this:
*/usr/sbin/rtpproxy -s udp:localhost 7722 -u rtpproxy rtpproxy -p
/var/run/rtpproxy/rtpproxy.pid -d DBUG LOG_LOCAL2 -l 10.9.23.180
172.16.52.240 -A 151.8.3.248 151.8.3.248*
and some snippet of code:
*####### Defined Values #########
# *** Value defines - IDs used later in config
#!ifdef WITH_MYSQL
# - database URL - used to connect to database server by modules such
# as: auth_db, acc, usrloc, a.s.o.
#!ifndef DBURL
#!define DBURL "mysql://kamailio:kamailiorw@localhost/kamailio"
#!endif
#!endif
#!ifdef WITH_MULTIDOMAIN
# - the value for 'use_domain' parameters
#!define MULTIDOMAIN 1
#!else
#!define MULTIDOMAIN 0
#!endif
# - flags
# FLT_ - per transaction (message) flags
# FLB_ - per branch flags
#!define FLT_ACC 1
#!define FLT_ACCMISSED 2
#!define FLT_ACCFAILED 3
#!define FLT_NATS 5
#!define FLB_NATB 6
#!define FLB_NATSIPPING 7
#!define FLT_OUT 8
#!define ALCATEL_LAN 10.9.6.0/24
#!define LONGWAVE_LAN 172.16.52.0/24
#!substdef "!MY_IP_ADDR_DMZ!10.9.23.180!g"
#!substdef "!MY_IP_ADDR_INT!172.16.52.240!g"
#!substdef "!MY_DOMAIN!lwsbc.longwave.eu!g"
#!substdef "!MY_WS_PORT!10080!g"
#!substdef "!MY_WSS_PORT!10443!g"
#!substdef "!ALCATEL_IP!10.9.6.3!g"
#!substdef "!MY_WS_ADDR!tcp:MY_IP_ADDR_DMZ:MY_WS_PORT!g"
#!substdef "!MY_WSS_ADDR!tls:MY_IP_ADDR_DMZ:MY_WSS_PORT!g"
listen=MY_IP_ADDR_DMZ:5060 advertised_address = "151.8.3.248"
listen=MY_IP_ADDR_INT:5060
#!ifdef WITH_WEBSOCKETS
listen=MY_WS_ADDR
#!ifdef WITH_TLS
listen=MY_WSS_ADDR
#!endif
#!endif
alias = "MY_DOMAIN:5060"
alias = "MY_IP_ADDR_DMZ:5060"
alias = "MY_IP_ADDR_INT:5060"
alias = "MY_DOMAIN:10080"
alias = "MY_IP_ADDR_DMZ:10080"
/* port to listen to
* - can be specified more than once if needed to listen on many ports */
port=5060
port=10080
*
*# Caller NAT detection route
route[NATDETECT] {
#!ifdef WITH_NAT
xlog("L_NOTICE","####$rm from $fu (IP:$si:$sp) Main Route before
---NAT---\n");
force_rport();
if (!nat_uac_test("19")) {
if (is_method("REGISTER")) {
fix_nated_register();
xlog("L_NOTICE","####$rm from $fu (IP:$si:$sp) in Route[NAT]
fix_nat-register\n");
} else {
add_contact_alias();
xlog("L_NOTICE","####$rm from $fu (IP:$si:$sp) in Route[NAT]
add_contact_alias\n");
}
setflag(FLT_NATS);
}
#!endif
return;
}
# RTPProxy control
route[NATMANAGE] {
#!ifdef WITH_NAT
xlog("####NATMANAGE M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
if (is_request()) {
if(has_totag()) {
if(check_route_param("nat=yes")) {
xlog("L_NOTICE","#### B FLAG settata.........\n");
setbflag(FLB_NATB);
}
}
}
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;
rtpproxy_manage("");
if (is_request()) {
if (!has_totag()) {
add_rr_param(";nat=yes");
}
}
if (is_reply()) {
if(isbflagset(FLB_NATB)) {
add_contact_alias();
}
}
#!endif
return;
}*
Now this is the result:
Call from INSIDE toward OUTSIDE:
U 2014/08/01 10:04:23.706821 172.16.52.53:26986 -> 172.16.52.240:5060
INVITE sip:1002@lwsbc.longwave.eu SIP/2.0.
Via: SIP/2.0/UDP
172.16.52.53:26986;branch=z9hG4bK-d8754z-a5f22c435ade0779-1---d8754z-;rport.
Max-Forwards: 70.
Contact: <sip:bria@172.16.52.53:26986>.
To: <sip:1002@lwsbc.longwave.eu>.
From: "BRIA"<sip:bria@lwsbc.longwave.eu>;tag=2d732820.
Call-ID: YWIyMWVlYzgyMTRmODBkYWE3YWM3NTlhMTIyOWYyYjg.
CSeq: 1 INVITE.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE,
INFO.
Content-Type: application/sdp.
Supported: replaces.
User-Agent: Bria 3 release 3.5.5 stamp 71243.
Content-Length: 487.
.
v=0.
o=- 1406880237226243 1 IN IP4 172.16.52.53.
s=Bria 3 release 3.5.5 stamp 71243.
c=IN IP4 172.16.52.53.
t=0 0.
m=audio 58894 RTP/AVP 123 122 121 120 9 8 0 18 98 100 97 101.
a=rtpmap:123 opus/48000/2.
a=fmtp:123 useinbandfec=1.
a=rtpmap:122 SILK/24000.
a=rtpmap:121 SILK/16000.
a=rtpmap:120 SILK/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=yes.
a=rtpmap:98 ILBC/8000.
a=rtpmap:100 speex/16000.
a=rtpmap:97 speex/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=sendrecv.
U 2014/08/01 10:04:23.720615 172.16.52.240:5060 -> 172.16.52.53:26986
SIP/2.0 100 LW-SBC is Trying.
Via: SIP/2.0/UDP
172.16.52.53:26986;branch=z9hG4bK-d8754z-a5f22c435ade0779-1---d8754z-;rport=26986.
To: <sip:1002@lwsbc.longwave.eu>.
From: "BRIA"<sip:bria@lwsbc.longwave.eu>;tag=2d732820.
Call-ID: YWIyMWVlYzgyMTRmODBkYWE3YWM3NTlhMTIyOWYyYjg.
CSeq: 1 INVITE.
Server: LW-SBC.
Content-Length: 0.
.
U 2014/08/01 10:04:23.724531 10.9.23.180:5060 -> 82.52.98.37:18364
INVITE sip:casa@82.52.98.37:18364;rinstance=5921eb71002a2afb SIP/2.0.
Record-Route: <sip:151.8.3.248;r2=on;lr=on;ftag=2d732820;nat=yes>.
Record-Route: <sip:172.16.52.240;r2=on;lr=on;ftag=2d732820;nat=yes>.
Via: SIP/2.0/UDP
151.8.3.248;branch=z9hG4bK7905.f0a6a9d363f21101fbb7e8bce3d9fe47.0.
Via: SIP/2.0/UDP
172.16.52.53:26986;branch=z9hG4bK-d8754z-a5f22c435ade0779-1---d8754z-;rport=26986.
Max-Forwards: 69.
Contact: <sip:bria@172.16.52.53:26986>.
To: <sip:1002@lwsbc.longwave.eu>.
From: "BRIA"<sip:bria@lwsbc.longwave.eu>;tag=2d732820.
Call-ID: YWIyMWVlYzgyMTRmODBkYWE3YWM3NTlhMTIyOWYyYjg.
CSeq: 1 INVITE.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE,
INFO.
Content-Type: application/sdp.
Supported: replaces.
User-Agent: Bria 3 release 3.5.5 stamp 71243.
Content-Length: 503.
.
v=0.
o=- 1406880237226243 1 IN IP4 151.8.3.248.
s=Bria 3 release 3.5.5 stamp 71243.
c=IN IP4 151.8.3.248.
t=0 0.
m=audio 41258 RTP/AVP 123 122 121 120 9 8 0 18 98 100 97 101.
a=rtpmap:123 opus/48000/2.
a=fmtp:123 useinbandfec=1.
a=rtpmap:122 SILK/24000.
a=rtpmap:121 SILK/16000.
a=rtpmap:120 SILK/8000.
a=rtpmap:18 G729/8000.
a=fmtp:18 annexb=yes.
a=rtpmap:98 ILBC/8000.
a=rtpmap:100 speex/16000.
a=rtpmap:97 speex/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=sendrecv.
a=nortpproxy:yes.
U 2014/08/01 10:04:23.915109 82.52.98.37:18364 -> 10.9.23.180:5060
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP
151.8.3.248;branch=z9hG4bK7905.f0a6a9d363f21101fbb7e8bce3d9fe47.0.
Via: SIP/2.0/UDP
172.16.52.53:26986;branch=z9hG4bK-d8754z-a5f22c435ade0779-1---d8754z-;rport=26986.
To: <sip:1002@lwsbc.longwave.eu>.
From: "BRIA"<sip:bria@lwsbc.longwave.eu>;tag=2d732820.
Call-ID: YWIyMWVlYzgyMTRmODBkYWE3YWM3NTlhMTIyOWYyYjg.
CSeq: 1 INVITE.
Content-Length: 0.
.
U 2014/08/01 10:04:32.424475 82.52.98.37:18364 -> 10.9.23.180:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP
151.8.3.248;branch=z9hG4bK7905.f0a6a9d363f21101fbb7e8bce3d9fe47.0.
Via: SIP/2.0/UDP
172.16.52.53:26986;branch=z9hG4bK-d8754z-a5f22c435ade0779-1---d8754z-;rport=26986.
Record-Route: <sip:151.8.3.248;lr;r2=on;ftag=2d732820;nat=yes>.
Record-Route: <sip:172.16.52.240;r2=on;lr=on;ftag=2d732820;nat=yes>.
Contact: <sip:casa@82.52.98.37:18364>.
To: <sip:1002@lwsbc.longwave.eu>;tag=33f38342.
From: "BRIA"<sip:bria@lwsbc.longwave.eu>;tag=2d732820.
Call-ID: YWIyMWVlYzgyMTRmODBkYWE3YWM3NTlhMTIyOWYyYjg.
CSeq: 1 INVITE.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE,
INFO.
Content-Type: application/sdp.
Supported: replaces, eventlist.
User-Agent: X-Lite release 4.6.1 stamp 73073 52ef741c-W.
Content-Length: 274.
.
v=0.
o=- 13051353836957654 3 IN IP4 192.168.1.102.
s=X-Lite release 4.6.1 stamp 73073.
c=IN IP4 82.52.98.37.
t=0 0.
m=audio 64678 RTP/AVP 123 9 8 0 100 101.
a=rtpmap:123 opus/48000/2.
a=rtpmap:100 speex/16000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=sendrecv.
U 2014/08/01 10:04:32.428733 172.16.52.240:5060 -> 172.16.52.53:26986
SIP/2.0 200 OK.
Via: SIP/2.0/UDP
172.16.52.53:26986;branch=z9hG4bK-d8754z-a5f22c435ade0779-1---d8754z-;rport=26986.
Record-Route: <sip:151.8.3.248;lr;r2=on;ftag=2d732820;nat=yes>.
Record-Route: <sip:172.16.52.240;r2=on;lr=on;ftag=2d732820;nat=yes>.
Contact: <sip:casa@82.52.98.37:18364>.
To: <sip:1002@lwsbc.longwave.eu>;tag=33f38342.
From: "BRIA"<sip:bria@lwsbc.longwave.eu>;tag=2d732820.
Call-ID: YWIyMWVlYzgyMTRmODBkYWE3YWM3NTlhMTIyOWYyYjg.
CSeq: 1 INVITE.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE,
INFO.
Content-Type: application/sdp.
Supported: replaces, eventlist.
User-Agent: X-Lite release 4.6.1 stamp 73073 52ef741c-W.
Content-Length: 290.
.
v=0.
o=- 13051353836957654 3 IN IP4 151.8.3.248.
s=X-Lite release 4.6.1 stamp 73073.
*c=IN IP4 151.8.3.248.* */<-------------- SHOULD BE "82.52.98.37",
RIGHT???????/*
t=0 0.
m=audio 39646 RTP/AVP 123 9 8 0 100 101.
a=rtpmap:123 opus/48000/2.
a=rtpmap:100 speex/16000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=sendrecv.
a=nortpproxy:yes.
U 2014/08/01 10:04:32.436685 172.16.52.53:26986 -> 172.16.52.240:5060
ACK sip:casa@82.52.98.37:18364 SIP/2.0.
Via: SIP/2.0/UDP
172.16.52.53:26986;branch=z9hG4bK-d8754z-b0191c4c958e1902-1---d8754z-;rport.
Max-Forwards: 70.
Route: <sip:172.16.52.240;lr;r2=on;ftag=2d732820;nat=yes>.
Route: <sip:151.8.3.248;lr;r2=on;ftag=2d732820;nat=yes>.
Contact: <sip:bria@172.16.52.53:26986>.
To: <sip:1002@lwsbc.longwave.eu>;tag=33f38342.
From: "BRIA"<sip:bria@lwsbc.longwave.eu>;tag=2d732820.
Call-ID: YWIyMWVlYzgyMTRmODBkYWE3YWM3NTlhMTIyOWYyYjg.
CSeq: 1 ACK.
User-Agent: Bria 3 release 3.5.5 stamp 71243.
Content-Length: 0.
.
U 2014/08/01 10:04:32.440227 10.9.23.180:5060 -> 82.52.98.37:18364
ACK sip:casa@82.52.98.37:18364 SIP/2.0.
Via: SIP/2.0/UDP
151.8.3.248;branch=z9hG4bK7905.16c6f9b2683c9c0447b0ad82f671cea4.0.
Via: SIP/2.0/UDP
172.16.52.53:26986;branch=z9hG4bK-d8754z-b0191c4c958e1902-1---d8754z-;rport=26986.
Max-Forwards: 69.
Contact: <sip:bria@172.16.52.53:26986>.
To: <sip:1002@lwsbc.longwave.eu>;tag=33f38342.
From: "BRIA"<sip:bria@lwsbc.longwave.eu>;tag=2d732820.
Call-ID: YWIyMWVlYzgyMTRmODBkYWE3YWM3NTlhMTIyOWYyYjg.
CSeq: 1 ACK.
User-Agent: Bria 3 release 3.5.5 stamp 71243.
THANK YOU AGAIN
--
View this message in context:
http://sip-router.1086192.n5.nabble.com/Complex-NAT-Scenario-HELP-tp129226p…
Sent from the Users mailing list archive at
Nabble.com.