@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; }
public void header(String header) throws ParseException { String[] tokens = utils.splitStringBySpace(header); int tid = Integer.parseInt(tokens[1]); response = new NotificationRequestResponse(source != null ? source : stack, utils.decodeReturnCode(Integer .parseInt(tokens[0]))); response.setTransactionHandle(tid); }
@Override public JainMgcpResponseEvent getProvisionalResponse() { NotificationRequestResponse provisionalresponse = null; if (!sent) provisionalresponse = new NotificationRequestResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); return provisionalresponse; } }
private void response(final Object message) { final NotificationRequestResponse response = (NotificationRequestResponse) message; final ReturnCode code = response.getReturnCode(); if (!Transaction_Executed_Normally.equals(code)) { final int value = code.getValue(); fail(value); } }
@Override public JainMgcpResponseEvent getProvisionalResponse() { NotificationRequestResponse provisionalresponse = null; if (!sent) provisionalresponse = new NotificationRequestResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); return provisionalresponse; } }
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 onNotificationRequestResponse(NotificationRequestResponse event, ActivityContextInterface aci) { ReturnCode status = event.getReturnCode(); switch (status.getValue()) { case ReturnCode.TRANSACTION_EXECUTED_NORMALLY: log.info("########## VOICE MAIL SBB: RQNT executed properly. TXID: "+event.getTransactionHandle()+" ##########"); break; default: ReturnCode rc = event.getReturnCode(); log.info("########## VOICE MAIL SBB: RQNT failed, terminating call. TXID: "+event.getTransactionHandle()+" ##########"); sendByeRequest(); break; } }
@Override public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new NotificationRequestResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (IOException e) { logger.error("Decode RQNT Response failed", e); } return response; }
@Override public JainMgcpResponseEvent getProvisionalResponse() { NotificationRequestResponse provisionalresponse = null; if (!sent) { provisionalresponse = new NotificationRequestResponse(source != null ? source : stack, ReturnCode.Transaction_Being_Executed); } return provisionalresponse; }
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; } }
@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; }
@Override public JainMgcpResponseEvent decodeResponse(byte[] data,SplitDetails[] msg,Integer txID,ReturnCode returnCode) throws ParseException { response = new NotificationRequestResponse(source != null ? source : stack, returnCode); response.setTransactionHandle(txID); try { (new ResponseContentHandle()).parse(data,msg); } catch (IOException e) { logger.error("Decode RQNT Response failed", e); } return response; }
code = ReturnCode.Transaction_Executed_Normally; final JainMgcpResponseEvent response = new NotificationRequestResponse(self, code); final int transaction = rqnt.getTransactionHandle(); response.setTransactionHandle(transaction);
int responseCode = nrResponse.getReturnCode().getValue(); MgcpResponseType type = MgcpResponseType.getResponseTypeFromCode(responseCode);
@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 onNotifyRequest(Notify event, ActivityContextInterface aci) { logger.info("onNotifyRequest"); NotificationRequestResponse response = new NotificationRequestResponse(event.getSource(), ReturnCode.Transaction_Executed_Normally); response.setTransactionHandle(event.getTransactionHandle()); mgcpProvider.sendMgcpEvents(new JainMgcpEvent[] { response }); EventName[] observedEvents = event.getObservedEvents(); for (EventName observedEvent : observedEvents) { switch (observedEvent.getEventIdentifier().intValue()) { case MgcpEvent.REPORT_ON_COMPLETION: logger.info("Announcemnet Completed NTFY received"); break; case MgcpEvent.REPORT_FAILURE: logger.info("Announcemnet Failed received"); // TODO : Send DLCX and Send BYE to UA break; default: //MGCP RI expects D/dtmfX, but correct is D/X ... hence it fails to match on //MgcpEvent.DTMF_X .... Thus event ID is wrong.... if(observedEvent.getPackageName().toString().equals("D")) { int decodedId = decodeDTMF(observedEvent); processDTMF(decodedId); } } } }
code = ReturnCode.Transaction_Executed_Normally; final JainMgcpResponseEvent response = new NotificationRequestResponse(self, code); final int transaction = rqnt.getTransactionHandle(); response.setTransactionHandle(transaction);
code = ReturnCode.Transaction_Executed_Normally; final JainMgcpResponseEvent response = new NotificationRequestResponse(self, code); final int transaction = rqnt.getTransactionHandle(); response.setTransactionHandle(transaction);
break; case Constants.CMD_NOTIFICATION_REQUEST: response = new NotificationRequestResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_NOTIFY:
break; case Constants.CMD_NOTIFICATION_REQUEST: response = new NotificationRequestResponse(this, ReturnCode.Transient_Error); break; case Constants.CMD_NOTIFY: