Package javax.sip

Examples of javax.sip.Dialog


    // mranga: added check to ensure we are not sending empty (keepalive)
    // message.
    if (((SIPRequest) request).getRequestLine() != null
        && request.getMethod().equals(Request.ACK)) {
      Dialog dialog = sipStack.getDialog(((SIPRequest) request)
          .getDialogId(false));
      if (dialog != null && dialog.getState() != null) {
        sipStack.getLogWriter().logWarning(
            "Dialog exists -- you may want to use Dialog.sendAck() "
                + dialog.getState());
      }
    }
    Hop hop = sipStack.getRouter((SIPRequest) request).getNextHop(request);
    if (hop == null)
      throw new SipException("could not determine next hop!");
View Full Code Here


      if (response.getStatusCode() == Response.OK
          && ((CSeqHeader) response.getHeader(CSeqHeader.NAME))
              .getMethod().equals(Request.INVITE)) {
        ChallengeTest.assertNotNull(
            "INVITE 200 response should match a transaction", tid);
        Dialog dialog = tid.getDialog();
        CSeqHeader cseq = (CSeqHeader) response
            .getHeader(CSeqHeader.NAME);
        Request request = dialog.createAck(cseq.getSeqNumber());
        dialog.sendAck(request);
      }
      if (tid != null) {
        Dialog dialog = tid.getDialog();
        logger.info("Dalog State = " + dialog.getState());
      }
    } catch (Exception ex) {

      String s = "Unexpected exception";
View Full Code Here

        String did = dialogId.toString().toLowerCase();
        getLogWriter().logDebug("Looking for dialog " + did);
        /*
         * Check if we can find this dialog in our dialog table.
         */
        Dialog replacesDialog =  this.dialogTable.get(did);
        /*
         * This could be a forked dialog. Search for it.
         */
        if ( replacesDialog == null ) {
           for ( SIPClientTransaction ctx : this.clientTransactionTable.values()) {
View Full Code Here

      logger.info("shootist:  got a bye .");
      if (serverTransactionId == null) {
        logger.info("shootist:  null TID.");
        return;
      }
      Dialog dialog = serverTransactionId.getDialog();
      logger.info("Dialog State = " + dialog.getState());
      Response response = protocolObjects.messageFactory.createResponse(
          200, request);
      serverTransactionId.sendResponse(response);
      logger.info("shootist:  Sending OK.");
      logger.info("Dialog State = " + dialog.getState());

    } catch (Exception ex) {
      ex.printStackTrace();
      System.exit(0);
View Full Code Here

    logger.info("Response received : Status Code = "
        + response.getStatusCode() + " " + cseq);
    logger.info("Response = " + response + " class=" + response.getClass() );

    Dialog dialog = responseReceivedEvent.getDialog();
    TestHarness.assertNotNull( dialog )
   
    if (tid != null)
      logger.info("transaction state is " + tid.getState());
    else
      logger.info("transaction = " + tid);

    logger.info("Dialog = " + dialog);

    logger.info("SHOOTIST: Dialog state is " + dialog.getState());

    try {
      if (response.getStatusCode() == Response.OK) {
        if (cseq.getMethod().equals(Request.INVITE)) {
          TestHarness.assertEquals( DialogState.CONFIRMED, dialog.getState() );
                 
         
          Request ackRequest = dialog.createAck(cseq
                            .getSeqNumber());
                   
                    TestHarness.assertNotNull( ackRequest.getHeader( MaxForwardsHeader.NAME ) );
   
          // Proxy will fork. I will accept the second dialog
          // but not the first.
          this.forkedDialogs.add(dialog);
          dialog.sendAck(ackRequest);
          if ( forkedDialogs.size() == 2 ) {
            logger.info("Sending ACK");
           
            TestHarness.assertTrue(
                "Dialog state should be CONFIRMED", dialog
                    .getState() == DialogState.CONFIRMED);
            this.ackedDialog = dialog;
           
            // TestHarness.assertNotNull( "JvB: Need CT to find original dialog", tid );

          } else {
           
            // Kill the first dialog by sending a bye.
            SipProvider sipProvider = (SipProvider) responseReceivedEvent
                .getSource();
            Request byeRequest = dialog.createRequest(Request.BYE);
            ClientTransaction ct = sipProvider
                .getNewClientTransaction(byeRequest);
            dialog.sendRequest(ct);         
          }
         
         
        } else {
          logger.info("Response method = " + cseq.getMethod());
View Full Code Here

          "Call-Info", "<http://www.antd.nist.gov>");
      request.addHeader(callInfoHeader);

      // Create the client transaction.
      inviteTid = sipProvider.getNewClientTransaction(request);
      Dialog dialog = inviteTid.getDialog();

      TestHarness.assertTrue("Initial dialog state should be null",
          dialog.getState() == null);

      // send the request out.
      inviteTid.sendRequest();

      this.originalDialog = dialog;
View Full Code Here

            + tid + ":\n" + response);
        try {
          if (response.getStatusCode() == Response.OK
              && ((CSeqHeader) response.getHeader(CSeqHeader.NAME))
                  .getMethod().equals(Request.INVITE)) {
            Dialog dialog = tid.getDialog();
            CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);
            Request ackRequest = dialog.createAck(cseq.getSeqNumber());
            dialog.sendAck(ackRequest);
          }
          if ( tid != null ) {
              Dialog dialog = tid.getDialog();
              logger.info("Dialog State = " + dialog.getState());      }
        } catch (Exception ex) {     
          String s = "Unexpected exception";     
          logger.error(s,ex);
          AckReTransmissionTest.fail(s);
        }
View Full Code Here

         */
        public void processBye(RequestEvent requestEvent,
                ServerTransaction serverTransactionId) {
            SipProvider sipProvider = (SipProvider) requestEvent.getSource();
            Request request = requestEvent.getRequest();
            Dialog dialog = requestEvent.getDialog();
            logger.info("shootme: local party = " + dialog.getLocalParty());
            try {
                logger.info("shootme:  got a bye sending OK.");
                Response response = messageFactory.createResponse(200, request);
                serverTransactionId.sendResponse(response);
                logger.info("shootme: Dialog State is "
View Full Code Here

        }

        public void processDialogTerminated(
                DialogTerminatedEvent dialogTerminatedEvent) {
            logger.info("Shootme: Dialog terminated event recieved");
            Dialog d = dialogTerminatedEvent.getDialog();
            logger.info("Local Party = " + d.getLocalParty());

        }
View Full Code Here

                logger.info("subscriber:  got a notify count  " + this.count++);
                if (serverTransactionId == null) {
                    logger.info("subscriber:  null TID.");
                    serverTransactionId = provider.getNewServerTransaction(notify);
                }
                Dialog dialog = serverTransactionId.getDialog();
                logger.info("Dialog = " + dialog);

                if (dialog != null) {
                    logger.info("Dialog State = " + dialog.getState());
                }

                Response response = messageFactory.createResponse(200, notify);
                // SHOULD add a Contact
                ContactHeader contact = (ContactHeader) contactHeader.clone();
                ((SipURI) contact.getAddress().getURI()).setParameter("id", "sub");
                response.addHeader(contact);
                logger.info("Transaction State = " + serverTransactionId.getState());
                serverTransactionId.sendResponse(response);
                if (dialog != null) {
                    logger.info("Dialog State = " + dialog.getState());
                }
                SubscriptionStateHeader subscriptionState = (SubscriptionStateHeader) notify
                        .getHeader(SubscriptionStateHeader.NAME);

                // Subscription is terminated?
                String state = subscriptionState.getState();
                if (state.equalsIgnoreCase(SubscriptionStateHeader.TERMINATED)) {
                    dialog.delete();
                } else {
                    logger.info("Subscriber: state now " + state);
                }
                this.notifySeen = true;
View Full Code Here

TOP

Related Classes of javax.sip.Dialog

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.