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(); }
if (response.getSecondConnectionIdentifier() != null) byte[] connectionIdentifierBytes=response.getSecondConnectionIdentifier().toString().getBytes(); System.arraycopy(connectionIdentifierBytes, 0, array,totalLength, connectionIdentifierBytes.length); totalLength+=connectionIdentifierBytes.length;
if (response.getSecondConnectionIdentifier() != null) byte[] connectionIdentifierBytes=response.getSecondConnectionIdentifier().toString().getBytes(); System.arraycopy(connectionIdentifierBytes, 0, array,totalLength, connectionIdentifierBytes.length); totalLength+=connectionIdentifierBytes.length;
secondaryConnId = response.getSecondConnectionIdentifier();
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) { } } }