<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-2" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18904">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I noticed a strange effect when calling
initiateByMediaType() more than once during session setup. </FONT></DIV>
<DIV><FONT size=2 face=Arial>In my application I call setup methods in the
following order:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>...</FONT></DIV>
<DIV><FONT size=2 face=Arial>pSession->initiateByMediaType( "video/H264"
);</FONT></DIV>
<DIV><FONT size=2 face=Arial>pClient->setupMediaSubsession();</FONT></DIV>
<DIV><FONT size=2 face=Arial>pSession->initiateByMediaType( "audio/PCMU"
);</FONT></DIV>
<DIV><FONT size=2 face=Arial>pClient->setupMediaSubsession();<BR></FONT><FONT
size=2 face=Arial>pClient->playMediaSession();</FONT></DIV>
<DIV><FONT size=2 face=Arial>...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>and the problem is that during the first call
an audio session is initiated, its session socket is created
</FONT></DIV>
<DIV><FONT size=2 face=Arial>and a local port is stored in fClientPortNum
- but immediately after that this session is deinitiated ( as</FONT></DIV>
<DIV><FONT size=2 face=Arial>it is not "video/H264" ), and all sockets are
closed. In the next step a video session is initiated and the</FONT></DIV>
<DIV><FONT size=2 face=Arial>system assigns exactly the same port to it (
it is ok because all previously open sockets are already
</FONT></DIV>
<DIV><FONT size=2 face=Arial>closed ). When I
call initiateByMediaType( "audio/PCMU" ) an audio session is
initiated once again,</FONT></DIV>
<DIV><FONT size=2 face=Arial>but now it binds explicitly to fClientPortNum which
is the same port as used in a video session ! </FONT> <FONT
size=2 face=Arial>The </FONT></DIV>
<DIV><FONT size=2 face=Arial>system has no problem with it as SO_REUSEADDR is
set on both sockets ( and Windows allows</FONT></DIV>
<DIV><FONT size=2 face=Arial>multiple sockets to be bound to one
address, which is slightly different behaviour as in Unix, I think
),</FONT></DIV>
<DIV><FONT size=2 face=Arial>Windows delivers all incoming packets only to
one of these sockets, so I hear no audio ( or I see no video ).
</FONT></DIV>
<DIV><FONT size=2 face=Arial>It happens </FONT><FONT size=2
face=Arial>occasionally, but it is dangerous as everything looks
ok, no errors are returned while, in fact,</FONT></DIV>
<DIV><FONT size=2 face=Arial>one </FONT><FONT size=2 face=Arial>media session is
idle.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Regards,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Kamil Dobkowski</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> </DIV></FONT></BODY></HTML>