当前位置: 首页>>代码示例>>Java>>正文


Java SipProvider.addSipListener方法代码示例

本文整理汇总了Java中javax.sip.SipProvider.addSipListener方法的典型用法代码示例。如果您正苦于以下问题:Java SipProvider.addSipListener方法的具体用法?Java SipProvider.addSipListener怎么用?Java SipProvider.addSipListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.sip.SipProvider的用法示例。


在下文中一共展示了SipProvider.addSipListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void setUp() {

        try {
            this.transport = "tcp";

            super.setUp();
            shootist = new Shootist(getRiProtocolObjects());
            SipProvider shootistProvider = shootist.createSipProvider();
            providerTable.put(shootistProvider, shootist);

            shootme = new Shootme(getTiProtocolObjects());
            SipProvider shootmeProvider = shootme.createSipProvider();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(this);
            shootmeProvider.addSipListener(this);

            getRiProtocolObjects().start();
            if (getTiProtocolObjects() != getRiProtocolObjects())
                getTiProtocolObjects().start();
        } catch (Exception ex) {
            ex.printStackTrace();
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:25,代码来源:ReconnectTCPTest.java

示例2: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void setUp() throws Exception {
    try {
        super.setUp();

        logger.info("PrackTest: setup()");
        shootist = new Shootist(getTiProtocolObjects());
        SipProvider shootistProvider = shootist.createProvider();
        providerTable.put(shootistProvider, shootist);

        shootme = new Shootme(getRiProtocolObjects());
        SipProvider shootmeProvider = shootme.createProvider();
        providerTable.put(shootmeProvider, shootme);

        shootistProvider.addSipListener(this);
        shootmeProvider.addSipListener(this);

        if (getTiProtocolObjects() != getRiProtocolObjects())
            getTiProtocolObjects().start();
        getRiProtocolObjects().start();
    } catch (Exception ex) {
        logger.error("unexpected excecption ", ex);
        fail("unexpected exception");
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:25,代码来源:AbstractPrackTestCase.java

示例3: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void setUp() {

        try {
            this.transport = "udp";
            // testedImplFlag = true;// reverse RI/TI
            super.setUp();
            shootist = new Shootist(getRiProtocolObjects());
            SipProvider shootistProvider = shootist.createSipProvider();
            providerTable.put(shootistProvider, shootist);

            shootme = new Shootme(getTiProtocolObjects());
            SipProvider shootmeProvider = shootme.createSipProvider();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(this);
            shootmeProvider.addSipListener(this);

            getRiProtocolObjects().start();
            if (getTiProtocolObjects() != getRiProtocolObjects())
                getTiProtocolObjects().start();
        } catch (Exception ex) {
            ex.printStackTrace();
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:25,代码来源:ChallengeTest.java

示例4: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void setUp() {

        try {
            this.transport = "sctp";

            super.setUp();
            shootist = new Shootist(getRiProtocolObjects());
            SipProvider shootistProvider = shootist.createSipProvider();
            providerTable.put(shootistProvider, shootist);

            shootme = new Shootme(getTiProtocolObjects());
            SipProvider shootmeProvider = shootme.createSipProvider();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(this);
            shootmeProvider.addSipListener(this);

            getRiProtocolObjects().start();
            if (getTiProtocolObjects() != getRiProtocolObjects())
                getTiProtocolObjects().start();
        } catch (Exception ex) {
            ex.printStackTrace();
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:25,代码来源:SctpTest.java

示例5: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
@Override
public void setUp() {

    try {
        super.setUp();
        shootist = new Shootist(5060, 5080);
        SipProvider shootistProvider = shootist.createSipProvider();
        shootistProvider.addSipListener(shootist);

        shootme = new Shootme(5080, 1000);

        SipProvider shootmeProvider = shootme.createProvider();
        shootmeProvider.addSipListener(shootme);

        logger.debug("setup completed");

    } catch (Exception ex) {
        fail("unexpected exception ");
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:21,代码来源:TimeoutOnTerminatedTest.java

示例6: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void setUp() {

        try {

            super.setUp();
            // String stackname, String pathname, String transport,
            // boolean autoDialog
            this.shootistProtocolObjs = new ProtocolObjects("shootist", "gov.nist", "udp", true,true);
            shootist = new Shootist(shootistProtocolObjs);
            SipProvider shootistProvider = shootist.createSipProvider();

            this.shootmeProtocolObjs = new ProtocolObjects("shootme", "gov.nist", "udp", true,true);
            shootme = new Shootme(shootmeProtocolObjs);
            SipProvider shootmeProvider = shootme.createSipProvider();
            
            shootistProvider.addSipListener(shootist);
            shootmeProvider.addSipListener(shootme);

            shootistProtocolObjs.start();
            shootmeProtocolObjs.start();
            
        } catch (Exception ex) {
            ex.printStackTrace();
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:27,代码来源:ReInviteBusyTest.java

示例7: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void setUp() {

        try {
            this.transport = "udp";

            super.setUp();
            
            shootist = new Shootist(getRiProtocolObjects());
            
            SipProvider shootistProvider = shootist.createSipProvider();
            providerTable.put(shootistProvider, shootist);

            shootme = new Shootme(getTiProtocolObjects());
            SipProvider shootmeProvider = shootme.createSipProvider();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(this);
            shootmeProvider.addSipListener(this);
            
            ((SipStackImpl)getTiProtocolObjects().sipStack).setIsBackToBackUserAgent(false);
            ((SipStackImpl)getRiProtocolObjects().sipStack).setIsBackToBackUserAgent(false);

            getRiProtocolObjects().start();
            if (getTiProtocolObjects() != getRiProtocolObjects())
                getTiProtocolObjects().start();
        } catch (Exception ex) {
            ex.printStackTrace();
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:30,代码来源:ReInviteTest.java

示例8: ForkedInviteTest

import javax.sip.SipProvider; //导入方法依赖的package包/类
public ForkedInviteTest() {

        try {
            ProtocolObjects.logFileDirectory = "logs/";
            ProtocolObjects.init("frokedinvite",true);
            providerTable = new Hashtable();
            shootist = new Shootist();
            SipProvider shootistProvider = shootist.createSipProvider();
            providerTable.put(shootistProvider, shootist);

            Shootme shootme = new Shootme(5080);
            SipProvider shootmeProvider = shootme.createProvider();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(this);
            shootmeProvider.addSipListener(this);

            shootme = new Shootme(5090);
            shootmeProvider = shootme.createProvider();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(this);
            shootmeProvider.addSipListener(this);


            Proxy proxy = new Proxy();
            SipProvider provider = proxy.createSipProvider();
            provider.setAutomaticDialogSupportEnabled(false);
            providerTable.put(provider, proxy);
            provider.addSipListener(this);


            ProtocolObjects.start();
        } catch (Exception ex) {
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:36,代码来源:ForkedInviteTest.java

示例9: testSelfroutingTCP

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void testSelfroutingTCP() {
      try {
          this.transport = "tcp";

          super.setUp();
          shootist = new Shootist(getRiProtocolObjects());
          SipProvider shootistProvider = shootist.createSipProvider();
          shootistProvider.addSipListener(shootist);

          getRiProtocolObjects().start();
          if (getTiProtocolObjects() != getRiProtocolObjects())
              getTiProtocolObjects().start();
      } catch (Exception ex) {
          ex.printStackTrace();
          fail("unexpected exception ");
      }
  	new Thread() {
  		@Override
  		public void run() {
  			shootist.sendInvite();
  			super.run();
  		}
  	}.start();
      
      try {
	Thread.sleep(4000);
} catch (InterruptedException e) {
	e.printStackTrace();
}
      assertTrue(this.shootist.okToInviteReceived);
  }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:32,代码来源:SelfroutingTest.java

示例10: testDialogTimeoutSipListenerExt

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void testDialogTimeoutSipListenerExt() {
    
        try {
        	this.shootistProtocolObjs = new ProtocolObjects("shootist", "gov.nist", "udp", false,false, true);
            shootist = new Shootist(shootistProtocolObjs);
            SipProvider shootistProvider = shootist.createSipProvider();

            this.shootmeProtocolObjs = new ProtocolObjects("shootme", "gov.nist", "udp", false,false, true);
            ((SipStackImpl)shootmeProtocolObjs.sipStack).setAggressiveCleanup(true);
            shootme = new Shootme(shootmeProtocolObjs);
            SipProvider shootmeProvider = shootme.createSipProvider();
           
            shootist.init();
            providerTable.put(shootistProvider, shootist);

            shootme.init();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(shootist);
            shootmeProvider.addSipListener(shootme);

            getRiProtocolObjects().start();
            if (getTiProtocolObjects() != getRiProtocolObjects())
                getTiProtocolObjects().start();
            
            this.shootist.sendInviteRequest();
            Thread.currentThread().sleep(TIMEOUT);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            fail("unexpected exception ");
        }

        if (!this.shootme.checkState() || !this.shootist.checkState()) {
            fail("Test Failed - Didnt receive Dialog Timeout Event");
            return;
        }

        doTearDown(false);
        doSetUp();
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:41,代码来源:DialogTimeoutTest.java

示例11: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void setUp() {

        try {
            this.transport = "udp";

            super.setUp();
            
            shootist = new Shootist(getRiProtocolObjects());
            
            SipProvider shootistProvider = shootist.createSipProvider();
            providerTable.put(shootistProvider, shootist);

            shootme = new Shootme(getTiProtocolObjects());
            SipProvider shootmeProvider = shootme.createSipProvider();
            providerTable.put(shootmeProvider, shootme);
            shootistProvider.addSipListener(this);
            shootmeProvider.addSipListener(this);
            
            ((SipStackImpl)getTiProtocolObjects().sipStack).setIsBackToBackUserAgent(true);
            ((SipStackImpl)getRiProtocolObjects().sipStack).setIsBackToBackUserAgent(true);

            getRiProtocolObjects().start();
            if (getTiProtocolObjects() != getRiProtocolObjects())
                getTiProtocolObjects().start();
        } catch (Exception ex) {
            ex.printStackTrace();
            fail("unexpected exception ");
        }
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:30,代码来源:ReInviteTest.java

示例12: main

import javax.sip.SipProvider; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {
    ProtocolObjects.init("shootme", true);
    Shootme.addressFactory = ProtocolObjects.addressFactory;
    Shootme.messageFactory = ProtocolObjects.messageFactory;
    Shootme.headerFactory = ProtocolObjects.headerFactory;
    Shootme.sipStack = ProtocolObjects.sipStack;
    Shootme.transport = ProtocolObjects.transport;
    Shootme shootme = new Shootme();
    SipProvider sipProvider = shootme.createSipProvider();
    sipProvider.addSipListener(shootme);
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:12,代码来源:Shootme.java

示例13: setUp

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void setUp() throws Exception {
    try {
        super.setUp(1,3);

        logger.info("SubsNotifyTest: setup()");

        notifier1 = new Notifier(getTiProtocolObjects(0));
        SipProvider notifier1Provider = notifier1.createProvider(5070);
        providerTable.put(notifier1Provider, notifier1);

        notifier2 = new Notifier(getTiProtocolObjects(1));
        SipProvider notifier2Provider = notifier2.createProvider(5071);
        providerTable.put(notifier2Provider, notifier2);

        forker = new Forker(getRiProtocolObjects(0));
        SipProvider forkerProvider = forker.createProvider(5065);
        providerTable.put(forkerProvider, forker);

        subscriber = new Subscriber(getTiProtocolObjects(2));
        SipProvider subscriberProvider = subscriber.createProvider(5080);
        providerTable.put(subscriberProvider, subscriber);

        notifier1Provider.addSipListener(this);
        notifier2Provider.addSipListener(this);
        forkerProvider.addSipListener(this);
        subscriberProvider.addSipListener(this);

        super.start();
    } catch (Exception ex) {
        logger.error("unexpected excecption ", ex);
        fail("unexpected exception");
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:34,代码来源:AbstractSubsnotifyTestCase.java

示例14: init

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void init() {
    SipFactory sipFactory = null;
    sipStack = null;
    sipFactory = SipFactory.getInstance();
    sipFactory.setPathName("gov.nist");
    Properties properties = new Properties();
    properties.setProperty("javax.sip.STACK_NAME", "shootme");
    // You need 16 for logging traces. 32 for debug + traces.
    // Your code will limp at 32 but it is best for debugging.
    properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "32");
    properties.setProperty("gov.nist.javax.sip.DEBUG_LOG",
            "shootmedebug.txt");
    properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
            "shootmelog.txt");
    if(System.getProperty("enableNIO") != null && System.getProperty("enableNIO").equalsIgnoreCase("true")) {
    	properties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", NioMessageProcessorFactory.class.getName());
    }
    try {
        // Create SipStack object
        sipStack = sipFactory.createSipStack(properties);
        System.out.println("sipStack = " + sipStack);
    } catch (PeerUnavailableException e) {
        // could not find
        // gov.nist.jain.protocol.ip.sip.SipStackImpl
        // in the classpath
        e.printStackTrace();
        System.err.println(e.getMessage());
        if (e.getCause() != null)
            e.getCause().printStackTrace();
        System.exit(0);
    }

    try {
        headerFactory = sipFactory.createHeaderFactory();
        addressFactory = sipFactory.createAddressFactory();
        messageFactory = sipFactory.createMessageFactory();
        ListeningPoint lp = sipStack.createListeningPoint("127.0.0.1",
                myPort, "udp");

        Shootme listener = this;

        SipProvider sipProvider = sipStack.createSipProvider(lp);
        System.out.println("udp provider " + sipProvider);
        sipProvider.addSipListener(listener);

    } catch (Exception ex) {
        ex.printStackTrace();
        fail("Unexpected exception");
    }

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

示例15: testNonInviteTransactionTimeout

import javax.sip.SipProvider; //导入方法依赖的package包/类
public void testNonInviteTransactionTimeout() {
        
            try {
            	this.shootistProtocolObjs = new ProtocolObjects("shootist", "gov.nist", "udp", true,false, true);
                shootist = new Shootist(shootistProtocolObjs);
                SipProvider shootistProvider = shootist.createSipProvider();

                this.shootmeProtocolObjs = new ProtocolObjects("shootme", "gov.nist", "udp", true,false, true);
                ((SipStackImpl)shootmeProtocolObjs.sipStack).setAggressiveCleanup(true);                
                shootme = new Shootme(shootmeProtocolObjs);
                SipProvider shootmeProvider = shootme.createSipProvider();                
               
                shootist.init();
                providerTable.put(shootistProvider, shootist);

                shootme.init(false);                
                providerTable.put(shootmeProvider, shootme);
                shootistProvider.addSipListener(shootist);
                shootmeProvider.addSipListener(shootme);

                getRiProtocolObjects().start();
                if (getTiProtocolObjects() != getRiProtocolObjects())
                    getTiProtocolObjects().start();
                
                ((SipStackImpl)shootmeProtocolObjs.sipStack).setMaxTxLifetimeNonInvite(30);
                ((SipStackImpl)shootistProtocolObjs.sipStack).setMaxTxLifetimeNonInvite(30);
                
                this.shootist.sendRequest(Request.MESSAGE);
                Thread.currentThread().sleep(TIMEOUT);
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                fail("unexpected exception ");
            }

            if (!this.shootme.checkState() || !this.shootist.checkState()) {
                fail("Test Failed - Didnt receive Dialog Timeout Event");
                return;
            }

//            doTearDown(false);
//            doSetUp();
    }
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:44,代码来源:TxTimeoutTest.java


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