epoc32/include/mw/sipconnectionobserver.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/sipconnectionobserver.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 /*
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 * Name        : sipconnectionobserver.h
    16 * Part of     : SIP Client
    17 * Interface   : SDK API, SIP Client API
    18 * Version     : 1.0
    19 *
    20 */
    21 
    22 
    23 
    24 #ifndef MSIPCONNECTIONOBSERVER_H
    25 #define MSIPCONNECTIONOBSERVER_H
    26 
    27 //  INCLUDES
    28 #include "sipconnection.h"
    29 
    30 // FORWARD DECLARATIONS
    31 class CSIPDialogAssocBase;
    32 class CSIPInviteDialogAssoc;
    33 class CSIPRegistrationBinding;
    34 class CSIPDialog;
    35 class CSIPTransactionBase;
    36 class CSIPServerTransaction;
    37 
    38 // CLASS DECLARATION
    39 
    40 /**
    41 *  @publishedAll
    42 *  @released
    43 *
    44 *  An interface to be implemented by users of CSIPConnection.
    45 *  Interface allows to be able to receive requests, responses, connection state
    46 *  notifications and error notifications from sip stack.
    47 *
    48 *  Note: The client must not delete related CSIPConnection object 
    49 *  during the execution of the interface function.
    50 *
    51 *  @lib n/a
    52 */
    53 
    54 class MSIPConnectionObserver
    55 	{    	
    56     public:
    57 		/**
    58 		* A SIP request outside a dialog has been received from the network.
    59         *
    60         * @pre aTransaction != 0
    61 		* @param aTransaction SIP server transaction. The ownership is
    62         *   transferred.
    63         */
    64 		virtual void IncomingRequest (CSIPServerTransaction*
    65 									  aTransaction) = 0;
    66 
    67 		/**
    68 		* A SIP request within a dialog has been received from the network.
    69 		* The client must resolve the actual dialog association to which
    70 		* this request belongs.
    71 		*
    72         * @pre aTransaction != 0
    73 		* @param aTransaction SIP server transaction. The ownership is
    74         *   transferred.
    75 		* @param aDialog the dialog that this transaction belongs to.        
    76 		*/
    77 		virtual void IncomingRequest (CSIPServerTransaction* aTransaction,
    78 					                  CSIPDialog& aDialog) = 0;
    79 
    80 		/**
    81 		* A SIP response received from the network.
    82 		*
    83 		* @param aTransaction contains response elements.
    84 		*/
    85 		virtual void IncomingResponse (CSIPClientTransaction&
    86                                        aTransaction) = 0;
    87 
    88 		/**
    89 		* A SIP response received from the network that is within a dialog
    90 		* association or creates a dialog association.
    91 		*
    92 		* @param aTransaction contains response elements.
    93 		* @param aDialogAssoc a dialog association.        
    94 		*/		
    95 		virtual void IncomingResponse (
    96 					CSIPClientTransaction& aTransaction,
    97 					CSIPDialogAssocBase& aDialogAssoc) = 0;
    98 
    99         /**
   100 		* Multiple SIP responses have been received to the single INVITE due
   101 		* to the forking proxy. Note that each response creates a separate
   102 		* INVITE dialog association.
   103         * Multiple responses can arrive until SIP stack completes UAC core
   104 		* INVITE transaction.
   105         * If clients deletes INVITE transaction after first SIP response
   106 		* other possible responses will be consumed by the implementation.
   107 		* 
   108 		* @param aTransaction contains response elements
   109 		* @param aDialogAssoc INVITE dialog association; the ownership is 
   110 		*        transferred
   111 		*/
   112 		virtual void IncomingResponse (
   113 					CSIPClientTransaction& aTransaction,
   114 					CSIPInviteDialogAssoc* aDialogAssoc) = 0;
   115 
   116 		/**
   117 		* A SIP response related a registration binding or an error response
   118 		* that is related to registration binding has been received
   119         * from the network.
   120         *
   121 		* @param aTransaction contains response elements
   122 		* @param aRegistration registration binding this transaction belongs to
   123 		*/
   124 		virtual void
   125 			IncomingResponse (CSIPClientTransaction& aTransaction,
   126                               CSIPRegistrationBinding& aRegistration) = 0;
   127 
   128  		/**
   129 		* An asynchronous error has occurred in the stack related to the
   130 		* request indicated by the given transaction.
   131 		*
   132 		* @param aError system wide or SIP error code
   133 		* @param aTransaction failed transaction
   134 		* @param aSIPConnection a SIP connection        
   135 		*/
   136 		virtual void ErrorOccured (TInt aError,
   137                                    CSIPTransactionBase& aTransaction) = 0;
   138 
   139 		/**
   140 		* An asynchronous error has occurred in the stack related
   141 		* to the request indicated by the given transaction.
   142         *
   143 		* @param aError system wide or SIP error code
   144 		* @param aTransaction the failed transaction
   145 		* @param aRegistration the failed registration binding
   146 		*/
   147 		virtual void ErrorOccured (TInt aError,
   148 				                   CSIPClientTransaction& aTransaction,
   149 					               CSIPRegistrationBinding& aRegistration) = 0;
   150 
   151 		/**
   152 		* An asynchronous error has occured related to a request within
   153 		* an existing dialog.
   154         *
   155 		* @param aError system wide or SIP error code
   156 		* @param aTransaction the failed transaction.
   157 		* @param aDialogAssoc the failed dialog associoation.        
   158 		*/
   159 		virtual void ErrorOccured (
   160 					TInt aError,
   161 				    CSIPTransactionBase& aTransaction,
   162 					CSIPDialogAssocBase& aDialogAssoc) = 0;
   163 
   164 		/**
   165 		* An asynchronous error has occured related to a refresh 
   166         *
   167 		* @param aError system wide or SIP error code
   168 		* @param aSIPRefresh original refresh object.        
   169 		*/
   170 		virtual void ErrorOccured (TInt aError, CSIPRefresh& aSIPRefresh) = 0;
   171 
   172 		/**
   173 		* An asynchronous error has occured related to a periodical refresh
   174         * that relates to a registration.
   175         *
   176 		* @param aError system wide or SIP error code; 
   177 		*		 KErrCouldNotConnect if the refresh has failed
   178 		*		 due to the suspended connection.
   179 		* @param aRegistration associated registration binding
   180 		*/
   181 		virtual void ErrorOccured (TInt aError,					
   182 					               CSIPRegistrationBinding& aRegistration) = 0;
   183 
   184 		/**
   185 		* An asynchronous error has occured related to a periodical refresh
   186         * that belongs to SIP dialog association.
   187         *
   188 		* @param aError system wide or SIP error code; 
   189 		*        KErrCouldNotConnect if the refresh has failed
   190 		*		 due to the suspended connection.
   191 		* @param aDialogAssoc SIP dialog association.        
   192 		*/
   193 		virtual void ErrorOccured (TInt aError,			
   194 					               CSIPDialogAssocBase& aDialogAssoc) = 0;
   195 
   196         /**
   197 		* SIP stack has completed UAC core INVITE transaction 64*T1 seconds
   198         * after the reception of the first 2xx response. No more 2xx responses
   199         * can be received to the issued single INVITE.
   200         *
   201         * If the INVITE transaction does not create a dialog, or the INVITE
   202         * transaction encounters an error, this event will not be sent.
   203         *
   204 		* @param aTransaction a complete UAC core INVITE transaction
   205 		*/
   206         virtual void InviteCompleted (CSIPClientTransaction& aTransaction) = 0;
   207 
   208 		/**
   209         * Invite was canceled with the CANCEL
   210         * @param aTransaction a canceled INVITE UAS transaction
   211         */
   212         virtual void InviteCanceled (CSIPServerTransaction& aTransaction) = 0;
   213                 
   214 		/**
   215 		* Connection state has changed.
   216         * If connection state has changed to EInactive or EUnavailable,
   217 		* SIP stack has removed all stand-alone SIP refreshes, registrations 
   218 		* and dialog associations that client requested to refresh. Client may
   219 		* re-issue refresh requests (stand-alone, registration or dialog 
   220 		* association related) when connection becomes EActive again.
   221 		* SIP stack also terminates all pending SIP client transactions and no
   222         * errors are reported back to the client about the terminated
   223         * transactions nor about removed refreshes in order to avoid event
   224         * flood.
   225 		* 
   226 		* @param aState indicates the current connection state        
   227 		*/
   228 		virtual void ConnectionStateChanged (CSIPConnection::TState aState) = 0;
   229 	};
   230 
   231 #endif