public void addForwardShortMessageResponse(long invokeId) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.shortMsgMORelayContext && this.appCntx .getApplicationContextName() != MAPApplicationContextName.shortMsgMTRelayContext) || (this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version1 && this.appCntx .getApplicationContextVersion() != MAPApplicationContextVersion.version2)) throw new MAPException( "Bad application context name for addForwardShortMessageResponse: must be shortMsgMORelayContext_V1 or V2 or shortMsgMTRelayContext_V1 or V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory() .createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // we need not Operation Code because no answer this.sendReturnResultLastComponent(resultLast); }
public void addAlertServiceCentreResponse(long invokeId) throws MAPException { if (this.appCntx.getApplicationContextName() != MAPApplicationContextName.shortMsgAlertContext || (this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2)) throw new MAPException( "Bad application context name for addAlertServiceCentreResponse: must be shortMsgAlertContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory() .createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // we need not Operation Code because no answer // OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); // oc.setLocalOperationCode((long) MAPOperationCode.alertServiceCentre); // resultLast.setOperationCode(oc); this.sendReturnResultLastComponent(resultLast); }
@Override public void onDialogRequestEricsson(MAPDialog mapDialog, AddressString destReference, AddressString origReference, AddressString eriImsi, AddressString eriVlrNo) { DialogImplWrapper di = (DialogImplWrapper) ((MAPDialogImpl) mapDialog).getTcapDialog(); if (mapDialog.getApplicationContext() != null) { di.setAcnValue(mapDialog.getApplicationContext().getApplicationContextName().getApplicationContextCode()); di.setAcnVersion(mapDialog.getApplicationContext().getApplicationContextVersion().getVersion()); } }
public ServingCheckData isServingService(MAPApplicationContext dialogApplicationContext) { MAPApplicationContextName ctx = dialogApplicationContext.getApplicationContextName(); int vers = dialogApplicationContext.getApplicationContextVersion().getVersion(); switch (ctx) { case gprsLocationInfoRetrievalContext: if (vers >= 3 && vers <= 4) { return new ServingCheckDataImpl(ServingCheckResult.AC_Serving); } else if (vers > 4) { long[] altOid = dialogApplicationContext.getOID(); altOid[7] = 2; ApplicationContextName alt = TcapFactory.createApplicationContextName(altOid); return new ServingCheckDataImpl(ServingCheckResult.AC_VersionIncorrect, alt); } else { return new ServingCheckDataImpl(ServingCheckResult.AC_VersionIncorrect); } } return new ServingCheckDataImpl(ServingCheckResult.AC_NotServing); }
public ServingCheckData isServingService(MAPApplicationContext dialogApplicationContext) { int vers = dialogApplicationContext.getApplicationContextVersion().getVersion(); switch (dialogApplicationContext.getApplicationContextName()) { case locationSvcEnquiryContext: case locationSvcGatewayContext: if (vers == 3) { return new ServingCheckDataImpl(ServingCheckResult.AC_Serving); } else if (vers > 3) { long[] altOid = dialogApplicationContext.getOID(); altOid[7] = 3; ApplicationContextName alt = TcapFactory.createApplicationContextName(altOid); return new ServingCheckDataImpl(ServingCheckResult.AC_VersionIncorrect, alt); } else { return new ServingCheckDataImpl(ServingCheckResult.AC_VersionIncorrect); } } return new ServingCheckDataImpl(ServingCheckResult.AC_NotServing); }
@Override public void onDialogRequest(MAPDialog mapDialog, AddressString destReference, AddressString origReference, MAPExtensionContainer extensionContainer) { if (((MAPDialogImpl) mapDialog).getTcapDialog() instanceof DialogImplWrapper) { DialogImplWrapper di = (DialogImplWrapper) ((MAPDialogImpl) mapDialog).getTcapDialog(); if (mapDialog.getApplicationContext() != null) { di.setAcnValue(mapDialog.getApplicationContext().getApplicationContextName().getApplicationContextCode()); di.setAcnVersion(mapDialog.getApplicationContext().getApplicationContextVersion().getVersion()); } } }
@Override public void onAlertServiceCentreRequest(AlertServiceCentreRequest ind) { if (!isStarted) return; this.countAscReq++; MAPProvider mapProvider = this.mapMan.getMAPStack().getMAPProvider(); MAPDialogSms curDialog = ind.getMAPDialog(); long invokeId = ind.getInvokeId(); this.testerHost.sendNotif(SOURCE_NAME, "Rcvd: ascReq", ind.toString(), Level.DEBUG); try { if (curDialog.getApplicationContext().getApplicationContextVersion() == MAPApplicationContextVersion.version1) { curDialog.release(); } else { curDialog.addAlertServiceCentreResponse(invokeId); this.countAscResp++; this.testerHost.sendNotif(SOURCE_NAME, "Sent: ascResp", "", Level.DEBUG); this.needSendClose = true; } } catch (MAPException e) { this.testerHost.sendNotif(SOURCE_NAME, "Exception when invoking addAlertServiceCentreResponse() : " + e.getMessage(), e, Level.ERROR); } }
private void resetRequest(Parameter parameter, MAPDialogMobilityImpl mapDialogImpl, Long invokeId) throws MAPParsingComponentException { if (parameter == null) throw new MAPParsingComponentException("Error while decoding resetRequest: Parameter is mandatory but not found", MAPParsingComponentExceptionReason.MistypedParameter); if (parameter.getTag() != Tag.SEQUENCE || parameter.getTagClass() != Tag.CLASS_UNIVERSAL || parameter.isPrimitive()) throw new MAPParsingComponentException("Error while decoding resetRequest: Bad tag or tagClass or parameter is primitive, received tag=" + parameter.getTag(), MAPParsingComponentExceptionReason.MistypedParameter); long version = mapDialogImpl.getApplicationContext().getApplicationContextVersion().getVersion(); ResetRequestImpl ind = new ResetRequestImpl(version); byte[] buf = parameter.getData(); AsnInputStream ais = new AsnInputStream(buf); ind.decodeData(ais, buf.length); ind.setInvokeId(invokeId); ind.setMAPDialog(mapDialogImpl); for (MAPServiceListener serLis : this.serviceListeners) { try { serLis.onMAPMessage(ind); ((MAPServiceMobilityListener) serLis).onResetRequest(ind); } catch (Exception e) { loger.error("Error processing resetRequest: " + e.getMessage(), e); } } }
/** * Received response for SRI sent earlier * * @param evt * @param aci */ public void onSendRoutingInfoForSMResponse(SendRoutingInfoForSMResponse evt, ActivityContextInterface aci) { if (this.logger.isFineEnabled()) { this.logger.fine("\nHome routing: HrSriClientSbb: Received SEND_ROUTING_INFO_FOR_SM_RESPONSE = " + evt + " Dialog=" + evt.getMAPDialog()); } if (evt.getMAPDialog().getApplicationContext().getApplicationContextVersion() == MAPApplicationContextVersion.version1 && evt.getMwdSet() != null && evt.getMwdSet()) { MWStatus mwStatus = evt.getMAPDialog().getService().getMAPProvider().getMAPParameterFactory() .createMWStatus(false, true, false, false); CorrelationIdValue correlationIdValue = this.getCorrelationIdValue(); if (correlationIdValue != null) { correlationIdValue.setMwStatus(mwStatus); correlationIdValue.setSriMapVersion(evt.getMAPDialog().getApplicationContext().getApplicationContextVersion().getVersion()); this.setCorrelationIdValue(correlationIdValue); } } this.setSendRoutingInfoForSMResponse(evt); }
private void doSendResponse(CorrelationIdValue correlationIdValue, MAPDialogSms dlg, String imsiValue, LocationInfoWithLMSI li) throws MAPException { long invokeId = this.getInvokeId(); IMSI imsi = this.mapParameterFactory.createIMSI(imsiValue); MWStatus mwStatus = correlationIdValue.getMwStatus(); Boolean mwdSet = null; if (dlg.getApplicationContext().getApplicationContextVersion() == MAPApplicationContextVersion.version1) { if (mwStatus != null) { if (mwStatus.getMnrfSet()) mwdSet = true; mwStatus = null; } } dlg.addSendRoutingInfoForSMResponse(invokeId, imsi, li, null, mwdSet); InformServiceCentreRequest isc = correlationIdValue.getInformServiceCentreRequest(); if (mwStatus != null && isc != null) { dlg.addInformServiceCentreRequest(isc.getStoredMSISDN(), isc.getMwStatus(), null, isc.getAbsentSubscriberDiagnosticSM(), isc.getAdditionalAbsentSubscriberDiagnosticSM()); } dlg.close(false); }
@Override public void addRestoreDataResponse(long invokeId, ISDNAddressString hlrNumber, boolean msNotReachable, MAPExtensionContainer extensionContainer) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.networkLocUpContext) || ((this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version3) && (this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2))) throw new MAPException("Bad application context name for RestoreDataResponse: must be networkLocUpContext_V2 or networkLocUpContext_V3"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory() .createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.restoreData); resultLast.setOperationCode(oc); RestoreDataResponseImpl resp = new RestoreDataResponseImpl(hlrNumber, msNotReachable, extensionContainer); AsnOutputStream aos = new AsnOutputStream(); resp.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(resp.getTagClass()); p.setPrimitive(resp.getIsPrimitive()); p.setTag(resp.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); this.sendReturnResultLastComponent(resultLast); }
public void onAlertServiceCentreRequest(AlertServiceCentreRequest evt, ActivityContextInterface aci) { if (this.logger.isFineEnabled()) { this.logger.fine("\nReceived onAlertServiceCentreRequest= " + evt); } try { MAPDialogSms mapDialogSms = evt.getMAPDialog(); MAPApplicationContext mapApplicationContext = mapDialogSms.getApplicationContext(); if (mapApplicationContext.getApplicationContextVersion() == MAPApplicationContextVersion.version2) { // Send back response only for V2 mapDialogSms.addAlertServiceCentreResponse(evt.getInvokeId()); if (this.logger.isFineEnabled()) { this.logger.fine("\nSending AlertServiceCentreResponse"); } mapDialogSms.close(false); } else { mapDialogSms.release(); } this.setupAlert(evt.getMsisdn(), evt.getServiceCentreAddress(), mapDialogSms.getNetworkId()); } catch (MAPException e) { logger.severe("Exception while trying to send back AlertServiceCentreResponse", e); } }
@Override public void addSendImsiResponse(long invokeId, IMSI imsi) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.imsiRetrievalContext) || (this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2)) throw new MAPException("Bad application context name for addSendImsiResponse: must be imsiRetrievalContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.sendIMSI); resultLast.setOperationCode(oc); SendImsiResponseImpl req = new SendImsiResponseImpl(imsi); AsnOutputStream aos = new AsnOutputStream(); req.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(req.getTagClass()); p.setPrimitive(req.getIsPrimitive()); p.setTag(req.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); this.sendReturnResultLastComponent(resultLast); }
@Override public void addInterrogateSSResponse_BasicServiceGroupList(long invokeId, ArrayList<BasicServiceCode> basicServiceGroupList) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.networkFunctionalSsContext) || this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2) throw new MAPException("Bad application context name for addInterrogateSSResponse: must be networkFunctionalSsContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.interrogateSS); resultLast.setOperationCode(oc); InterrogateSSResponseImpl req = new InterrogateSSResponseImpl(basicServiceGroupList, false); AsnOutputStream aos = new AsnOutputStream(); req.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(req.getTagClass()); p.setPrimitive(req.getIsPrimitive()); p.setTag(req.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); this.sendReturnResultLastComponent(resultLast); }
@Override public void addRegisterPasswordResponse(long invokeId, Password password) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.networkFunctionalSsContext) || this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2) throw new MAPException("Bad application context name for addRegisterPasswordResponse: must be networkFunctionalSsContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.registerPassword); resultLast.setOperationCode(oc); RegisterPasswordResponseImpl req = new RegisterPasswordResponseImpl(password); AsnOutputStream aos = new AsnOutputStream(); req.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(req.getTagClass()); p.setPrimitive(req.getIsPrimitive()); p.setTag(req.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); this.sendReturnResultLastComponent(resultLast); }
@Override public void addInterrogateSSResponse_SSStatus(long invokeId, SSStatus ssStatus) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.networkFunctionalSsContext) || this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2) throw new MAPException("Bad application context name for addInterrogateSSResponse: must be networkFunctionalSsContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.interrogateSS); resultLast.setOperationCode(oc); InterrogateSSResponseImpl req = new InterrogateSSResponseImpl(ssStatus); AsnOutputStream aos = new AsnOutputStream(); req.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(req.getTagClass()); p.setPrimitive(req.getIsPrimitive()); p.setTag(req.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); this.sendReturnResultLastComponent(resultLast); }
@Override public void addInterrogateSSResponse_ForwardingFeatureList(long invokeId, ArrayList<ForwardingFeature> forwardingFeatureList) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.networkFunctionalSsContext) || this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2) throw new MAPException("Bad application context name for addInterrogateSSResponse: must be networkFunctionalSsContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.interrogateSS); resultLast.setOperationCode(oc); InterrogateSSResponseImpl req = new InterrogateSSResponseImpl(forwardingFeatureList); AsnOutputStream aos = new AsnOutputStream(); req.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(req.getTagClass()); p.setPrimitive(req.getIsPrimitive()); p.setTag(req.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); this.sendReturnResultLastComponent(resultLast); }
@Override public void addInterrogateSSResponse_GenericServiceInfo(long invokeId, GenericServiceInfo genericServiceInfo) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.networkFunctionalSsContext) || this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2) throw new MAPException("Bad application context name for addInterrogateSSResponse: must be networkFunctionalSsContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.interrogateSS); resultLast.setOperationCode(oc); InterrogateSSResponseImpl req = new InterrogateSSResponseImpl(genericServiceInfo); AsnOutputStream aos = new AsnOutputStream(); req.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(req.getTagClass()); p.setPrimitive(req.getIsPrimitive()); p.setTag(req.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); this.sendReturnResultLastComponent(resultLast); }
@Override public void addGetPasswordResponse(long invokeId, Password password) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.networkFunctionalSsContext) || this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2) throw new MAPException("Bad application context name for addGetPasswordResponse: must be networkFunctionalSsContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.getPassword); resultLast.setOperationCode(oc); GetPasswordResponseImpl req = new GetPasswordResponseImpl(password); AsnOutputStream aos = new AsnOutputStream(); req.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(req.getTagClass()); p.setPrimitive(req.getIsPrimitive()); p.setTag(req.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); this.sendReturnResultLastComponent(resultLast); }
@Override public void addActivateSSResponse(long invokeId, SSInfo ssInfo) throws MAPException { if ((this.appCntx.getApplicationContextName() != MAPApplicationContextName.networkFunctionalSsContext) || this.appCntx.getApplicationContextVersion() != MAPApplicationContextVersion.version2) throw new MAPException("Bad application context name for addActivateSSResponse: must be networkFunctionalSsContext_V2"); ReturnResultLast resultLast = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createTCResultLastRequest(); resultLast.setInvokeId(invokeId); // Operation Code OperationCode oc = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createOperationCode(); oc.setLocalOperationCode((long) MAPOperationCode.activateSS); resultLast.setOperationCode(oc); if (ssInfo != null) { ActivateSSResponseImpl req = new ActivateSSResponseImpl(ssInfo); AsnOutputStream aos = new AsnOutputStream(); req.encodeData(aos); Parameter p = this.mapProviderImpl.getTCAPProvider().getComponentPrimitiveFactory().createParameter(); p.setTagClass(req.getTagClass()); p.setPrimitive(req.getIsPrimitive()); p.setTag(req.getTag()); p.setData(aos.toByteArray()); resultLast.setParameter(p); } this.sendReturnResultLastComponent(resultLast); }