Package javax.sip

Examples of javax.sip.TimeoutEvent


                        }
                        lastRequest.setHeader(timeStamp);
                    }
                    super.sendMessage(lastRequest);
                    if (this.notifyOnRetransmit) {
                        TimeoutEvent txTimeout = new TimeoutEvent(this.getSipProvider(), this,
                                Timeout.RETRANSMIT);
                        this.getSipProvider().handleEvent(txTimeout, this);
                    }
                    if (this.timeoutIfStillInCallingState
                            && this.getInternalState() == TransactionState._CALLING) {
                        this.callingStateTimeoutCount--;
                        if (callingStateTimeoutCount == 0) {
                            TimeoutEvent timeoutEvent = new TimeoutEvent(this.getSipProvider(),
                                    this, Timeout.RETRANSMIT);
                            this.getSipProvider().handleEvent(timeoutEvent, this);
                            this.timeoutIfStillInCallingState = false;
                        }
View Full Code Here


        public void runTask() {
            SIPClientTransaction ct = SIPClientTransaction.this;
            SipProviderImpl provider = ct.getSipProvider();
    
            if (ct.getState() != TransactionState.TERMINATED ) {
                TimeoutEvent tte = new TimeoutEvent(SIPClientTransaction.this.getSipProvider(),
                        SIPClientTransaction.this, Timeout.TRANSACTION);
                provider.handleEvent(tte, ct);
            } else {
                if ( SIPClientTransaction.this.logger.isLoggingEnabled(LogWriter.TRACE_DEBUG) ) {
                    SIPClientTransaction.this.logger.logDebug("state = " + ct.getState());
View Full Code Here

            } catch (TooManyListenersException ex) {
                throw new TiUnexpectedError(
                        "Failed to register a SipListener with TI", ex);
            }
            waitForTimeout();
            TimeoutEvent timeoutEvent = eventCollector
                    .extractCollectedTimeoutEvent();
            assertNotNull("Timeout event", timeoutEvent);
            assertTrue("Timeout event type ", timeoutEvent.getTimeout().equals(
                    Timeout.TRANSACTION));
        } catch (Exception ex) {
            logger.error("unexpected exception ", ex);
            ex.printStackTrace();
            fail("unexpected exception");
View Full Code Here

            response.setHeader(contact);
            st.sendResponse(response);

            eventCollector.collectTimeoutEvent(tiSipProvider);
            waitForTimeout();
            TimeoutEvent timeoutEvent = eventCollector
                    .extractCollectedTimeoutEvent();
            assertNull("Timeout event", timeoutEvent);
            //assertNotNull("Timeout event", timeoutEvent);
            //assertTrue("Timeout event type must be TRANSACTION ", timeoutEvent
                //.getTimeout().equals(Timeout.TRANSACTION));
View Full Code Here

            response.setHeader(contact);
            st.enableRetransmissionAlerts();
            st.sendResponse(response);
            eventCollector.collectTimeoutEvent(tiSipProvider);
            waitForTimeout();
            TimeoutEvent timeoutEvent = eventCollector
                    .extractCollectedTimeoutEvent();
            assertNotNull("Timeout event not found ", timeoutEvent);
            assertTrue("Timeout event type must be retransmit ", timeoutEvent
                    .getTimeout().equals(Timeout.RETRANSMIT));

        } catch (Exception ex) {
            logger.error("unexpected exception ", ex);
            ex.printStackTrace();
View Full Code Here

                        }
                        lastRequest.setHeader(timeStamp);
                    }
                    super.sendMessage(lastRequest);
                    if (this.notifyOnRetransmit) {
                        TimeoutEvent txTimeout = new TimeoutEvent(this.getSipProvider(), this,
                                Timeout.RETRANSMIT);
                        this.getSipProvider().handleEvent(txTimeout, this);
                    }
                    if (this.timeoutIfStillInCallingState
                            && this.getState() == TransactionState.CALLING) {
                        this.callingStateTimeoutCount--;
                        if (callingStateTimeoutCount == 0) {
                            TimeoutEvent timeoutEvent = new TimeoutEvent(this.getSipProvider(),
                                    this, Timeout.RETRANSMIT);
                            this.getSipProvider().handleEvent(timeoutEvent, this);
                            this.timeoutIfStillInCallingState = false;
                        }
View Full Code Here

      } catch (TooManyListenersException ex) {
        throw new TiUnexpectedError(
            "Failed to register a SipListener with TI", ex);
      }
      waitForTimeout();
      TimeoutEvent timeoutEvent = eventCollector
          .extractCollectedTimeoutEvent();
      assertNotNull("Timeout event", timeoutEvent);
      assertTrue("Timeout event type ", timeoutEvent.getTimeout().equals(
          Timeout.TRANSACTION));
    } catch (Exception ex) {
      logger.error("unexpected exception ", ex);
      ex.printStackTrace();
      fail("unexpected exception");
View Full Code Here

      response.setHeader(contact);
      st.sendResponse(response);

      eventCollector.collectTimeoutEvent(tiSipProvider);
      waitForTimeout();
      TimeoutEvent timeoutEvent = eventCollector
          .extractCollectedTimeoutEvent();
      assertNotNull("Timeout event", timeoutEvent);
      assertTrue("Timeout event type must be TRANSACTION ", timeoutEvent
          .getTimeout().equals(Timeout.TRANSACTION));

    } catch (Exception ex) {
      logger.error("unexpected exception ", ex);
      ex.printStackTrace();
View Full Code Here

      response.setHeader(contact);
      st.enableRetransmissionAlerts();
      st.sendResponse(response);
      eventCollector.collectTimeoutEvent(tiSipProvider);
      waitForTimeout();
      TimeoutEvent timeoutEvent = eventCollector
          .extractCollectedTimeoutEvent();
      assertNotNull("Timeout event not found ", timeoutEvent);
      assertTrue("Timeout event type must be retransmit ", timeoutEvent
          .getTimeout().equals(Timeout.RETRANSMIT));

    } catch (Exception ex) {
      logger.error("unexpected exception ", ex);
      ex.printStackTrace();
View Full Code Here

                        "TransportError occured on " + transaction);
            }
            // Treat this like a timeout event. (Suggestion from Christophe).
            Object errorObject = transactionErrorEvent.getSource();
            Timeout timeout = Timeout.TRANSACTION;
            TimeoutEvent ev = null;

            if (errorObject instanceof SIPServerTransaction) {
                ev = new TimeoutEvent(this, (ServerTransaction) errorObject,
                        timeout);
            } else {
                SIPClientTransaction clientTx = (SIPClientTransaction) errorObject;
                Hop hop = clientTx.getNextHop();
                if ( sipStack.getRouter() instanceof RouterExt ) {
                    ((RouterExt) sipStack.getRouter()).transactionTimeout(hop);
                }
                ev = new TimeoutEvent(this, (ClientTransaction) errorObject,
                        timeout);
            }
            // Handling transport error like timeout
            this.handleEvent(ev, (SIPTransaction) errorObject);
        } else if (transactionErrorEvent.getErrorID() == SIPTransactionErrorEvent.TIMEOUT_ERROR) {
            // This is a timeout event.
            Object errorObject = transactionErrorEvent.getSource();
            Timeout timeout = Timeout.TRANSACTION;
            TimeoutEvent ev = null;

            if (errorObject instanceof SIPServerTransaction) {
                ev = new TimeoutEvent(this, (ServerTransaction) errorObject,
                        timeout);
            } else {
                SIPClientTransaction clientTx = (SIPClientTransaction) errorObject;
                Hop hop = clientTx.getNextHop();
                if ( sipStack.getRouter() instanceof RouterExt ) {
                    ((RouterExt) sipStack.getRouter()).transactionTimeout(hop);
                }

                ev = new TimeoutEvent(this, (ClientTransaction) errorObject,
                        timeout);
            }
            this.handleEvent(ev, (SIPTransaction) errorObject);

        } else if (transactionErrorEvent.getErrorID() == SIPTransactionErrorEvent.TIMEOUT_RETRANSMIT) {
            // This is a timeout retransmit event.
            // We should never get this if retransmit filter is
            // enabled (ie. in that case the stack should handle.
            // all retransmits.
            Object errorObject = transactionErrorEvent.getSource();
            Transaction tx = (Transaction) errorObject;

            if (tx.getDialog() != null)
                InternalErrorHandler.handleException("Unexpected event !",
                        this.sipStack.getStackLogger());

            Timeout timeout = Timeout.RETRANSMIT;
            TimeoutEvent ev = null;

            if (errorObject instanceof SIPServerTransaction) {
                ev = new TimeoutEvent(this, (ServerTransaction) errorObject,
                        timeout);
            } else {
                ev = new TimeoutEvent(this, (ClientTransaction) errorObject,
                        timeout);
            }
            this.handleEvent(ev, (SIPTransaction) errorObject);
        }
    }
View Full Code Here

TOP

Related Classes of javax.sip.TimeoutEvent

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.