i made some ICE=force_relay tests between two baresip sip uas running on
the same host. the result was that they decided to use relay candidates
even when direct connection would have been possible.
the question is why? is it a bug in baresip's ice implementation or is
it a result of the fact that rtpengine changed ip address on c line and
port on m line (which, in opinion, it should not have done), or is the
priority of relay candidates wrong (i.e., smaller value means higher
priority)?
sdps are shown below. any hints would be appreciated. i'll cc also to
baresip list.
-- juha
----------- invite sdp to sip proxy from caller
v=0.
o=- 1831289157 1375419182 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:EIQC.
a=ice-pwd:DNXuahNdPEKC53rtVnweqq.
m=audio 10518 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:2581598159 cname:sip:test@test.tutpro.com.
a=ptime:20.
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10518 typ host.
a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10519 typ host.
a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10518 typ host.
a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10519 typ host.
a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10518 typ host.
a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10519 typ host.
a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10518 typ host.
a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10519 typ host.
a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10518 typ host.
a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10519 typ host.
----------- invite sdp from sip proxy callee
v=0.
o=- 1831289157 1375419182 IN IP4 192.98.102.30.
s=-.
c=IN IP4 192.98.102.30.
t=0 0.
a=tool:baresip 0.4.10.
a=ice-lite.
a=ice-ufrag:EIQC.
a=ice-pwd:DNXuahNdPEKC53rtVnweqq.
m=audio 50012 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:2581598159 cname:sip:test@test.tutpro.com.
a=ptime:20.
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10518 typ host.
a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10519 typ host.
a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10518 typ host.
a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10519 typ host.
a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10518 typ host.
a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10519 typ host.
a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10518 typ host.
a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10519 typ host.
a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10518 typ host.
a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10519 typ host.
a=sendrecv.
a=rtcp:50013.
a=candidate:bTYPlIJSc0vw3WjT 1 UDP 16777216 192.98.102.30 50012 typ relay.
a=candidate:bTYPlIJSc0vw3WjT 2 UDP 16777215 192.98.102.30 50013 typ relay.
----------- 200 ok sdp from callee to sip proxy
v=0.
o=- 2323140971 266432672 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:cxB9.
a=ice-pwd:mLyJkKOP8xHg3Yv9R0BClp.
m=audio 10332 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:2733287141 cname:sip:jh@test.tutpro.com.
a=ptime:20.
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10332 typ host.
a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10333 typ host.
a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10332 typ host.
a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10333 typ host.
a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10332 typ host.
a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10333 typ host.
a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10332 typ host.
a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10333 typ host.
a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10332 typ host.
a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10333 typ host.
----------- 200 ok sdp from sip proxy to caller
v=0.
o=- 2323140971 266432672 IN IP4 192.98.102.30.
s=-.
c=IN IP4 192.98.102.30.
t=0 0.
a=tool:baresip 0.4.10.
a=ice-lite.
a=ice-ufrag:cxB9.
a=ice-pwd:mLyJkKOP8xHg3Yv9R0BClp.
m=audio 50014 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:2733287141 cname:sip:jh@test.tutpro.com.
a=ptime:20.
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10332 typ host.
a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10333 typ host.
a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10332 typ host.
a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10333 typ host.
a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10332 typ host.
a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10333 typ host.
a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10332 typ host.
a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10333 typ host.
a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10332 typ host.
a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10333 typ host.
a=sendrecv.
a=rtcp:50015.
a=candidate:bTYPlIJSc0vw3WjT 1 UDP 16777216 192.98.102.30 50014 typ relay.
----------------------------
during call baresip reports that relay ip/port is in use:
RTP debug:
Encode: seq=6904 ssrc=0x99e00fcf
----- RTCP Session: -----
cname=sip:test@test.tutpro.com SSRC=0x99e00fcf/2581598159 rx=48000Hz
member 0xa2eaa6e5: lost=0 Jitter=19.6ms RTT=0.7ms
IP=192.98.102.30:50014 psent=512 rcvd=736
TX: packets=737, octets=179009