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