public String encode(JainMgcpResponseEvent event) { EndpointConfigurationResponse response = (EndpointConfigurationResponse) 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); return s.toString(); }
protected void onJainMgcpResponseEvent(JainMgcpResponseEvent message, ActorRef self, ActorRef sender) { if (this.destroying.get()) { ReturnCode returnCode = message.getReturnCode(); if (ReturnCode.TRANSACTION_EXECUTED_NORMALLY == returnCode.getValue()) { broadcast(new EndpointStateChanged(EndpointState.DESTROYED)); } else { logger.error("Could not destroy endpoint " + this.id.toString() + ". Return Code: " + returnCode.toString()); broadcast(new EndpointStateChanged(EndpointState.FAILED)); } } }
/** * Check whether the given return code is a provisional response. * * @param rc * the return code * @return true when the code is provisional */ private boolean isProvisional(ReturnCode rc) { final int rval = rc.getValue(); return ((99 < rval) && (rval < 200)); }
public int encode(JainMgcpResponseEvent event,byte[] array) { EndpointConfigurationResponse response = (EndpointConfigurationResponse) 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; return totalLength; }
/** * Check whether the given return code is a provisional response. * * @param rc * the return code * @return true when the code is provisional */ private boolean isProvisional(ReturnCode rc) { final int rval = rc.getValue(); return ((99 < rval) && (rval < 200)); }
public int encode(JainMgcpResponseEvent event,byte[] array) { EndpointConfigurationResponse response = (EndpointConfigurationResponse) 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; return totalLength; }
@Override public String encode(JainMgcpResponseEvent event) { NotificationRequestResponse response = (NotificationRequestResponse) event; ReturnCode returnCode = response.getReturnCode(); String encodedEvent = (new StringBuffer().append(returnCode.getValue()).append(SINGLE_CHAR_SPACE).append( response.getTransactionHandle()).append(SINGLE_CHAR_SPACE).append(returnCode.getComment()) .append(NEW_LINE)).toString(); return encodedEvent; }
/** * Check whether the given return code is a provisional response. * * @param rc * the return code * @return true when the code is provisional */ private boolean isProvisional(ReturnCode rc) { final int rval = rc.getValue(); return ((99 < rval) && (rval < 200)); }
@Override public int encode(JainMgcpResponseEvent event,byte[] array) { NotifyResponse response = (NotifyResponse) 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; return totalLength; }
@Override public String encode(JainMgcpResponseEvent event) { StringBuffer s = new StringBuffer(); s.append(event.getReturnCode().getValue()).append(SINGLE_CHAR_SPACE).append(event.getTransactionHandle()) .append(SINGLE_CHAR_SPACE).append(event.getReturnCode().getComment()).append(NEW_LINE); return s.toString(); // return event.getReturnCode().getValue() + " " + // event.getTransactionHandle() + " " // + event.getReturnCode().getComment() + "\n"; }
public static int encode(byte[] destination,int offset,ReturnCode returnCode) { return StringFunctions.encodeInt(destination,offset,returnCode.getValue()); } }
@Override public int encode(JainMgcpResponseEvent event,byte[] array) { NotificationRequestResponse response = (NotificationRequestResponse) 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; return totalLength; }
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 event) { //NotifucationRequest response expected only NotificationRequestResponse evt = (NotificationRequestResponse) event; switch (event.getReturnCode().getValue()) { case ReturnCode.TRANSACTION_EXECUTED_NORMALLY : break; } }
@Override public int encode(JainMgcpResponseEvent event,byte[] array) { NotifyResponse response = (NotifyResponse) 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; return totalLength; }
public String encode(JainMgcpResponseEvent event) { DeleteConnectionResponse response = (DeleteConnectionResponse) 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.getConnectionParms() != null) { s.append(response.getConnectionParms()).append(NEW_LINE); } return s.toString(); }
public static int encode(byte[] destination,int offset,ReturnCode returnCode) { return StringFunctions.encodeInt(destination,offset,returnCode.getValue()); } }
@Override public int encode(JainMgcpResponseEvent event,byte[] array) { NotificationRequestResponse response = (NotificationRequestResponse) 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; return totalLength; }
public void onNotificationRequestResponse(NotificationRequestResponse event, ActivityContextInterface aci) { logger.info("onNotificationRequestResponse"); ReturnCode status = event.getReturnCode(); switch (status.getValue()) { case ReturnCode.TRANSACTION_EXECUTED_NORMALLY: logger.info("The Announcement should have been started"); break; default: ReturnCode rc = event.getReturnCode(); logger.severe("RQNT failed. Value = " + rc.getValue() + " Comment = " + rc.getComment()); // TODO : Send DLCX to MMS. Send BYE to UA break; } }
public void processMgcpResponseEvent(JainMgcpResponseEvent event) { //NotifucationRequest response expected only NotificationRequestResponse evt = (NotificationRequestResponse) event; switch (event.getReturnCode().getValue()) { case ReturnCode.TRANSACTION_EXECUTED_NORMALLY : break; } }