Hi all,
I've recently started working on getting the existing Asterisk 11 DTLS-SRTP implementation to work with Chrome and Firefox WebRTC implementations. The existing implementation was already quite complete and well done, so I only needed to study the interactions and check what could be missing.
I won't get in the details of what was needed to start to actually get this working (I had to hack a few things around, so feel free to ask me if you're interested), and I'll jump right to the point of what has been puzzling me these last days, in what I think may be the last obstacles left to actually make it work.
My scenario is simple: the browser (either Chrome or Firefox) is the caller, and Asterisk (an Echo test application preceded by a Playback) is the callee through a simple SIP gateway application I implemented, which means that, according from what I've read around, the browser will be the DTLS server while Asterisk will be the DTLS client. Right now, after a successul ICE completion, it apparently looks like the DTLS handshake is correctly completed, and the SRTP keys to use are extracted on the Asterisk side to complete the setup: nevertheless, Asterisk is the only one to start generating RTP, which is ignored by Chrome who, on the other end, does not generate any RTP packet either. I've captured a sample flow using Wireshark (attached as chrome-dtls.srtp, Asterisk on the left side and browser on the right) which I tried to debug and compare to a successful flow that was shared on this group some time ago (
https://discuss-webrtc.googlegroups.com/attach/77ed6aa572e23bfa/dtls-ok.txt?pli=1&view=1&part=4, not sure which parties were involved).
I don't see many differences, except that:
- in that flow each DTLS message is sent twice, which doesn't happen in my scenario (not a big deal, I guess);
- in that flow the DTLS client sends his info (Certificate, Client Key Exchange, etc.) as separate messages, whereas in my scenario both the client and the server group them (again, probably not a big deal);
- the same messages are exchanged in both flows, with the exception of "Server Key Exchange" that apparently is missing in my scenario (which means that both Chrome and Firefox are not sending it for some reason?).
Apart from that, I really don't know what's going wrong: looking at my scenario flow you can see that the RTP packets only start flowing from Asterisk towards the browser (displayed as UDP in the dump, but it's RTP), while the only messages Chrome keeps on sending are a few occasional connectivity checks.
Considering that this happens with both Chrome and Firefox, my guess is that there actually is something missing on my side: probably something that both browsers are expecting to complete the scenario before being able to communicate. Needless to say, no exception is triggered on the JavaScript concole, and I couldn't find any problem in the browser logs as well. I'm also attaching (as chrome-asterisk-sip-dtls.txt) the SDP that is exchanged between the two: the fake crypto line is there as well to that shouldn't be the cause.
What am I missing? Is there something that Chrome in particular expects in this scenario? Doing the same with SDES instead of DTLS works flawlessly, which means it's not an ICE/network/media issue. Is there any flag I can pass to Chrome at runtime to enable DTLS-specific logging?
Thanks,
Lorenzo