Hi Folks,
I have a problem with the hiding of my topology. Topoh module works great. THX for that. However SDP is not processed by this module. I suppose that mediaproxy should be the one who should care about this.
Owner(o) part of the body holds original IP of the sender, even thou Creator(c) part was modified using engage_media_proxy(). Actually this was reported as a mediaproxy bug, but till now unresolved.
After engage_mediaproxy(): (mind the "o=" and "c=")
v=0
o=- 102971 102971 IN IP4 192.168.0.5
s=-
c=IN IP4 8.8.8.8
t=0 0
.
.
.
So I tried fix_nated_sdp("8","8.8.8.8"). "o" part is OK now but oldmediaip attribute was added at the bottom of the body. Addition of this attribute was added to nathelper back in the 2003 for debuging purposes. Unfortunately this ruins a whole idea of the topology hiding.
After fix_nated_contact(): (mid the "o=", "c=" and last "a=")
v=0
o=- 102971 102971 IN IP4 8.8.8.8
s=-
c=IN IP4 8.8.8.8
t=0 0
m=audio 35008 RTP/AVP 0 2 4 8 18 96 97 98 101
a=rtpmap:0 PCMU/8000
.
.
.
a=rtpmap:101 telephone-event/8000
a=oldmediaip:192.168.0.5
The only "nice" solution I was able to do was changing the source of the nathelper module.
.
.
body2.s = oldip.s + oldip.len;
body2.len = bodylimit - body2.s;
if (alter_mediaip(msg, &body1, &oldip, pf, &newip, pf,1) == -1) {
LM_ERR("can't alter '%s' IP\n",line);
return -1;
.
.
On the line 1326(alter_mediaip above) in the file kamailio_k/nathelper.c I changed last argument from 1 to 0. This attribute is called preserve and adds mentioned "oldmediaip" attribute to the body. Simple changing it to 0 solved the problem.
So I can live with this solution but it would be much more better to have it from the git repo.
Do I phantom it wrong or this might be considered as a bug? Shouldn't it be better to have option to configure it?
Tested using last night build of the kamailio.
Thanks for the answer.
Regards,
Efelin