public void header(String header) throws ParseException { String[] tokens = utils.splitStringBySpace(header); int tid = Integer.parseInt(tokens[1]); response = new NotifyResponse(source != null ? source : stack, utils.decodeReturnCode(Integer .parseInt(tokens[0]))); response.setTransactionHandle(tid); }
@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 void onNotifyRequest(Notify event, ActivityContextInterface aci) { NotifyResponse response = new NotifyResponse(event.getSource(), ReturnCode.Transaction_Executed_Normally); response.setTransactionHandle(event.getTransactionHandle()); log.info("########## VOICE MAIL SBB: Sending Notify response["+response+"] to ["+event+"]["+event.getTransactionHandle()+"] ["+response.getTransactionHandle()+"]##########");
@Override public JainMgcpResponseEvent getProvisionalResponse() { NotifyResponse provisionalresponse = null; if (!sent) provisionalresponse = new NotifyResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); return provisionalresponse; } }
@Override public JainMgcpResponseEvent getProvisionalResponse() { NotifyResponse provisionalresponse = null; if (!sent) { provisionalresponse = new NotifyResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); } return provisionalresponse; } }
@Override public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new NotifyResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (IOException e) { logger.error("Something wrong while parsing the NOTIFY Response received", e); } return response; }
@Override public JainMgcpResponseEvent getProvisionalResponse() { NotifyResponse provisionalresponse = null; if (!sent) provisionalresponse = new NotifyResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); return provisionalresponse; } }
@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 JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new NotifyResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (IOException e) { logger.error("Something wrong while parsing the NOTIFY Response received", e); } return response; }
break; case Constants.CMD_NOTIFY: response = new NotifyResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_RESP_UNKNOWN: response = new NotifyResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_RESTART_IN_PROGRESS:
public void processMgcpCommandEvent(JainMgcpCommandEvent evt) { //we are expecting two types of commands: //-delete connection notification (in case of failure connection on server side) //-notify switch (evt.getObjectIdentifier()) { case Constants.CMD_DELETE_CONNECTION : //TODO: handle delete connection request from server; break; case Constants.CMD_NOTIFY : Notify event = (Notify) evt; //if there is attached handler deligate call to it if (this.requestListeners.containsKey(event.getRequestIdentifier().toString().trim())) { requestListeners.get(event.getRequestIdentifier().toString().trim()).processMgcpCommandEvent(evt); } //send response to this transaction; NotifyResponse response = new NotifyResponse(this, ReturnCode.Transaction_Executed_Normally); response.setTransactionHandle(evt.getTransactionHandle()); this.send(response); break; default : } }
break; case Constants.CMD_NOTIFY: response = new NotifyResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_RESP_UNKNOWN: response = new NotifyResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_RESTART_IN_PROGRESS:
public void processMgcpCommandEvent(JainMgcpCommandEvent evt) { //we are expecting two types of commands: //-delete connection notification (in case of failure connection on server side) //-notify switch (evt.getObjectIdentifier()) { case Constants.CMD_DELETE_CONNECTION : //TODO: handle delete connection request from server; break; case Constants.CMD_NOTIFY : Notify event = (Notify) evt; //if there is attached handler deligate call to it if (this.requestListeners.containsKey(event.getRequestIdentifier().toString().trim())) { requestListeners.get(event.getRequestIdentifier().toString().trim()).processMgcpCommandEvent(evt); } //send response to this transaction; NotifyResponse response = new NotifyResponse(this, ReturnCode.Transaction_Executed_Normally); response.setTransactionHandle(evt.getTransactionHandle()); this.send(response); break; default : } }
break; case Constants.CMD_NOTIFY: response = new NotifyResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_RESP_UNKNOWN: response = new NotifyResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_RESTART_IN_PROGRESS:
final NotifyResponse response = new NotifyResponse(this, ReturnCode.Transaction_Executed_Normally); response.setTransactionHandle(command.getTransactionHandle()); server.sendResponse(response);
final ActorRef self = self(); final NotifyResponse response = new NotifyResponse(this, Transaction_Executed_Normally); final int transaction = notification.getTransactionHandle(); response.setTransactionHandle(transaction); gateway.tell(response, self);
public void onNotifyRequest(Notify event, ActivityContextInterface aci) { logger.info("onNotifyRequest:\n"+event); NotifyResponse response = new NotifyResponse(event.getSource(), ReturnCode.Transaction_Executed_Normally); response.setTransactionHandle(event.getTransactionHandle());