• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SipListener类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:17,代码来源:SipProviderImpl.java


示例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;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:23,代码来源:NoToTagOn1xxDialogLeakTest.java


示例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));
	}
}
  }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:15,代码来源:UDPMessageProcessor.java


示例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;

}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:16,代码来源:SipProviderImpl.java


示例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;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:8,代码来源:ScenarioHarness.java


示例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);
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:10,代码来源:Shootist.java


示例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!");
}
        }
    }
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:10,代码来源:VideoBridgeSipListener.java


示例8: getSipListener

import javax.sip.SipListener; //导入依赖的package包/类
/**
 * @return the sipListener
 */
public SipListener getSipListener() {
    return sipListener;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:7,代码来源:SipProviderImpl.java


示例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;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:7,代码来源:AbstractCancelTest.java


示例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;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:6,代码来源:ReInviteTest.java


示例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;
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:12,代码来源:SipStackImpl.java



注:本文中的javax.sip.SipListener类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MyException类代码示例发布时间:2022-05-22
下一篇:
Java ScrollBarState类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap