Package javax.sip

Examples of javax.sip.SipFactory


          + 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");

      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");

      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

    }

   

    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");

      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

            + transaction.getDialog().getState());
        System.out.println("Shootme : 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");

        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;
View Full Code Here

        ex.printStackTrace();
      }
    }

    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";
      // String peerHostPort = "230.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");

      try {
        // Create SipStack object
        sipStack = sipFactory.createSipStack(properties);
        System.out.println("Shootist : 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

    HeaderFactory headerFactory;
    AddressFactory addressFactory;
    MessageFactory messageFactory;

    public SipObjects(int myPort, String stackName, String automaticDialog) {
        SipFactory sipFactory = SipFactory.getInstance();
        sipFactory.resetFactory();
        sipFactory.setPathName("gov.nist");
        Properties properties = new Properties();
        String stackname = stackName + myPort;
        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("javax.sip.AUTOMATIC_DIALOG_SUPPORT", automaticDialog);

       /* properties.setProperty("gov.nist.javax.sip.LOG_FACTORY", SipFoundryLogRecordFactory.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", "32");
        String logFile = "logs/" + stackname + ".txt";

        properties.setProperty("gov.nist.javax.sip.DEBUG_LOG", logFile);

        try {
            // Create SipStack object
            sipStack = sipFactory.createSipStack(properties);
            String logFileDirectory = "logs/";

            /* SipFoundryAppender sfa = new SipFoundryAppender(new SipFoundryLayout(),
                    logFileDirectory + "sip" + stackname + ".log");

            ((SipStackImpl) sipStack).addLogAppender(sfa);*/
            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

          + 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");

      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;
View Full Code Here

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

    public void init(Collection<Dialog> dialogs) {
      SipFactory sipFactory = null;
      sipStack = null;
      sipFactory = SipFactory.getInstance();
      sipFactory.setPathName("gov.nist");
      Properties properties = new Properties();
      properties.setProperty("javax.sip.STACK_NAME", stackName);
//      properties.setProperty("javax.sip.OUTBOUND_PROXY", Integer
//                  .toString(BALANCER_PORT));
      // 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", "logs/" +
          stackName + "debug.txt");
      properties.setProperty("gov.nist.javax.sip.SERVER_LOG", "logs/" +
          stackName + "log.xml");

      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(myAddress,
            myPort, ListeningPoint.UDP);

        Shootme listener = this;
View Full Code Here

  ProtocolObjects(String stackname, boolean autoDialog, String transport, String logFileDirectory) {
   
    this.transport = transport;
    this.logFileDirectory = logFileDirectory;
    SipFactory sipFactory = null;

    sipFactory = SipFactory.getInstance();
    sipFactory.setPathName("gov.nist");
    Properties properties = new Properties();
    // If you want to try TCP transport change the following to

    // If you want to use UDP then uncomment this.
    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
        + stackname + "debug.txt");
    properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
        logFileDirectory + stackname + "log.txt");

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

    // 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());

    try {
      // Create SipStack object
      sipStack = sipFactory.createSipStack(properties);

      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

        ex.printStackTrace();
      }
    }

    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:" + BALANCER_PORT;
      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/shootistdebug.txt");
      properties.setProperty("gov.nist.javax.sip.SERVER_LOG",
          "logs/shootistlog.xml");

      // 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");

      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());
        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

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.