本文整理汇总了Java中javax.sip.SipListener类的典型用法代码示例。如果您正苦于以下问题:Java SipListener类的具体用法?Java SipListener怎么用?Java SipListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SipListener类属于javax.sip包,在下文中一共展示了SipListener类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeSipListener
import javax.sip.SipListener; //导入依赖的package包/类
public void removeSipListener(SipListener sipListener) {
if (sipListener == this.getSipListener()) {
this.sipListener = null;
}
boolean found = false;
for (Iterator<SipProviderImpl> it = sipStack.getSipProviders(); it.hasNext();) {
SipProviderImpl nextProvider = (SipProviderImpl) it.next();
if (nextProvider.getSipListener() != null)
found = true;
}
if (!found) {
sipStack.sipListener = null;
}
}
示例2: stopSipStack
import javax.sip.SipListener; //导入依赖的package包/类
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;
}
示例3: reportSockeException
import javax.sip.SipListener; //导入依赖的package包/类
private void reportSockeException(Exception e) {
if( exceptionsReportedCounter < MAX_EXCEPTIONS_TO_REPORT ) {
exceptionsReportedCounter++;
boolean lastBeforeFloodingChecker = exceptionsReportedCounter == MAX_EXCEPTIONS_TO_REPORT;
String msg = String.format("Caught '%s' on UDP receive socket on %s:%s, message '%s'. Trying to ignore it ... %s",
e.getClass().getSimpleName(), sock.getLocalAddress().getHostAddress(), getPort(), e.getMessage(), lastBeforeFloodingChecker ? "(Flooding checker active, no more socket IO-exceptions will be reported)" : "");
logger.logWarning(msg);
logger.logException(e);
SipListener listener = sipStack.getSipListener();
if( listener != null ) {
listener.processIOException( new SocketIOExceptionEvent(msg));
}
}
}
示例4: addSipListener
import javax.sip.SipListener; //导入依赖的package包/类
public void addSipListener(SipListener sipListener)
throws TooManyListenersException {
if (sipStack.sipListener == null) {
sipStack.sipListener = sipListener;
} else if (sipStack.sipListener != sipListener) {
throw new TooManyListenersException(
"Stack already has a listener. Only one listener per stack allowed");
}
if (logger.isLoggingEnabled(LogLevels.TRACE_DEBUG))
logger.logDebug("add SipListener " + sipListener);
this.sipListener = sipListener;
}
示例5: getSipListener
import javax.sip.SipListener; //导入依赖的package包/类
private SipListener getSipListener(EventObject sipEvent) {
SipProvider source = (SipProvider) sipEvent.getSource();
SipListener listener = (SipListener) providerTable.get(source);
if (listener == null)
throw new TckInternalError("Unexpected null listener");
return listener;
}
示例6: createProvider
import javax.sip.SipListener; //导入依赖的package包/类
public void createProvider(SipListener listener) throws Exception {
sipProviders = new SipProvider[NBPROVIDERS];
for (int i = 0; i < NBPROVIDERS; i++) {
ListeningPoint listeningPoint = sipStack.createListeningPoint(
"127.0.0.1", 15060 + i, transport);
sipProviders[i] = sipStack.createSipProvider(listeningPoint);
sipProviders[i].addSipListener(listener);
}
}
示例7: addSipListener
import javax.sip.SipListener; //导入依赖的package包/类
public void addSipListener(String key, SipListener sipListener) {
synchronized (sipListenersTable) {
if (!sipListenersTable.containsKey(key)) {
sipListenersTable.put(key, sipListener);
} else {
Log.error("key: " + key + " already mapped!");
}
}
}
示例8: getSipListener
import javax.sip.SipListener; //导入依赖的package包/类
/**
* @return the sipListener
*/
public SipListener getSipListener() {
return sipListener;
}
示例9: getSipListener
import javax.sip.SipListener; //导入依赖的package包/类
private SipListener getSipListener(EventObject sipEvent) {
SipProvider source = (SipProvider) sipEvent.getSource();
SipListener listener = (SipListener) providerTable.get(source);
assertTrue(listener != null);
return listener;
}
示例10: getSipListener
import javax.sip.SipListener; //导入依赖的package包/类
private SipListener getSipListener(EventObject sipEvent) {
SipProvider source = (SipProvider) sipEvent.getSource();
SipListener listener = (SipListener) providerTable.get(source);
return listener;
}
示例11: getSipListener
import javax.sip.SipListener; //导入依赖的package包/类
/**
* Get the listener for the stack. A stack can have only one listener. To
* get an event from a provider, the listener has to be registered with the
* provider. The SipListener is application code.
*
* @return -- the stack SipListener
*
*/
public SipListener getSipListener() {
return this.sipListener;
}