Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  * Conditions Of Use 
  
  * This software was developed by employees of the National Institute of
  * Standards and Technology (NIST), an agency of the Federal Government.
  * Pursuant to title 15 Untied States Code Section 105, works of NIST
  * employees are not subject to copyright protection in the United States
  * and are considered to be in the public domain.  As a result, a formal
  * license is not needed to use the software.
 
 * This software is provided by NIST as a service and is expressly
 * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
 * AND DATA ACCURACY.  NIST does not warrant or make any representations
 * regarding the use of the software or the results thereof, including but
 * not limited to the correctness, accuracy, reliability or usefulness of
 * the software.
 
 * Permission to use this software is contingent upon your acceptance
 * of the terms of this agreement
 *  
 * .
 
 */
Product of NIST/ITL Advanced Networking Technologies Division (ANTD). * /
 
 
 package gov.nist.javax.sip;
 
 import javax.sip.*;

Implements all the support classes that are necessary for the nist-sip stack on which the jain-sip stack has been based. This is a mapping class to map from the NIST-SIP abstractions to the JAIN abstractions. (i.e. It is the glue code that ties the NIST-SIP event model and the JAIN-SIP event model together. When a SIP Request or SIP Response is read from the corresponding messageChannel, the NIST-SIP stack calls the SIPStackMessageFactory implementation that has been registered with it to process the request.)

Author(s):
M. Ranganathan
Version:
1.2 $Revision: 1.15.2.1 $ $Date: 2010/11/23 19:23:11 $
 
 
     private SIPTransactionStack sipStack;

    
Construct a new SIP Server Request.

Parameters:
sipRequest is the SIPRequest from which the SIPServerRequest is to be constructed.
messageChannel is the MessageChannel abstraction for this SIPServerRequest.
 
             MessageChannel messageChannel) {
 
         if (messageChannel == null || sipRequest == null) {
             throw new IllegalArgumentException("Null Arg!");
         }
 
         SIPTransactionStack theStack = (SIPTransactionStackmessageChannel.getSIPStack();
         DialogFilter retval = new DialogFilter(
                 theStack);
         if (messageChannel instanceof SIPTransaction) {
             // If the transaction has already been created
             // then set the transaction channel.
             retval.transactionChannel = (SIPTransactionmessageChannel;
         }
         retval.listeningPoint = messageChannel.getMessageProcessor()
                 .getListeningPoint();
         if (retval.listeningPoint == null)
             return null;
             .getStackLogger().logDebug(
                     "Returning request interface for "
                             + sipRequest.getFirstLine() + " " + retval
                             + " messageChannel = " + messageChannel);
         return retval;
     }

    
Generate a new server response for the stack.

Parameters:
sipResponse is the SIPRequest from which the SIPServerRequest is to be constructed.
messageChannel is the MessageChannel abstraction for this SIPServerResponse
            SIPResponse sipResponseMessageChannel messageChannel) {
        SIPTransactionStack theStack = (SIPTransactionStackmessageChannel
                .getSIPStack();
        // Tr is null if a transaction is not mapped.
        SIPTransaction tr = (SIPTransaction) ((SIPTransactionStacktheStack)
                .findTransaction(sipResponsefalse);
            .getStackLogger().logDebug(
                    "Found Transaction " + tr + " for " + sipResponse);
        if (tr != null) {
            // Prune unhealthy responses early if handling statefully.
            // If the state has not yet been assigned then this is a
            // spurious response. This was moved up from the transaction
            // layer for efficiency.
            if (tr.getState() == null) {
                if (.isLoggingEnabled(.))
                    .getStackLogger().logDebug(
                            "Dropping response - null transaction state");
                return null;
                // Ignore 1xx
            } else if (. == tr.getState()
                    && sipResponse.getStatusCode() / 100 == 1) {
                if (.isLoggingEnabled(.))
                    .getStackLogger().logDebug(
                            "Dropping response - late arriving "
                                    + sipResponse.getStatusCode());
                return null;
            }
        }
        DialogFilter retval = new DialogFilter(
                );
        retval.transactionChannel = tr;
        retval.listeningPoint = messageChannel.getMessageProcessor()
                .getListeningPoint();
        return retval;
    }
    public NistSipMessageFactoryImpl(SIPTransactionStack sipStackImpl) {
        this. = sipStackImpl;
    }
New to GrepCode? Check out our FAQ X