Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package test.unit.gov.nist.javax.sip.stack.forkedinvite;
 
 
 
// import org.sipfoundry.commons.log4j.SipFoundryAppender;
// import org.sipfoundry.commons.log4j.SipFoundryLayout;
// import org.sipfoundry.commons.log4j.SipFoundryLogRecordFactory;
public class SipObjects {
    public SipObjects(int myPortString stackNameString 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.MAX_FORK_TIME_SECONDS""12");
        properties.setProperty("gov.nist.javax.sip.DEBUG_LOG"logFile);
        try {
            // Create SipStack object
             = sipFactory.createSipStack(properties);
            String logFileDirectory = "logs/";
            /* SipFoundryAppender sfa = new SipFoundryAppender(new SipFoundryLayout(),
                    logFileDirectory + "sip" + stackname + ".log");
            ((SipStackImpl) sipStack).addLogAppender(sfa);*/
            ..println("createSipStack " + );
        } catch (Exception e) {
            // could not find
            // gov.nist.jain.protocol.ip.sip.SipStackImpl
            // in the classpath
            e.printStackTrace();
            ..println(e.getMessage());
            throw new RuntimeException("Stack failed to initialize");
        }
        try {
             = sipFactory.createHeaderFactory();
             = sipFactory.createAddressFactory();
             = sipFactory.createMessageFactory();
        } catch (SipException ex) {
            ex.printStackTrace();
            throw new RuntimeException(ex);
        }
    }
New to GrepCode? Check out our FAQ X