Package javax.sip

Examples of javax.sip.Dialog


                        + 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);
                    KeepAliveReliableConnectionTest.fail(s);
View Full Code Here


     *
     * @see gov.nist.javax.sip.stack.SIPTransaction#getDialog()
     */
    public  Dialog getDialog() {
        // This is for backwards compatibility.
        Dialog retval = null;
        // get it in a local variable because the last response can be nullified and the if condition
        // can throw NPE
        SIPResponse localLastResponse = this.lastResponse;
        if(localLastResponse != null && localLastResponse.getFromTag() != null
                && localLastResponse.getToTag() != null
View Full Code Here

        try {
            if (serverTransactionId == null) {
                LOG.info("ServerTransaction is null. Creating new Server transaction");
                serverTransactionId = provider.getNewServerTransaction(notify);
            }
            Dialog dialog = serverTransactionId.getDialog();

            if (dialog != subscriberDialog) {
                forkedDialog = dialog;
            }
            //Dispatch the response along the route
            dispatchExchange(notify.getContent());
           
            // Send back an success response
            Response response = sipSubscriber.getConfiguration().getMessageFactory().createResponse(200, notify);           
            response.addHeader(sipSubscriber.getConfiguration().getContactHeader());
            serverTransactionId.sendResponse(response);

            SubscriptionStateHeader subscriptionState = (SubscriptionStateHeader) notify
                    .getHeader(SubscriptionStateHeader.NAME);

            // Subscription is terminated?
            if (subscriptionState.getState().equalsIgnoreCase(SubscriptionStateHeader.TERMINATED)) {
                LOG.info("Subscription state is terminated. Deleting the current dialog");
                dialog.delete();
            }
        } catch (Exception e) {
            LOG.error("Exception thrown during Notify processing in the SipSubscriptionListener.", e);
        }
    }
View Full Code Here

    if (stackLogger.isLoggingEnabled())
      stackLogger.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
View Full Code Here

      //System.out.println("confirmed OK bekommen");
      CallIdHeader callID = (CallIdHeader) responseEvent.getResponse().getHeader(CallIdHeader.NAME);
      CSeqHeader cseq = (CSeqHeader) responseEvent.getResponse().getHeader(CSeqHeader.NAME);
     
      try{
        Dialog dialog = responseEvent.getClientTransaction().getDialog();
        Request ack = dialog.createAck(cseq.getSeqNumber());

        //System.out.println("Ack sent");
        //System.out.println("ACK sent");
        dialog.sendAck(ack);
        //A sends a BYE
        Request byeRequest = dialog.createRequest(Request.BYE);
        dialog.sendRequest(sipProvider.getNewClientTransaction(byeRequest));
        //System.out.println("BYE sent");
        //System.out.println("Bye sent");
       
      }catch (SipException e) {
        e.printStackTrace();
View Full Code Here

        }

        public void processDialogTerminated(
                DialogTerminatedEvent dialogTerminatedEvent) {
            Dialog d = dialogTerminatedEvent.getDialog();
            System.out.println("Local Party = " + d.getLocalParty());

        }
View Full Code Here

    if (stackLogger.isLoggingEnabled(LogWriter.TRACE_DEBUG))
      stackLogger.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
View Full Code Here

            if(fail != null) return;
            if(q%100==0) System.out.println("Receive " + q + " lastSeq ="+lastSeq);
            q++;
            if ( responseReceivedEvent.getResponse().getStatusCode() == Response.OK) {

              Dialog d = responseReceivedEvent.getDialog();
              try {
                Request ack = d.createAck(1);
                sipProvider.sendRequest(ack);
                sipProvider.sendRequest(ack);
                sipProvider.sendRequest(ack);
                sipProvider.sendRequest(ack);
                sipProvider.sendRequest(ack);
View Full Code Here

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

                // Create the client transaction.
                ClientTransaction inviteTid = sipProvider.getNewClientTransaction(request);
              Dialog d = null;
        try {
          d = sipProvider.getNewDialog(inviteTid);
        } catch (SipException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
View Full Code Here

        if (stackLogger.isLoggingEnabled(LogWriter.TRACE_DEBUG))
            stackLogger.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
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.