njovy / AppRTCDemo

Android AppRTC Demo of WebRTC project
534 stars 266 forks source link

Not sending username and password to turn server #47

Open appunnicer13 opened 7 years ago

appunnicer13 commented 7 years ago

I am having own turn server , and i see in the logs that the requests from the app are having no username , but one from webclient have . Please help me with this. I changed some code to allow to add turn server from turn_server_override options as well as . My turnservers were not appearing in pc_config .

// Return the list of ICE servers described by a WebRTCPeerConnection // configuration string. private LinkedList iceServersFromTurnOverrideJSON(String turnServerOverride) throws JSONException { JSONArray json = new JSONArray(turnServerOverride); LinkedList ret = new LinkedList(); for(int j = 0; j < json.length(); ++j){ JSONObject server = json.getJSONObject(j); JSONArray urls = server.getJSONArray("urls"); String credential = server.has("credential") ? server.getString("credential") : ""; String username = server.has("username") ? server.getString("username") : ""; for(int i = 0; i < urls.length(); i++){ String url = urls.getString(i); ret.add(new PeerConnection.IceServer(url, username, credential)); } } return ret; }

appunnicer13 commented 7 years ago

in the console verbos i could see my turn server , that means parsing was fine . but at time of connection with another client . I get ICE connection failed error. I suppose it is because of username problem .