Since I also did a port into another language I know the pain of subtle things destroying everything :D. Couple of questions:
- Are you setting the SDP parameters the correct way? For producing, the client creates an offer and the remote answer is set afterwards. For consuming, the server creates the offer and the client sets the answer afterwards. I could imagine it only works one way because your setup is identical for both.
- Make sure you pass the correct DTLS parameters to the server. I once mistakenly sent back the server’s own DTLS parameters and the handshake obviously never succeeded.
- Regarding roles I have the following switch in my implementation for the producer:
switch (remoteDtlsParameters.getString("role")) {
case "client":
remoteMediaObj.put("setup", "active");
break;
case "server":
remoteMediaObj.put("setup", "passive");
break;
case "auto":
remoteMediaObj.put("setup", "active");
break;
}
so the role “auto” becomes active in my case, while it sounds like it becomes passive in yours - not really sure if that is of any importance or helps though.
Just some blind guesses, the easiest way to help would be if you could provide a pair of the offer and answer and ideally also the communication you are doing with the server up until that point to compare. Also, if you are not already doing it, please activate as much logging as possible on the server-side, this usually helps a lot more than the client-side when doing your own stuff since it’s the obvious stable part of the whole thing and usually gives a lot of feedback (dtls errors etc.).