public String encode(JainMgcpResponseEvent event) { CreateConnectionResponse response = (CreateConnectionResponse) event; ReturnCode returnCode = response.getReturnCode(); StringBuffer s = new StringBuffer(); s.append(returnCode.getValue()).append(SINGLE_CHAR_SPACE).append(response.getTransactionHandle()).append( SINGLE_CHAR_SPACE).append(returnCode.getComment()).append(NEW_LINE); if (response.getConnectionIdentifier() != null) { s.append("I: ").append(response.getConnectionIdentifier()).append(NEW_LINE); } if (response.getSpecificEndpointIdentifier() != null) { s.append("Z: ").append(response.getSpecificEndpointIdentifier()).append(NEW_LINE); } if (response.getSecondConnectionIdentifier() != null) { s.append("I2: ").append(response.getSecondConnectionIdentifier()).append(NEW_LINE); } if (response.getSecondEndpointIdentifier() != null) { s.append("Z2: ").append(response.getSecondEndpointIdentifier()).append(NEW_LINE); } if (response.getLocalConnectionDescriptor() != null) { s.append(NEW_LINE).append(response.getLocalConnectionDescriptor()); } return s.toString(); }
@Override public void execute(final Object message) throws Exception { final CreateConnectionResponse response = (CreateConnectionResponse) message; if (connId == null) { connId = response.getConnectionIdentifier(); } localDesc = response.getLocalConnectionDescriptor(); // If the end point ends with a wild card we should update it. if (endpointId.getLocalEndpointName().endsWith("$")) { endpointId = response.getSpecificEndpointIdentifier(); endpoint.tell(new UpdateEndpointId(endpointId), source); } } }
@Override public void execute(final Object message) throws Exception { final CreateConnectionResponse response = (CreateConnectionResponse) message; if (connId == null) { connId = response.getConnectionIdentifier(); } localDesc = response.getLocalConnectionDescriptor(); // If the end point ends with a wild card we should update it. if (endpointId.getLocalEndpointName().endsWith("$")) { endpointId = response.getSpecificEndpointIdentifier(); endpoint.tell(new UpdateEndpointId(endpointId), source); } } }
@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); } }
array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getConnectionIdentifier() != null) byte[] connectionIdentifierBytes=response.getConnectionIdentifier().toString().getBytes(); System.arraycopy(connectionIdentifierBytes, 0, array,totalLength, connectionIdentifierBytes.length); totalLength+=connectionIdentifierBytes.length;
private void created(final CreateConnectionResponse response) { connectionId = response.getConnectionIdentifier(); localDescriptor = response.getLocalConnectionDescriptor(); endpoint.updateId(response.getSpecificEndpointIdentifier()); if(remoteDescriptor != null) { setState(OPEN); fireOpen(); } else { setState(HALF_OPEN); fireHalfOpen(); } }
array[totalLength++]=StringFunctions.NEWLINE_BYTE; if (response.getConnectionIdentifier() != null) byte[] connectionIdentifierBytes=response.getConnectionIdentifier().toString().getBytes(); System.arraycopy(connectionIdentifierBytes, 0, array,totalLength, connectionIdentifierBytes.length); totalLength+=connectionIdentifierBytes.length;
final CreateConnectionResponse response = (CreateConnectionResponse) message; if (primaryConnId == null) { primaryConnId = response.getConnectionIdentifier();
public void processMgcpResponseEvent(JainMgcpResponseEvent evt) { CreateConnectionResponse resp = (CreateConnectionResponse) evt; switch (resp.getReturnCode().getValue()) { case ReturnCode.TRANSACTION_BEING_EXECUTED: return; case ReturnCode.TRANSACTION_EXECUTED_NORMALLY: containers[0].setConcreteName(resp.getSpecificEndpointIdentifier()); containers[1].setConcreteName(resp.getSecondEndpointIdentifier()); connections[0] = resp.getConnectionIdentifier(); connections[1] = resp.getSecondConnectionIdentifier(); try { signal("success"); } catch (Exception e) { } break; default: try { signal("failure"); } catch (Exception e) { } } }
public void processMgcpResponseEvent(JainMgcpResponseEvent evt) { CreateConnectionResponse resp = (CreateConnectionResponse) evt; switch (resp.getReturnCode().getValue()) { case ReturnCode.TRANSACTION_BEING_EXECUTED: return; case ReturnCode.TRANSACTION_EXECUTED_NORMALLY: containers[0].setConcreteName(resp.getSpecificEndpointIdentifier()); containers[1].setConcreteName(resp.getSecondEndpointIdentifier()); connections[0] = resp.getConnectionIdentifier(); connections[1] = resp.getSecondConnectionIdentifier(); try { signal("success"); } catch (Exception e) { } break; default: try { signal("failure"); } catch (Exception e) { } } }
this.connectionIds.add(ccResponse.getConnectionIdentifier());
return; case ReturnCode.TRANSACTION_EXECUTED_NORMALLY : connection.connectionID = resp.getConnectionIdentifier(); connection.setConcreteName(resp.getSpecificEndpointIdentifier());
return; case ReturnCode.TRANSACTION_EXECUTED_NORMALLY : connection.connectionID = resp.getConnectionIdentifier(); connection.setConcreteName(resp.getSpecificEndpointIdentifier());
this.setConnectionIdentifier(event.getConnectionIdentifier().toString()); String sdp = event.getLocalConnectionDescriptor().toString();
logger.info("***&& " + this.getEndpointName()); ConnectionIdentifier connectionIdentifier = event.getConnectionIdentifier();