/** * Dispatches the event received from a JAIN-SIP <tt>SipProvider</tt> to one of our "candidate * recipient" listeners. * * @param event the event received for a <tt>SipProvider</tt>. */ public void processTimeout(TimeoutEvent event) { try { Transaction transaction; if (event.isServerTransaction()) { transaction = event.getServerTransaction(); } else { transaction = event.getClientTransaction(); } ProtocolProviderServiceSipImpl recipient = getServiceData(transaction); if (recipient == null) { logger.error( "We received a timeout which wasn't " + "marked, please report this to " + "*****@*****.**"); } else { recipient.processTimeout(event); } } catch (Throwable exc) { // any exception thrown within our code should be caught here // so that we could log it rather than interrupt stack activity with // it. this.logApplicationException(DialogTerminatedEvent.class, exc); } }
public void processTimeout(javax.sip.TimeoutEvent timeoutEvent) { Transaction transaction; if (timeoutEvent.isServerTransaction()) { transaction = timeoutEvent.getServerTransaction(); } else { transaction = timeoutEvent.getClientTransaction(); } System.out.println("state = " + transaction.getState()); System.out.println("dialog = " + transaction.getDialog()); System.out.println("dialogState = " + transaction.getDialog().getState()); System.out.println("Transaction Time out"); }
/** JAIN Listener method. */ public void processTimeout(TimeoutEvent timeOutEvent) { ProxyDebug.println("TimeoutEvent received"); SipProvider sipProvider = (SipProvider) timeOutEvent.getSource(); TransactionsMapping transactionsMapping = null; if (timeOutEvent.isServerTransaction()) { ServerTransaction serverTransaction = timeOutEvent.getServerTransaction(); Dialog dialog = serverTransaction.getDialog(); if (dialog != null) { transactionsMapping = (TransactionsMapping) dialog.getApplicationData(); transactionsMapping.removeMapping(serverTransaction); } } else { ClientTransaction clientTransaction = timeOutEvent.getClientTransaction(); Dialog dialog = clientTransaction.getDialog(); ServerTransaction st = null; if (dialog != null) { transactionsMapping = (TransactionsMapping) dialog.getApplicationData(); if (transactionsMapping != null) { st = transactionsMapping.getServerTransaction(clientTransaction); } if (st == null) { ProxyDebug.println( "ERROR, Unable to retrieve the server transaction," + " cannot process timeout!"); return; } } else { ProxyDebug.println( "ERROR, Unable to retrieve the transaction Mapping," + " cannot process timeout!"); return; } Request request = st.getRequest(); // This removes the given mapping from the table but not // necessarily the whole thing. transactionsMapping.removeMapping(clientTransaction); if (!transactionsMapping.hasMapping(st)) { // No more mappings left in the transaction table. try { Response response = messageFactory.createResponse(Response.REQUEST_TIMEOUT, request); st.sendResponse(response); } catch (ParseException ex) { ex.printStackTrace(); } catch (SipException ex1) { ex1.printStackTrace(); } } } }