[Devel] [ openser-Bugs-1673089 ] bad c= with nathelper and rtpproxy -l

SourceForge.net noreply at sourceforge.net
Thu Mar 8 14:32:33 CET 2007


Bugs item #1673089, was opened at 2007-03-03 20:55
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1673089&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Manuel Guesdon (mguesdon)
Assigned to: Bogdan (bogdan_iancu)
Summary: bad c= with nathelper and rtpproxy -l 

Initial Comment:

OpenSer openser-1.1.1-tls (22-Jan-2007 15:03)

I run rtpproxy with -l 1.2.3.36

A sip message containing:
       c=IN IP4 10.250.0.130 
         (10.250.0.130 is the natted network)
is transformed to:
       c=IN IP4 4.5.6.1451.2.3.36
         (4.5.6.145 is the public IP of the natted network).

As far as I understand, 4.5.6.145 is not replaced by 1.2.3.36 but 1.2.3.36 is appended.

I think the problem is in alter_mediaip (in nethelper.c).

Here is some traces:
force_rtp_proxy2: proxy reply: 35046 1.2.3.36

in alter_mediaip: oldip=10.250.0.130 newip is 1.2.3.36
                  oldpf=2 newpf=2
                  oip.s and offset seems ok

in build_res_from_sip_res I see 
      c=IN IP4 4.5.6.1451.2.3.36
just after 
      process_lumps(msg, msg->add_rm, new_buf, &offset, &s_offset, 0);/*FIXME:*/
      process_lumps(msg, msg->body_lumps, new_buf, &offset, &s_offset, 0);


----------------------------------------------------------------------

>Comment By: Bogdan (bogdan_iancu)
Date: 2007-03-08 15:32

Message:
Logged In: YES 
user_id=1275325
Originator: NO

another alternative will be to use rtpproxy in bridging mode (with one
internal and one external ip) and properly set the igress /egress flag when
calling force_rtp_proxy().

----------------------------------------------------------------------

Comment By: Bogdan (bogdan_iancu)
Date: 2007-03-07 12:50

Message:
Logged In: YES 
user_id=1275325
Originator: NO

why don't you use :
  force_rtp_proxy([flags [, ip_address]])

See http://www.openser.org/docs/modules/1.2.x/nathelper.html#AEN289 .

this will avoid callid 2 functons to operate on the SDP IP.

The problems is on how the lumps works - they keep changes based on the
original text, so, if you do multiple ops on the same text area, the result
will be bogus. For example, the IP is re-writen by having a "delete" lump
and an "insert" one - if you do ths twice, you wil have 2 lumps of each
type. Of course, delete can be done only once (you cannot delete twice same
area), but insert can be done multiple times...and this leads to what you
saw...


----------------------------------------------------------------------

Comment By: Brent (brent_thomson)
Date: 2007-03-07 00:38

Message:
Logged In: YES 
user_id=1734396
Originator: NO

It appears that the issue also arises when calling fix_nated_sdp() and
use_media_proxy() exactly once each. Calling both is necessesary if you're
changing the IP address from the one rtpproxy/mediaproxy advertises itself
on (which is necessary if the media/rtp proxy machine is NATted).

Why would calling fix_nated_sdp() or use_media_proxy() multiple times
cause the IP addresses to be prepended? Is there another kind of lump that
requires subsequent assignments to be prepended (instead of strictly
replacing the old value) if the value gets changed multiple times? 

----------------------------------------------------------------------

Comment By: Bogdan (bogdan_iancu)
Date: 2007-03-06 19:44

Message:
Logged In: YES 
user_id=1275325
Originator: NO

Hi Manuel,

are you sure you are not using multiple functions to manipulat the IPs in
SDP? usually this is the outcome when you try to change several times a
part of the message. So are you using also fix_nated_sdp() or
force_rtp_proxy() multiple times??

if not, please provide the inbound SDP and the exact command (including
paramters) you are using to change the IPs in SDP.

regards,
bogdan

----------------------------------------------------------------------

Comment By: Brent (brent_thomson)
Date: 2007-03-03 22:45

Message:
Logged In: YES 
user_id=1734396
Originator: NO

P.S. The code listed is from lines 1567-8 of msg_translator.c

----------------------------------------------------------------------

Comment By: Brent (brent_thomson)
Date: 2007-03-03 21:39

Message:
Logged In: YES 
user_id=1734396
Originator: NO

I can confirm this is also an issue when using mediaproxy.

Hans Fugal noticed the problem here:
http://hans.fugal.net/blog/articles/2006/02/04/use_media_proxy. He thought
it was due to calling use_media_proxy() twice, which it isn't _really_ but
appears to be since any attempt to change the SDP media address just
prepends the new address, instead of replacing it. You can see the same
effect by calling fix_nated_sdp().

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1673089&group_id=139143



More information about the Devel mailing list