public synchronized void established(final SipServletResponse successResponse) throws CallException, IOException { final List<State> possibleStates = new ArrayList<State>(); possibleStates.add(QUEUED); possibleStates.add(RINGING); assertState(possibleStates); byte[] answer = successResponse.getRawContent(); try { if(answer != null) { answer = patchMedia(successResponse.getInitialRemoteAddr(), successResponse.getRawContent()); final ConnectionDescriptor remoteDescriptor = new ConnectionDescriptor(new String(answer)); userAgentConnection.modify(remoteDescriptor); } else { terminate(); setState(FAILED); fireStatusChanged(); throw new CallException("The remote client did not send an SDP answer with their 200 OK response."); } } catch(final SdpException exception) { terminate(); setState(FAILED); fireStatusChanged(); throw new CallException(exception); } final SipServletRequest ack = successResponse.createAck(); ack.send(); }
Sid organizationSid = daoManager.getAccountsDao().getAccount(callRecord.getAccountSid()).getOrganizationSid(); if (response.getRawContent() != null && response.getRawContent().length > 0 ) { final byte[] sdp = response.getRawContent(); String offer = null; if (response.getContentType().equalsIgnoreCase("application/sdp") && patchForNat) {