Package javax.sip

Examples of javax.sip.SipFactory


            return null;
        }
    }

    public void init() {
        SipFactory sipFactory = null;
        sipFactory = SipFactory.getInstance();
        sipFactory.setPathName("gov.nist");
        Properties properties = new Properties();

        /* remote peer host */
        String peerHostPort = Shootist.peerHostPort;
        String localHost = myAddress;
View Full Code Here


            System.out.println("dialogState = " + transaction.getDialog().getState());
            System.out.println("Transaction Time out");
        }

        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();
                ((MessageFactoryImpl) messageFactory).setTest(true);
                ListeningPoint lp = sipStack.createListeningPoint("127.0.0.1", myPort, "udp");

                Shootme listener = this;
View Full Code Here

            this.timeoutRecieved = true;
        }

        public void init() {
            SipFactory sipFactory = null;
            sipStack = null;
            sipFactory = SipFactory.getInstance();
            sipFactory.setPathName("gov.nist");
            Properties properties = new Properties();
            // If you want to try TCP transport change the following to
            String transport = "udp";
            String peerHostPort = "127.0.0.1:5070";
            properties.setProperty("javax.sip.OUTBOUND_PROXY", peerHostPort + "/" + transport);
            // If you want to use UDP then uncomment this.
            properties.setProperty("javax.sip.STACK_NAME", "shootist");

            // The following properties are specific to nist-sip
            // and are not necessarily part of any other jain-sip
            // implementation.
            // You can set a max message size for tcp transport to
            // guard against denial of service attack.
            properties.setProperty("gov.nist.javax.sip.DEBUG_LOG", "shootistdebug.txt");
            properties.setProperty("gov.nist.javax.sip.SERVER_LOG", "shootistlog.txt");

            // Drop the client connection after we are done with the
            // transaction.
            properties.setProperty("gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS", "false");
            // Set to 0 (or NONE) in your production code for max speed.
            // You need 16 (or TRACE) for logging traces. 32 (or DEBUG) for
            // debug + traces.
            // Your code will limp at 32 but it is best for debugging.
            properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "DEBUG");
            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("createSipStack " + sipStack);
            } catch (PeerUnavailableException e) {
                // could not find
                // gov.nist.jain.protocol.ip.sip.SipStackImpl
                // in the classpath
                e.printStackTrace();
                System.err.println(e.getMessage());
                fail("Problem with setup");
            }

            try {
                headerFactory = sipFactory.createHeaderFactory();
                addressFactory = sipFactory.createAddressFactory();
                messageFactory = sipFactory.createMessageFactory();
                udpListeningPoint = sipStack.createListeningPoint("127.0.0.1", 5060, "udp");
                sipProvider = sipStack.createSipProvider(udpListeningPoint);
                Shootist listener = this;
                sipProvider.addSipListener(listener);
View Full Code Here

           
            assertEquals ("ClientTxState must be Calling ", timeoutEvent.getClientTransaction().getState(), TransactionState.CALLING);
        }

        public void init() {
            SipFactory sipFactory = null;
            sipStack = null;
            sipFactory = SipFactory.getInstance();
            sipFactory.setPathName("gov.nist");
            Properties properties = new Properties();
            // If you want to try TCP transport change the following to
            String transport = "udp";
            String peerHostPort = "127.0.0.1:5070";
            properties.setProperty("javax.sip.OUTBOUND_PROXY", peerHostPort
                    + "/" + transport);
            // If you want to use UDP then uncomment this.
            properties.setProperty("javax.sip.STACK_NAME", "shootist");

            // The following properties are specific to nist-sip
            // and are not necessarily part of any other jain-sip
            // implementation.
            // You can set a max message size for tcp transport to
            // guard against denial of service attack.
            properties.setProperty("gov.nist.javax.sip.DEBUG_LOG",
                    "logs/" + this.getClass().getName() + ".shootistdebug.txt");
            properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
                    "logs/shootistlog.txt");

            // Drop the client connection after we are done with the
            // transaction.
            properties.setProperty(
                    "gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS", "false");
            // Set to 0 (or NONE) in your production code for max speed.
            // You need 16 (or TRACE) for logging traces. 32 (or DEBUG) for
            // debug + traces.
            // Your code will limp at 32 but it is best for debugging.
            properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "DEBUG");

            if(System.getProperty("enableNIO") != null && System.getProperty("enableNIO").equalsIgnoreCase("true")) {
              logger.info("\nNIO Enabled\n");
              properties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", NioMessageProcessorFactory.class.getName());
            }
           
            try {
                // Create SipStack object
                sipStack = sipFactory.createSipStack(properties);
                logger.info("createSipStack " + sipStack);
            } catch (PeerUnavailableException e) {
                // could not find
                // gov.nist.jain.protocol.ip.sip.SipStackImpl
                // in the classpath
                e.printStackTrace();
                System.err.println(e.getMessage());
                System.exit(0);
            }

            try {
                headerFactory = sipFactory.createHeaderFactory();
                addressFactory = sipFactory.createAddressFactory();
                messageFactory = sipFactory.createMessageFactory();
                udpListeningPoint = sipStack.createListeningPoint("127.0.0.1",
                        5060, "udp");
                sipProvider = sipStack.createSipProvider(udpListeningPoint);
                Shootist listener = this;
                sipProvider.addSipListener(listener);
View Full Code Here

    public void processTimeout(javax.sip.TimeoutEvent timeoutEvent) {
      System.out.println("Transaction Time out" );
    }

    public void init() {
      SipFactory sipFactory = null;
      sipStack = null;
      sipFactory = SipFactory.getInstance();
      sipFactory.setPathName("gov.nist");
      Properties properties = new Properties();
      String transport = "tls";
      int port = 5061;
      String peerHostPort = "127.0.0.1:5071";
      properties.setProperty(
          "javax.sip.OUTBOUND_PROXY",
          peerHostPort + "/" + transport);
      // If you want to use UDP then uncomment this.
      //properties.setProperty(
      //  "javax.sip.ROUTER_PATH",
      //  "examples.shootistTLS.MyRouter");
      properties.setProperty("javax.sip.STACK_NAME", "shootist");

      // The following properties are specific to nist-sip
      // and are not necessarily part of any other jain-sip
      // implementation.
      // You can set a max message size for tcp transport to
      // guard against denial of service attack.
      properties.setProperty("gov.nist.javax.sip.MAX_MESSAGE_SIZE",
          "1048576");
      properties.setProperty(
          "gov.nist.javax.sip.DEBUG_LOG",
          "logs/shootistdebug.txt");
      properties.setProperty(
          "gov.nist.javax.sip.SERVER_LOG",
          "logs/shootistlog.txt");
      properties.setProperty(
          "gov.nist.javax.sip.SSL_HANDSHAKE_TIMEOUT", "10000");
      properties.setProperty("gov.nist.javax.sip.TCP_POST_PARSING_THREAD_POOL_SIZE", "20");
      properties.setProperty("gov.nist.javax.sip.TLS_SECURITY_POLICY",
          this.getClass().getName());

      // Drop the client connection after we are done with the transaction.
      properties.setProperty("gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS", "false");
      // Set to 0 in your production code for max speed.
      // 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", "LOG4J");
      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("createSipStack " + sipStack);
      } catch (PeerUnavailableException e) {
        // could not find
        // gov.nist.jain.protocol.ip.sip.SipStackImpl
        // in the classpath
        e.printStackTrace();
        System.err.println(e.getMessage());
        TlsTest.fail("unexpected Exception");
      }

      try {
        headerFactory = sipFactory.createHeaderFactory();
        addressFactory = sipFactory.createAddressFactory();
        messageFactory = sipFactory.createMessageFactory();
        BadShootist listener = this;

        tlsListeningPoint = sipStack.createListeningPoint
            ("127.0.0.1", port, transport);
        tlsProvider = sipStack.createSipProvider(tlsListeningPoint);
View Full Code Here

            }
            logger.info("Shootme: Transaction Time out : " + transaction    );
        }

        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", "DEBUG");
            properties.setProperty("gov.nist.javax.sip.DEBUG_LOG",
                    "logs/"+this.getClass().getName()+ ".shootmedebug.txt");
            properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
                    "shootmelog.txt");
            if(System.getProperty("enableNIO") != null && System.getProperty("enableNIO").equalsIgnoreCase("true")) {
              logger.info("\nNIO Enabled\n");
              properties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", NioMessageProcessorFactory.class.getName());
            }
            try {
                // Create SipStack object
                sipStack = sipFactory.createSipStack(properties);
                logger.info("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();
                logger.error("Unexpected error creating stack", e);
                fail ("Unexpected error");
            }

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

                Shootme listener = this;
View Full Code Here

        // TODO Auto-generated method stub

    }

    public void setUp() {
        SipFactory sipFactory = SipFactory.getInstance();
        sipFactory.resetFactory();
        sipFactory.setPathName("gov.nist");
        Properties properties = new Properties();
        properties.setProperty("javax.sip.STACK_NAME", "mystack");

        // The following properties are specific to nist-sip
        // and are not necessarily part of any other jain-sip
        // implementation.

        properties.setProperty("gov.nist.javax.sip.THREAD_POOL_SIZE", "1");

        properties.setProperty("gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY",
                "true");
        if(System.getProperty("enableNIO") != null && System.getProperty("enableNIO").equalsIgnoreCase("true")) {
          properties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", NioMessageProcessorFactory.class.getName());
        }
        try {
            this.port = 6050;
            this.transport = "udp";
            this.sipStack = sipFactory.createSipStack(properties);
            this.listeningPoint = sipStack.createListeningPoint("127.0.0.1",
                    port, transport);
            sipProvider = sipStack.createSipProvider(listeningPoint);
            this.addressFactory = sipFactory.createAddressFactory();
            this.headerFactory = sipFactory.createHeaderFactory();
            // Create the request.
            this.messageFactory = sipFactory.createMessageFactory();
            sipProvider.addSipListener(this);

            timer.schedule(new TimerTask() {

                public void run() {
View Full Code Here

          "dialogState = " + transaction.getDialog().getState());
      TlsTest.fail("Tx timed out");
    }

    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", "LOG4J");
      properties.setProperty("gov.nist.javax.sip.TCP_POST_PARSING_THREAD_POOL_SIZE", "20");
      properties.setProperty(
          "gov.nist.javax.sip.DEBUG_LOG",
          "logs/shootmedebug.txt");
      properties.setProperty(
          "gov.nist.javax.sip.SERVER_LOG",
          "logs/shootmelog.txt");
      // Guard against starvation.
      properties.setProperty(
          "gov.nist.javax.sip.READ_TIMEOUT", "1000");
      properties.setProperty(
          "gov.nist.javax.sip.SSL_HANDSHAKE_TIMEOUT", "10000");
      String transport = "tls";
      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 lpTLS = sipStack.createListeningPoint("127.0.0.1", myPort, transport);

        BadShootme listener = this;

        SipProvider sipProvider = sipStack.createSipProvider(lpTLS);
View Full Code Here

        public ProtocolObjects(String stackname, String pathname, String transport,
                boolean autoDialog, boolean isBackToBackUserAgent) {

          this.autoDialog = autoDialog;
            this.transport = transport;
            SipFactory sipFactory = SipFactory.getInstance();
            sipFactory.resetFactory();
            sipFactory.setPathName(pathname);
            Properties properties = new Properties();
            properties.setProperty("javax.sip.STACK_NAME", stackname);

            // The following properties are specific to nist-sip
            // and are not necessarily part of any other jain-sip
            // implementation.
            properties.setProperty("gov.nist.javax.sip.DEBUG_LOG", logFileDirectory
                    + ReInviteBusyTest.class.getName() + "-debuglog.txt");
            properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
                    logFileDirectory + "ReInviteBusyTest-" + "log.txt");

            properties.setProperty("javax.sip.AUTOMATIC_DIALOG_SUPPORT",
                    (autoDialog ? "on" : "off"));

            // For the forked subscribe notify test
            properties.setProperty("javax.sip.FORKABLE_EVENTS", "foo");

            //For the TelUrlRouter test.
            //properties.setProperty("javax.sip.ROUTER_PATH", NonSipUriRouter.class.getName());

            // Dont use the router for all requests.
            properties.setProperty("javax.sip.USE_ROUTER_FOR_ALL_URIS", "false");


            properties.setProperty("gov.nist.javax.sip.THREAD_POOL_SIZE", "1");
           
            properties.setProperty("gov.nist.javax.sip.IS_BACK_TO_BACK_USER_AGENT", Boolean.toString(isBackToBackUserAgent));
            //For the TelUrlRouter test.
            properties.setProperty("javax.sip.ROUTER_PATH", NonSipUriRouter.class.getName());


            // Set to 0 in your production code for max speed.
            // 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", new Integer(
                    logLevel).toString());
            if(System.getProperty("enableNIO") != null && System.getProperty("enableNIO").equalsIgnoreCase("true")) {
              logger.info("\nNIO Enabled\n");
              properties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", NioMessageProcessorFactory.class.getName());
            }
            try {
                // Create SipStack object
                sipStack = sipFactory.createSipStack(properties);

                NonSipUriRouter router = (NonSipUriRouter) sipStack.getRouter();

                router.setMyPort(5080);

                System.out.println("createSipStack " + sipStack);
            } catch (Exception e) {
                // could not find
                // gov.nist.jain.protocol.ip.sip.SipStackImpl
                // in the classpath
                e.printStackTrace();
                System.err.println(e.getMessage());
                throw new RuntimeException("Stack failed to initialize");
            }

            try {
                headerFactory = sipFactory.createHeaderFactory();
                addressFactory = sipFactory.createAddressFactory();
                messageFactory = sipFactory.createMessageFactory();
            } catch (SipException ex) {
                ex.printStackTrace();
                throw new RuntimeException(ex);
            }
        }
View Full Code Here

        init(domain, null);
    }
   
    public void init(String domain, Properties props) {
      this.domain = domain;
        SipFactory sipFactory = null;
        sipStack = null;
        sipFactory = SipFactory.getInstance();
        sipFactory.setPathName("gov.nist");
      
        String transport = "tls";
        int port = 5061;
        String peerHostPort = "127.0.0.1:5071";
        Properties properties = new Properties();
        if(props == null) {                  
            properties.setProperty(
                "javax.sip.OUTBOUND_PROXY",
                peerHostPort + "/" + transport);
            // If you want to use UDP then uncomment this.
            //properties.setProperty(
            //  "javax.sip.ROUTER_PATH",
            //  "examples.shootistTLS.MyRouter");
            properties.setProperty("javax.sip.STACK_NAME", "shootist");
      
            // The following properties are specific to nist-sip
            // and are not necessarily part of any other jain-sip
            // implementation.
            // You can set a max message size for tcp transport to
            // guard against denial of service attack.
            properties.setProperty("gov.nist.javax.sip.MAX_MESSAGE_SIZE",
                        "1048576");
            properties.setProperty(
                "gov.nist.javax.sip.DEBUG_LOG",
                "logs/shootistdebug.txt");
            properties.setProperty(
                "gov.nist.javax.sip.SERVER_LOG",
                "logs/shootistlog.txt");
            properties.setProperty(
                    "gov.nist.javax.sip.SSL_HANDSHAKE_TIMEOUT", "10000");
            properties.setProperty("gov.nist.javax.sip.TCP_POST_PARSING_THREAD_POOL_SIZE", "20");
            properties.setProperty("gov.nist.javax.sip.TLS_SECURITY_POLICY",
                    this.getClass().getName());
   
            // Drop the client connection after we are done with the transaction.
            properties.setProperty("gov.nist.javax.sip.CACHE_CLIENT_CONNECTIONS", "false");
            // Set to 0 in your production code for max speed.
            // 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", "LOG4J");
            if(System.getProperty("enableNIO") != null && System.getProperty("enableNIO").equalsIgnoreCase("true")) {
              properties.setProperty("gov.nist.javax.sip.MESSAGE_PROCESSOR_FACTORY", NioMessageProcessorFactory.class.getName());
            }
        } else {
            properties = props;
        }
        try {
            // Create SipStack object
            sipStack = sipFactory.createSipStack(properties);
            System.out.println("createSipStack " + sipStack);
        } catch (PeerUnavailableException e) {
            // could not find
            // gov.nist.jain.protocol.ip.sip.SipStackImpl
            // in the classpath
            e.printStackTrace();
            System.err.println(e.getMessage());
            TlsTest.fail("unexpected Exception");
        }

        try {
            headerFactory = sipFactory.createHeaderFactory();
            addressFactory = sipFactory.createAddressFactory();
            messageFactory = sipFactory.createMessageFactory();
            Shootist listener = this;

            tlsListeningPoint = sipStack.createListeningPoint
                                ("127.0.0.1", port, transport);
            tlsProvider = sipStack.createSipProvider(tlsListeningPoint);
View Full Code Here

TOP

Related Classes of javax.sip.SipFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.