<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 25, 2013 at 10:02 PM, Iwan Budi Kusnanto <span dir="ltr">&lt;<a href="mailto:ibk@labhijau.net" target="_blank">ibk@labhijau.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jul 25, 2013 at 7:56 PM, Anthony Minessale<br>
&lt;<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>&gt; wrote:<br>
&gt; Does it work either way?<br>
<br>
</div>Yes, it works either way. calling from chrome and calling to chrome.<br>
<div class="im"><br>
&gt; I guess another good question is what&#39;s the difference?<br>
<br>
</div>Yeah, what  is the difference?<br>
I&#39;m asking because of my curiousity, you use SSL_read not BIO_read<br>
while in the same time use BIO_write.<br>
<div class="im"><br></div></blockquote><div>I think basically since BIO_read is the next layer down in the code.  SSL_read just calls BIO_read anyway.</div><div>The BIO is only necessary because the dtls stream is mixed into the rtp/srtp/rtcp/srtcp stream and the BIO is being used as a emulated stream.</div>
<div>We write the dtls packets into it with BIO_write...  The read end is more like a normal ssl connection so the SSL_read is called on the ssl obj containing the bio.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
&gt;<br>
&gt; If you have a problem or refactoring the code has merit.  Submit a patch to<br>
&gt; Jira and provide details.<br>
<br>
</div>OK, will do if i have it.<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; On Jul 25, 2013 4:43 AM, &quot;Iwan Budi Kusnanto&quot; &lt;<a href="mailto:ibk@labhijau.net">ibk@labhijau.net</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt; Just curious, why use SSL_read in do_dtls() [1] while in the same time<br>
&gt;&gt; Freeswitch use BIO_write.<br>
&gt;&gt; Just wondering why not use BIO_read.<br>
&gt;&gt;<br>
&gt;&gt; I replaced SSL_read with BIO_read and it is working fine with chrome<br>
&gt;&gt; for few calls.<br>
&gt;&gt; Not intensive test actually.<br>
&gt;&gt; So, the line become if (BIO_read(dtls-&gt;write_bio, dtls-&gt;data,<br>
&gt;&gt; dtls-&gt;bytes) == (int)dtls-&gt;bytes)<br>
&gt;&gt;<br>
&gt;&gt; Another question, still in do_dtls() about this line:<br>
&gt;&gt; BIO_write(dtls-&gt;read_bio, dtls-&gt;data, dtls-&gt;bytes)<br>
&gt;&gt;<br>
&gt;&gt; Why use dtls-&gt;read_bio in write operation?<br>
&gt;&gt;<br>
&gt;&gt; Why also need dtls-&gt;write_bio in my BIO_read above.<br>
&gt;&gt; It seems weird for me<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; [1]<a href="https://github.com/FreeSWITCH/FreeSWITCH/blob/master/src/switch_rtp.c#L2376" target="_blank">https://github.com/FreeSWITCH/FreeSWITCH/blob/master/src/switch_rtp.c#L2376</a><br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Iwan Budi Kusnanto<br>
&gt;&gt;<br>
&gt;&gt; _________________________________________________________________________<br>
&gt;&gt; Professional FreeSWITCH Consulting Services:<br>
&gt;&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt;&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;&gt;<br>
&gt;&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt;&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;&gt;<br>
&gt;&gt; Official FreeSWITCH Sites<br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt;&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;&gt;<br>
&gt;&gt; FreeSWITCH-dev mailing list<br>
&gt;&gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
&gt;&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt;&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt;&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
&gt;<br>
&gt; _________________________________________________________________________<br>
&gt; Professional FreeSWITCH Consulting Services:<br>
&gt; <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
&gt; <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
&gt;<br>
&gt; FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
&gt; <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
&gt;<br>
&gt; Official FreeSWITCH Sites<br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt; <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
&gt; <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
&gt;<br>
&gt; FreeSWITCH-dev mailing list<br>
&gt; <a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
Iwan Budi Kusnanto<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900
</div></div>