public String encode(JainMgcpResponseEvent event) { ModifyConnectionResponse response = (ModifyConnectionResponse) 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.getLocalConnectionDescriptor() != null) { s.append(NEW_LINE).append(response.getLocalConnectionDescriptor()); } return s.toString(); }
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 { signal("success"); } catch (UnknownTransitionException e) { } break; default: try { signal("failure"); } catch (UnknownTransitionException e) { } break; } } }
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; }
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 { signal("success"); } catch (UnknownTransitionException e) { } break; default: try { signal("failure"); } catch (UnknownTransitionException e) { } break; } } }
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; }
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; } } }
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; } } }
int responseCode = mcResponse.getReturnCode().getValue(); MgcpResponseType type = MgcpResponseType.getResponseTypeFromCode(responseCode);