Examples of ClientTransaction


Examples of javax.sip.ClientTransaction

                logger.info("shootme: got an ACK! ");
                logger.info("Dialog State = " + dialog.getState());
                SipProvider provider = (SipProvider) requestEvent.getSource();
                if (!callerSendsBye) {
                    Request byeRequest = dialog.createRequest(Request.BYE);
                    ClientTransaction ct = provider
                            .getNewClientTransaction(byeRequest);
                    dialog.sendRequest(ct);
                }
            } catch (Exception ex) {
                logger.error("Unexpected exception", ex);
View Full Code Here

Examples of javax.sip.ClientTransaction

                notifyRequest.addHeader(sstate);
                notifyRequest.setHeader(eventHeader);
                notifyRequest.setHeader(contactHeader);
                // notifyRequest.setHeader(routeHeader);
                ClientTransaction ct = udpProvider.getNewClientTransaction(notifyRequest);

                /*
                 * We deliberately send the NOTIFY first before the 202 is sent.
                 */
                ct.sendRequest();
                logger.info("NOTIFY Branch ID "
                        + ((ViaHeader) request.getHeader(ViaHeader.NAME)).getParameter("branch"));
                logger.info("Dialog " + dialog);
                logger.info("Dialog state after pending NOTIFY: " + dialog.getState());

View Full Code Here

Examples of javax.sip.ClientTransaction

        // Dialog dialog = serverTransaction.getDialog();
        Dialog dialog = requestEvent.getDialog();

        SipProvider provider = (SipProvider) requestEvent.getSource();
        Request byeRequest = dialog.createRequest(Request.BYE);
        ClientTransaction ct = provider.getNewClientTransaction(byeRequest);
        dialog.sendRequest(ct);
      } catch (Exception ex) {
        ex.printStackTrace();
        TestHarness.fail(ex.getMessage());
      }
View Full Code Here

Examples of javax.sip.ClientTransaction

            }

            public void run() {
                try {
                    Request byeRequest = this.dialog.createRequest(Request.BYE);
                    ClientTransaction ct = sipProvider
                            .getNewClientTransaction(byeRequest);
                    logger.info("15s are over: sending BYE now");
                    dialog.sendRequest(ct);
                } catch (Exception ex) {
                    ex.printStackTrace();
View Full Code Here

Examples of javax.sip.ClientTransaction

    public void processResponse(ResponseEvent responseReceivedEvent) {
      logger.info("Got a response");
      Response response = (Response) responseReceivedEvent.getResponse();
      lastResponse = response;
      ClientTransaction tid = responseReceivedEvent.getClientTransaction();
      CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);

      logger.info("Response received : Status Code = "
          + response.getStatusCode() + " " + cseq);
     
      if (cseq.getMethod() == Request.PRACK) {
        prackConfirmed = true;
      }
     
      if (tid == null) {
        logger.info("Stray response -- dropping ");
        return;
      }
      logger.info("transaction state is " + tid.getState());
      logger.info("Dialog = " + tid.getDialog());
      logger.info("Dialog State is " + tid.getDialog().getState());
      SipProvider provider = (SipProvider) responseReceivedEvent.getSource();
      dialog = tid.getDialog();

      try {
        if (response.getStatusCode() == Response.OK) {
          if (cseq.getMethod().equals(Request.INVITE)) {
            Request ackRequest = dialog.createAck(((CSeqHeader) response.getHeader(CSeqHeader.NAME)).getSeqNumber());
View Full Code Here

Examples of javax.sip.ClientTransaction

  }

  public void processResponse(ResponseEvent responseReceivedEvent) {
    logger.info("Got a response");
    Response response = (Response) responseReceivedEvent.getResponse();
    ClientTransaction tid = responseReceivedEvent.getClientTransaction();
    CSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);

    logger.info("Response received : Status Code = "
        + response.getStatusCode() + " " + cseq);
   
   
    if (tid == null) {
      logger.info("Stray response -- dropping ");
      return;
    }
    logger.info("transaction state is " + tid.getState());
    logger.info("Dialog = " + tid.getDialog());
    logger.info("Dialog State is " + tid.getDialog().getState());
    SipProvider provider = (SipProvider) responseReceivedEvent.getSource();
    AbstractRouterTestCase.assertEquals("Provider is not equal to the original proivder",
        provider, sipProvider);

    try {
View Full Code Here

Examples of javax.sip.ClientTransaction

        TlsTest.assertSame("dialog id mismatch", dialog,this.dialog);
        Request bye = dialog.createRequest(Request.BYE);
        MaxForwardsHeader mf = protocolObjects.headerFactory
            .createMaxForwardsHeader(10);
        bye.addHeader(mf);
        ClientTransaction ct = provider.getNewClientTransaction(bye);
        dialog.sendRequest(ct);
        this.byeSent = true;
      }
    } catch (Exception ex) {
      logger.error("unexpected exception",ex);
View Full Code Here

Examples of javax.sip.ClientTransaction

        // the dialog.
        if (reInviteCount == 0) {
          Request inviteRequest = dialog
              .createRequest(Request.INVITE);         
          Thread.sleep(100);
          ClientTransaction ct = provider
              .getNewClientTransaction(inviteRequest);
          dialog.sendRequest(ct);
          reInviteCount++;
        } else {
          this.okReceived = true;
View Full Code Here

Examples of javax.sip.ClientTransaction

                        }
                        ReasonHeader reasonHeader = new Reason();
                        reasonHeader.setCause(1024);
                        reasonHeader.setText("Timed out waiting to re-INVITE");
                        byeRequest.addHeader(reasonHeader);
                        ClientTransaction byeCtx = SIPDialog.this.getSipProvider().getNewClientTransaction(byeRequest);
                        SIPDialog.this.sendRequest(byeCtx);
                        return;
                    }
                }
                if (getState() != DialogState.TERMINATED) {
View Full Code Here

Examples of javax.sip.ClientTransaction

                            ReasonHeader reasonHeader = new Reason();
                            reasonHeader.setProtocol("SIP");
                            reasonHeader.setCause(1025);
                            reasonHeader.setText("Timed out waiting to send ACK");
                            byeRequest.addHeader(reasonHeader);
                            ClientTransaction byeCtx = SIPDialog.this.getSipProvider().getNewClientTransaction(byeRequest);
                            SIPDialog.this.sendRequest(byeCtx);
                            return;
                        } catch (Exception ex) {
                            SIPDialog.this.delete();
                        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.