use of org.mobicents.ha.javax.sip.cache.MobicentsSipCache in project jain-sip.ha by RestComm.
the class SimpleB2BUA method stop.
public void stop(boolean stopSipStack) {
Iterator<SipProvider> sipProviderIterator = sipStack.getSipProviders();
try {
while (sipProviderIterator.hasNext()) {
SipProvider sipProvider = sipProviderIterator.next();
if (!ListeningPoint.TCP.equalsIgnoreCase(transport)) {
ListeningPoint[] listeningPoints = sipProvider.getListeningPoints();
for (ListeningPoint listeningPoint : listeningPoints) {
sipProvider.removeListeningPoint(listeningPoint);
sipStack.deleteListeningPoint(listeningPoint);
listeningPoints = sipProvider.getListeningPoints();
}
}
sipProvider.removeSipListener(this);
if (stopSipStack) {
((MobicentsSipCache) ((ClusteredSipStack) sipProvider.getSipStack()).getSipCache()).getMobicentsCache().getJBossCache().remove(Fqn.fromString("DIALOG_IDS"), "outgoingDialogId");
((MobicentsSipCache) ((ClusteredSipStack) sipProvider.getSipStack()).getSipCache()).getMobicentsCache().getJBossCache().remove(Fqn.fromString("DIALOG_IDS"), "incomingDialogId");
}
sipStack.deleteSipProvider(sipProvider);
sipProviderIterator = sipStack.getSipProviders();
}
} catch (Exception e) {
throw new IllegalStateException("Cant remove the listening points or sip providers", e);
}
listeningPoint = null;
provider = null;
sipFactory.resetFactory();
if (stopSipStack) {
sipStack.stop();
sipStack = null;
headerFactory = null;
messageFactory = null;
sipFactory = null;
b2buaHandler = null;
properties = null;
}
}
Aggregations