On Thu, Jul 25, 2013 at 10:02 PM, Iwan Budi Kusnanto <ibk@labhijau.net> wrote:
On Thu, Jul 25, 2013 at 7:56 PM, Anthony Minessale
<anthony.minessale@gmail.com> wrote:
> Does it work either way?

Yes, it works either way. calling from chrome and calling to chrome.

> I guess another good question is what's the difference?

Yeah, what  is the difference?
I'm asking because of my curiousity, you use SSL_read not BIO_read
while in the same time use BIO_write.

I think basically since BIO_read is the next layer down in the code.  SSL_read just calls BIO_read anyway.
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.
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.

 
>
> If you have a problem or refactoring the code has merit.  Submit a patch to
> Jira and provide details.

OK, will do if i have it.

>
> On Jul 25, 2013 4:43 AM, "Iwan Budi Kusnanto" <ibk@labhijau.net> wrote:
>>
>> Hi,
>> Just curious, why use SSL_read in do_dtls() [1] while in the same time
>> Freeswitch use BIO_write.
>> Just wondering why not use BIO_read.
>>
>> I replaced SSL_read with BIO_read and it is working fine with chrome
>> for few calls.
>> Not intensive test actually.
>> So, the line become if (BIO_read(dtls->write_bio, dtls->data,
>> dtls->bytes) == (int)dtls->bytes)
>>
>> Another question, still in do_dtls() about this line:
>> BIO_write(dtls->read_bio, dtls->data, dtls->bytes)
>>
>> Why use dtls->read_bio in write operation?
>>
>> Why also need dtls->write_bio in my BIO_read above.
>> It seems weird for me
>>
>>
>> [1]https://github.com/FreeSWITCH/FreeSWITCH/blob/master/src/switch_rtp.c#L2376
>>
>> --
>> Iwan Budi Kusnanto
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting@freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server
>> http://www.cudatel.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-dev mailing list
>> FreeSWITCH-dev@lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
>> http://www.freeswitch.org
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting@freeswitch.org
> http://www.freeswitchsolutions.com
>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server
> http://www.cudatel.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev@lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>



--
Iwan Budi Kusnanto

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org
googletalk:conf+888@conference.freeswitch.org
pstn:+19193869900