use of org.mobicents.smsc.mproc.impl.PostImsiProcessorImpl in project smscgateway by RestComm.
the class MProcManagement method applyMProcImsiRequest.
public MProcResult applyMProcImsiRequest(final MProcRuleRaProvider anMProcRuleRa, Sms sms, String imsi, String nnnDigits, int nnnNumberingPlan, int nnnAddressNature) {
if (this.mprocs.size() == 0)
return new MProcResult();
FastList<MProcRule> cur = this.mprocs;
PostImsiProcessorImpl pap = new PostImsiProcessorImpl(logger);
MProcMessage message = new MProcMessageImpl(sms, ProcessingType.SS7_SRI, null);
try {
for (FastList.Node<MProcRule> n = cur.head(), end = cur.tail(); (n = n.getNext()) != end; ) {
MProcRule rule = n.getValue();
if (rule.isForPostImsiRequestState() && rule.matchesPostImsiRequest(message)) {
if (logger.isDebugEnabled()) {
logger.debug("MRule matches at ImsiRequest phase to a message:\nrule: " + rule + "\nmessage: " + sms);
}
rule.onPostImsiRequest(anMProcRuleRa, pap, message);
}
}
} catch (Throwable e) {
logger.error("Exception when invoking rule.matches(message) or applyMProcImsiRequest(): " + e.getMessage(), e);
return new MProcResult();
}
if (pap.isNeedDropMessages()) {
MProcResult res = new MProcResult();
res.setMessageDropped(true);
return res;
}
if (pap.isNeedRerouteMessages()) {
MProcResult res = new MProcResult();
res.setMessageIsRerouted(true);
res.setNewNetworkId(pap.getNewNetworkId());
return res;
}
return new MProcResult();
}
Aggregations