public void iceCandidatesReceived(JSONArray candidates){
  if (isActive()) {
    for (int ii=0; ii < candidates.length(); ii++) {
      try {
        JSONObject eachCandidate=(JSONObject)candidates.get(ii);
        String mid=eachCandidate.getString("sdpMid");
        int sdpLineIndex=eachCandidate.getInt("sdpMLineIndex");
        String sdp=eachCandidate.getString("candidate");
        IceCandidate rtcCandidate=new IceCandidate(mid,sdpLineIndex,sdp);
        try {
          queuedRemoteCandidatesSemaphore.acquire();
          if (null != queuedRemoteCandidates) {
            queuedRemoteCandidates.add(rtcCandidate);
          }
 else {
            peerConnection.addIceCandidate(rtcCandidate);
          }
          queuedRemoteCandidatesSemaphore.release();
        }
 catch (        InterruptedException e) {
          Log.d(TAG,"Error with remote candidates semaphore");
        }
      }
 catch (      JSONException e) {
        Log.d(TAG,"Error processing remote ice candidate data");
      }
    }
  }
}

public void iceCandidatesReceived ( JSONArray candidates ) { if ( isActive ( ) ) { for ( int ii = 0 ; ii < candidates . length ( ) ; ii ++ ) { try { JSONObject eachCandidate = ( JSONObject ) candidates . get ( ii ) ; String mid = eachCandidate . getString ( "sdpMid" ) ; int sdpLineIndex = eachCandidate . getInt ( "sdpMLineIndex" ) ; String sdp = eachCandidate . getString ( "candidate" ) ; IceCandidate rtcCandidate = new IceCandidate ( mid , sdpLineIndex , sdp ) ; try { queuedRemoteCandidatesSemaphore . acquire ( ) ; if ( null != queuedRemoteCandidates ) { queuedRemoteCandidates . add ( rtcCandidate ) ; } else { peerConnection . addIceCandidate ( rtcCandidate ) ; } queuedRemoteCandidatesSemaphore . release ( ) ; } catch ( InterruptedException e ) { Log . d ( TAG , "Error with remote candidates semaphore" ) ; } } catch ( JSONException e ) { Log . d ( TAG , "Error processing remote ice candidate data" ) ; } } } }
process ice candidates suggested by the remote endpoint . this is used internally to the sdk and should not be called directly by your client application .
