/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { command.setRemoteConnectionDescriptor(new ConnectionDescriptor(sd)); } }
public int encode(JainMgcpResponseEvent event,byte[] array) { ModifyConnectionResponse response = (ModifyConnectionResponse) event; ReturnCode returnCode = response.getReturnCode(); int totalLength=ReturnCodeHandler.encode(array,0,returnCode); array[totalLength++]=StringFunctions.SPACE_BYTE; totalLength+=StringFunctions.encodeInt(array,totalLength,response.getTransactionHandle()); array[totalLength++]=StringFunctions.SPACE_BYTE; byte[] commentBytes=returnCode.getComment().getBytes(); System.arraycopy(commentBytes, 0, array,totalLength, commentBytes.length); totalLength+=commentBytes.length; array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getLocalConnectionDescriptor() != null) { array[totalLength++]=StringFunctions.NEWLINE_BYTE; byte[] rcdBytes=response.getLocalConnectionDescriptor().toString().getBytes(); System.arraycopy(rcdBytes, 0, array,totalLength, rcdBytes.length); totalLength+=rcdBytes.length; array[totalLength++]=StringFunctions.NEWLINE_BYTE; } return totalLength; }
if (mdcx.getRemoteConnectionDescriptor()!=null) { try { sessionDescription = SdpFactory.getInstance().createSessionDescription(mdcx.getRemoteConnectionDescriptor().toString()); isNonValidSdp = sessionDescription.getSessionName().getValue().contains("NonValidSDP"); } catch (SdpParseException e) { code = ReturnCode.Transaction_Executed_Normally; final ModifyConnectionResponse response = new ModifyConnectionResponse(self, code); final ConnectionDescriptor descriptor = new ConnectionDescriptor(sdp); response.setLocalConnectionDescriptor(descriptor); final int transaction = mdcx.getTransactionHandle();
public int encode(JainMgcpResponseEvent event,byte[] array) { ModifyConnectionResponse response = (ModifyConnectionResponse) event; ReturnCode returnCode = response.getReturnCode(); int totalLength=ReturnCodeHandler.encode(array,0,returnCode); array[totalLength++]=StringFunctions.SPACE_BYTE; totalLength+=StringFunctions.encodeInt(array,totalLength,response.getTransactionHandle()); array[totalLength++]=StringFunctions.SPACE_BYTE; byte[] commentBytes=returnCode.getComment().getBytes(); System.arraycopy(commentBytes, 0, array,totalLength, commentBytes.length); totalLength+=commentBytes.length; array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getLocalConnectionDescriptor() != null) { array[totalLength++]=StringFunctions.NEWLINE_BYTE; byte[] rcdBytes=response.getLocalConnectionDescriptor().toString().getBytes(); System.arraycopy(rcdBytes, 0, array,totalLength, rcdBytes.length); totalLength+=rcdBytes.length; array[totalLength++]=StringFunctions.NEWLINE_BYTE; } return totalLength; }
if (mdcx.getRemoteConnectionDescriptor() != null) { try { sessionDescription = SdpFactory.getInstance().createSessionDescription(mdcx.getRemoteConnectionDescriptor().toString()); isNonValidSdp = sessionDescription.getSessionName().getValue().contains("NonValidSDP"); } catch (SdpParseException e) { code = ReturnCode.Transaction_Executed_Normally; final ModifyConnectionResponse response = new ModifyConnectionResponse(self, code); final ConnectionDescriptor descriptor = new ConnectionDescriptor(sdp); response.setLocalConnectionDescriptor(descriptor); final int transaction = mdcx.getTransactionHandle();
/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { response.setLocalConnectionDescriptor(new ConnectionDescriptor(sd)); } }
public void processMgcpResponseEvent(JainMgcpResponseEvent evt) { ModifyConnectionResponse resp = (ModifyConnectionResponse) evt; switch (resp.getReturnCode().getValue()) { case ReturnCode.TRANSACTION_BEING_EXECUTED: return; case ReturnCode.TRANSACTION_EXECUTED_NORMALLY: try { connection.sdpPortManager.setLocalDescriptor(resp.getLocalConnectionDescriptor().toString()); connection.fsm.signal(ConnectionTransition.OPENED); } catch (UnknownTransitionException e) { } catch (Exception e) { e.printStackTrace(); connection.fsm.signalAsync(ConnectionTransition.FAILURE); } break; case ReturnCode.ENDPOINT_UNKNOWN : break; case ReturnCode.CONNECTION_WAS_DELETED: break; default: break; } } }
/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { response.setLocalConnectionDescriptor(new ConnectionDescriptor(sd)); } }
public void processMgcpResponseEvent(JainMgcpResponseEvent evt) { ModifyConnectionResponse resp = (ModifyConnectionResponse) evt; switch (resp.getReturnCode().getValue()) { case ReturnCode.TRANSACTION_BEING_EXECUTED: return; case ReturnCode.TRANSACTION_EXECUTED_NORMALLY: try { connection.sdpPortManager.setLocalDescriptor(resp.getLocalConnectionDescriptor().toString()); connection.fsm.signal(ConnectionTransition.OPENED); } catch (UnknownTransitionException e) { } catch (Exception e) { e.printStackTrace(); connection.fsm.signalAsync(ConnectionTransition.FAILURE); } break; case ReturnCode.ENDPOINT_UNKNOWN : break; case ReturnCode.CONNECTION_WAS_DELETED: break; default: break; } } }
/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { command.setRemoteConnectionDescriptor(new ConnectionDescriptor(sd)); } }
@Override public void execute(final Object message) throws Exception { /* Stop the timer. */ final UntypedActorContext context = getContext(); context.setReceiveTimeout(Duration.Undefined()); if (remoteDesc != null && remoteDesc.toString().contains("PleaseFailThisConnection")) { final CreateConnectionResponse response = (CreateConnectionResponse) message; if (connId == null) { connId = response.getConnectionIdentifier(); } fsm.transition(message, closing); return; } // Handle results from opening or modifying states. final Class<?> klass = message.getClass(); if (CreateConnectionResponse.class.equals(klass)) { super.execute(message); } else if (ModifyConnectionResponse.class.equals(klass)) { final ModifyConnectionResponse response = (ModifyConnectionResponse) message; localDesc = response.getLocalConnectionDescriptor(); } final ConnectionStateChanged event = new ConnectionStateChanged(localDesc, ConnectionStateChanged.State.OPEN, connId); for (final ActorRef observer : observers) { observer.tell(event, source); } // Log the state change. log(ConnectionStateChanged.State.OPEN); } }
/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { response.setLocalConnectionDescriptor(new ConnectionDescriptor(sd)); } }
byte[] rcdBytes=response.getRemoteConnectionDescriptor().toString().getBytes(); System.arraycopy(rcdBytes, 0, array,totalLength, rcdBytes.length); totalLength+=rcdBytes.length; byte[] lcdBytes=response.getLocalConnectionDescriptor().toString().getBytes(); System.arraycopy(lcdBytes, 0, array,totalLength, lcdBytes.length); totalLength+=lcdBytes.length; byte[] rcdBytes=response.getRemoteConnectionDescriptor().toString().getBytes(); System.arraycopy(rcdBytes, 0, array,totalLength, rcdBytes.length); totalLength+=rcdBytes.length;
/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { response.setLocalConnectionDescriptor(new ConnectionDescriptor(sd)); } }
byte[] rcdBytes=response.getRemoteConnectionDescriptor().toString().getBytes(); System.arraycopy(rcdBytes, 0, array,totalLength, rcdBytes.length); totalLength+=rcdBytes.length; byte[] lcdBytes=response.getLocalConnectionDescriptor().toString().getBytes(); System.arraycopy(lcdBytes, 0, array,totalLength, lcdBytes.length); totalLength+=lcdBytes.length; byte[] rcdBytes=response.getRemoteConnectionDescriptor().toString().getBytes(); System.arraycopy(rcdBytes, 0, array,totalLength, rcdBytes.length); totalLength+=rcdBytes.length;
/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { response.setLocalConnectionDescriptor(new ConnectionDescriptor(sd)); } }
@Override public synchronized void dial() throws CallException { assertState(QUEUED); // Try to negotiate media with a packet relay end point. try { relayEndpoint = session.getPacketRelayEndpoint(); userAgentConnection = session.createConnection(relayEndpoint); userAgentConnection.addObserver(this); userAgentConnection.connect(ConnectionMode.SendRecv); block(1); if(!MgcpConnection.HALF_OPEN.equals(userAgentConnection.getState())) { throw new Exception(mmsTimedOutException()); } final byte[] offer = patchMedia(server.getExternalAddress(), userAgentConnection.getLocalDescriptor().toString().getBytes()); initialInvite.setContent(offer, "application/sdp"); initialInvite.send(); } catch(final Exception exception) { cleanup(); setState(FAILED); fireStatusChanged(); final StringBuilder buffer = new StringBuilder(); buffer.append("There was an error while dialing out from "); buffer.append(initialInvite.getFrom().toString()).append(" to "); buffer.append(initialInvite.getTo().toString()); throw new CallException(exception); } }
/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { command.setRemoteConnectionDescriptor(new ConnectionDescriptor(sd)); } }
byte[] rcdBytes=response.getLocalConnectionDescriptor().toString().getBytes(); System.arraycopy(rcdBytes, 0, array,totalLength, rcdBytes.length); totalLength+=rcdBytes.length;
/** * Receive notification of the session description. Parser will call * this method to report about session descriptor reading. * * @param sd * the session description from message. */ public void sessionDescription(String sd) throws ParseException { response.setLocalConnectionDescriptor(new ConnectionDescriptor(sd)); } }