use of javax.sip.SipProvider in project jain-sip.ha by RestComm.
the class B2BUAEarlyDialogRecoveryOn2xxTestNotEnabled method stopSipStack.
public static void stopSipStack(SipStack sipStack, SipListener listener) {
Iterator<SipProvider> sipProviderIterator = sipStack.getSipProviders();
try {
while (sipProviderIterator.hasNext()) {
SipProvider sipProvider = sipProviderIterator.next();
ListeningPoint[] listeningPoints = sipProvider.getListeningPoints();
for (ListeningPoint listeningPoint : listeningPoints) {
sipProvider.removeListeningPoint(listeningPoint);
sipStack.deleteListeningPoint(listeningPoint);
listeningPoints = sipProvider.getListeningPoints();
}
sipProvider.removeSipListener(listener);
sipStack.deleteSipProvider(sipProvider);
sipProviderIterator = sipStack.getSipProviders();
}
} catch (Exception e) {
throw new IllegalStateException("Cant remove the listening points or sip providers", e);
}
sipStack.stop();
sipStack = null;
}
use of javax.sip.SipProvider in project jain-sip.ha by RestComm.
the class ProxyEarlyDialogRecoveryOn1xxTest method stopSipStack.
public static void stopSipStack(SipStack sipStack, SipListener listener) {
Iterator<SipProvider> sipProviderIterator = sipStack.getSipProviders();
try {
while (sipProviderIterator.hasNext()) {
SipProvider sipProvider = sipProviderIterator.next();
ListeningPoint[] listeningPoints = sipProvider.getListeningPoints();
for (ListeningPoint listeningPoint : listeningPoints) {
sipProvider.removeListeningPoint(listeningPoint);
sipStack.deleteListeningPoint(listeningPoint);
listeningPoints = sipProvider.getListeningPoints();
}
sipProvider.removeSipListener(listener);
sipStack.deleteSipProvider(sipProvider);
sipProviderIterator = sipStack.getSipProviders();
}
} catch (Exception e) {
throw new IllegalStateException("Cant remove the listening points or sip providers", e);
}
sipStack.stop();
sipStack = null;
}
use of javax.sip.SipProvider in project jain-sip.ha by RestComm.
the class B2BUAEarlyDialogRecoveryOn1xxTCPTest method stopSipStack.
public static void stopSipStack(SipStack sipStack, SipListener listener) {
Iterator<SipProvider> sipProviderIterator = sipStack.getSipProviders();
try {
while (sipProviderIterator.hasNext()) {
SipProvider sipProvider = sipProviderIterator.next();
ListeningPoint[] listeningPoints = sipProvider.getListeningPoints();
for (ListeningPoint listeningPoint : listeningPoints) {
try {
sipProvider.removeListeningPoint(listeningPoint);
sipStack.deleteListeningPoint(listeningPoint);
} catch (Exception e) {
System.err.println("Cant remove the listening points or sip providers");
}
listeningPoints = sipProvider.getListeningPoints();
}
sipProvider.removeSipListener(listener);
sipStack.deleteSipProvider(sipProvider);
sipProviderIterator = sipStack.getSipProviders();
}
} catch (Exception e) {
throw new IllegalStateException("Cant remove the listening points or sip providers", e);
}
sipStack.stop();
sipStack = null;
}
use of javax.sip.SipProvider in project jain-sip.ha by RestComm.
the class SimpleStatefulProxy 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);
sipStack.deleteSipProvider(sipProvider);
sipProviderIterator = sipStack.getSipProviders();
}
} catch (Exception e) {
throw new IllegalStateException("Cant remove the listening points or sip providers", e);
}
listeningPoint = null;
sipProvider = null;
sipFactory.resetFactory();
serverTransaction = null;
clientTransaction = null;
currentCtxBranchId = null;
currentCtxRemotePort = null;
if (stopSipStack) {
sipStack.stop();
sipStack = null;
headerFactory = null;
messageFactory = null;
sipFactory = null;
properties = null;
}
}
use of javax.sip.SipProvider 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