Richard Fuchs writes:

> Fine with me. Should only take a couple of lines of code.

i edited daemon/sdp.c (diff enclosed) and after that o, c, and m lines
were left as is when ICE=force_relay was present.  also two baresips now
talked directly for rtp, but still used rtpengine for rtpc.

perhaps than can be explained by the fact that there was no
a=rtcp:<port> or a=rtcp-mux attribute in sdp from caller baresip:

v=0.
o=- 3026288523 667456406 IN IP4 192.168.43.146.
s=-.
c=IN IP4 192.168.43.146.
t=0 0.
a=tool:baresip 0.4.10.
a=ice-lite.
a=ice-ufrag:fjww.
a=ice-pwd:FjnvBvq6JcJqCuaQ1shfb5.
m=audio 10788 RTP/AVP 96 97 98 8 0 101.
b=AS:125.
a=rtpmap:96 opus/48000/2.
a=fmtp:96 stereo=1;sprop-stereo=1.
a=rtpmap:97 speex/16000.
a=fmtp:97 mode="7";vbr=off;cng=on.
a=rtpmap:98 speex/8000.
a=fmtp:98 mode="7";vbr=off;cng=on.
a=rtpmap:8 PCMA/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=sendrecv.
a=label:1.
a=rtcp-rsize.
a=ssrc:2097792405 cname:sip:[email protected].
a=ptime:20.
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10788 typ host.
a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10789 typ host.
a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10788 typ host.
a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10789 typ host.
a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10788 typ host.
a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10789 typ host.
a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10788 typ host.
a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10789 typ host.
a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10788 typ host.
a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10789 typ host.

but rtpengine went and added a=rtcp:50009 to sdp of the invite:

v=0.
o=- 3026288523 667456406 IN IP4 192.168.43.146.
s=-.
c=IN IP4 192.168.43.146.
t=0 0.
a=tool:baresip 0.4.10.
a=ice-lite.
a=ice-ufrag:fjww.
a=ice-pwd:FjnvBvq6JcJqCuaQ1shfb5.
m=audio 10788 RTP/AVP 96 97 98 8 0 101.
b=AS:125.
a=rtpmap:96 opus/48000/2.
a=fmtp:96 stereo=1;sprop-stereo=1.
a=rtpmap:97 speex/16000.
a=fmtp:97 mode="7";vbr=off;cng=on.
a=rtpmap:98 speex/8000.
a=fmtp:98 mode="7";vbr=off;cng=on.
a=rtpmap:8 PCMA/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-15.
a=label:1.
a=rtcp-rsize.
a=ssrc:2097792405 cname:sip:[email protected].
a=ptime:20.
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10788 typ host.
a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10789 typ host.
a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10788 typ host.
a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10789 typ host.
a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10788 typ host.
a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10789 typ host.
a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10788 typ host.
a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10789 typ host.
a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10788 typ host.
a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10789 typ host.
a=sendrecv.
a=rtcp:50009.
a=candidate:vWmFu3vQHsxxmORV 1 UDP 16777216 192.98.102.30 50008 typ relay.
a=candidate:vWmFu3vQHsxxmORV 2 UDP 16777215 192.98.102.30 50009 typ relay.

it thus looks like that when ICE=force_relay is given, also adding of
a=rtcp:<port> need to be prevented.

-- juha

*** sdp.c       Mon Apr 28 17:46:41 2014
--- /usr/src/opensipg/trunk/src/rtpengine/daemon/sdp.c  Tue Apr 29 22:15:26 2014
***************
*** 1670,1680 ****
                        }
                }
  
!               if (session->origin.parsed && flags->replace_origin) {
                        if (replace_network_address(chop, 
&session->origin.address, ps, flags))
                                goto error;
                }
!               if (session->connection.parsed && sess_conn) {
                        if (replace_network_address(chop, 
&session->connection.address, ps, flags))
                                goto error;
                }
--- 1670,1682 ----
                        }
                }
  
!               if (session->origin.parsed && flags->replace_origin &&
!                   !flags->ice_force_relay) {
                        if (replace_network_address(chop, 
&session->origin.address, ps, flags))
                                goto error;
                }
!               if (session->connection.parsed && sess_conn &&
!                   !flags->ice_force_relay) {
                        if (replace_network_address(chop, 
&session->connection.address, ps, flags))
                                goto error;
                }
***************
*** 1703,1718 ****
                                goto error;
                        ps = j->data;
  
!                       if (replace_media_port(chop, sdp_media, ps))
!                               goto error;
!                       if (replace_consecutive_port_count(chop, sdp_media, ps, 
j))
!                               goto error;
!                       if (replace_transport_protocol(chop, sdp_media, 
call_media))
!                               goto error;
! 
!                       if (sdp_media->connection.parsed) {
!                               if (replace_network_address(chop, 
&sdp_media->connection.address, ps, flags))
!                                       goto error;
                        }
  
                        if (process_media_attributes(chop, sdp_media, flags, 
call_media))
--- 1705,1722 ----
                                goto error;
                        ps = j->data;
  
!                       if (!flags->ice_force_relay) {
!                               if (replace_media_port(chop, sdp_media, ps))
!                                       goto error;
!                                       if 
(replace_consecutive_port_count(chop, sdp_media, ps, j))
!                                       goto error;
!                               if (replace_transport_protocol(chop, sdp_media, 
call_media))
!                                       goto error;
! 
!                               if (sdp_media->connection.parsed) {
!                                       if (replace_network_address(chop, 
&sdp_media->connection.address, ps, flags))
!                                               goto error;
!                               }
                        }
  
                        if (process_media_attributes(chop, sdp_media, flags, 
call_media))
_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to