<html>
<body>
<br>
Folks,<br><br>
In my cfg file I've this block. I call this block when I receive a
request from a private IP (ex. 192.168.x.x)<br><br>
/* route block for mangling */<br>
route[1] {<br><br>
log(1, "route-block 1
(mangling)\n");<br><br>
# we mangle the contact
address and ports in SDP part of the message<br>
if (method ==
"INVITE") {<br><br>
setflag(1);<br><br>
log(1, "mangle block: INVITE received and we will mangle ip
\n");<br><br>
sdp_mangle_ip("192.168.0.0/255.0.0.0",
"192.168.0.99");<br><br>
};<br><br>
# rewrite Contact:
header<br>
if (search("Contact:
.*@192\.168\.")) {<br>
/* we seem to have a private address on a Contact which is not valid
*/<br>
encode_contact("enc_prefix","192.168.0.99");<br>
xlog("L_NOTICE", "mangle block: encoded Contact header:
<%ct> \n");<br>
};<br>
}<br><br>
When I send an INVITE I can see in SDP:<br>
Content-Type: application/sdp..<br>
Content-Length: 204..204Contact: Andrea Girardi
<sip:enc_prefix*andrea**192.168.0.98*5060*@192.168.0.99>..<br>
User-Agent: SCS/v3.1.12.33..<br>
..<br>
v=0..<br>
o=AndreaGirardi13698577 0 IN IP4 192.168.0.98..<br>
s=ScS Client..<br>
c=IN IP4 217.57.90.117..<br>
t=0 0..<br>
m=audio 1154 RTP/AVP 0 8 4..<br>
a=rtpmap:0 PCM U/8000..<br>
a=rtpmap:8 PCMA/8000..<br>
a=rtpmap:4 G723/8000..<br>
a=ptime: 30.. <br><br>
This work correctly when USERA send an Invite to USERB, but when USERB
send 200 ok this is the SDP:<br>
Content-Type: application/sdp..<br>
Content-Length: 189....<br>
v=0..<br>
o=braies 0 0 IN IP4 192.168.0.98..<br>
s=ScS Client..<br>
c=IN IP4 192.168.0.98..<br>
b=CT:1000..<br>
t=0 0..<br>
m=audio 57820 RTP/AVP 0 8 4..<br>
a=rtpmap:0 PCMU/8000..<br>
a=rtpmap:8 PCMA/8000..<br>
a=rtpmap:4 G723/8000.. <br><br>
It's correct or User B has to change c field in SDP? How?<br><br>
Can I see a encoded contact
(sip:enc_pref*username*ip*port*protocol@public_ip *) with xlog or simply
in stderr?<br>
i've tried to use %ct but it return
<sip:userA@192.168.0.97:5060><br><br>
is it better to use nathelper or mangler?<br><br>
Thanks, Andrea<br><br>
<x-sigsep><p></x-sigsep>
-------------------------------------------------------<br>
<b><i>Andrea Girardi<br>
</b>mobile +39 347 9624051<br>
sip address: giandrea@sip.quellidelpirana.it<br>
</i><a href="http://www.giandrea.com/" eudora="autourl">http://www.giandrea.com<br>
</a></body>
</html>