mmsharing/mmshavailability/inc/musavasipdefaulthandler.h
changeset 0 f0cf47e981f9
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     1 /*
       
     2 * Copyright (c) 2006 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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MUSAVASIPDEFAULTHANDLER_H
       
    20 #define MUSAVASIPDEFAULTHANDLER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "musavasipconnectionadapter.h"
       
    24 #include "sipconnection.h"
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <sipinvitedialogassoc.h>
       
    28 #include <sipservertransaction.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 CMusAvaSipDefaultHandler : public CBase,
       
    55                                  public MMusAvaSipConnectionAdapter
       
    56     {
       
    57     public:
       
    58         /**
       
    59         * A SIP request outside a dialog has been received from the network.
       
    60         *
       
    61         * @pre aTransaction != 0
       
    62         * @param aTransaction SIP server transaction. The ownership is
       
    63         *   transferred.
       
    64         */
       
    65         virtual TInt IncomingRequest (CSIPServerTransaction*
       
    66                                       aTransaction)
       
    67             {
       
    68             delete aTransaction;
       
    69             return KErrNone;
       
    70             }
       
    71 
       
    72         /**
       
    73         * A SIP request within a dialog has been received from the network.
       
    74         * The client must resolve the actual dialog association to which
       
    75         * this request belongs.
       
    76         *
       
    77         * @pre aTransaction != 0
       
    78         * @param aTransaction SIP server transaction. The ownership is
       
    79         *   transferred.
       
    80         * @param aDialog the dialog that this transaction belongs to.
       
    81         */
       
    82         virtual TInt IncomingRequest (CSIPServerTransaction* aTransaction,
       
    83                                       CSIPDialog& /*aDialog*/)
       
    84             {
       
    85             delete aTransaction;
       
    86             return KErrNone;
       
    87             }
       
    88 
       
    89         /**
       
    90         * A SIP response received from the network.
       
    91         *
       
    92         * @param aTransaction contains response elements.
       
    93         */
       
    94         virtual TInt IncomingResponse (CSIPClientTransaction&
       
    95                                        /*aTransaction*/) { return KErrNone; }
       
    96 
       
    97         /**
       
    98         * A SIP response received from the network that is within a dialog
       
    99         * association or creates a dialog association.
       
   100         *
       
   101         * @param aTransaction contains response elements.
       
   102         * @param aDialogAssoc a dialog association.
       
   103         */
       
   104         virtual TInt IncomingResponse (
       
   105                     CSIPClientTransaction& /*aTransaction*/,
       
   106                     CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNone; }
       
   107 
       
   108         /**
       
   109         * Multiple SIP responses have been received to the single INVITE due
       
   110         * to the forking proxy. Note that each response creates a separate
       
   111         * INVITE dialog association.
       
   112         * Multiple responses can arrive until SIP stack completes UAC core
       
   113         * INVITE transaction.
       
   114         * If clients deletes INVITE transaction after first SIP response
       
   115         * other possible responses will be consumed by the implementation.
       
   116         *
       
   117         * @param aTransaction contains response elements
       
   118         * @param aDialogAssoc INVITE dialog association; the ownership is
       
   119         *        transferred
       
   120         */
       
   121         virtual TInt IncomingResponse (
       
   122                     CSIPClientTransaction& /*aTransaction*/,
       
   123                     CSIPInviteDialogAssoc* aDialogAssoc)
       
   124             {
       
   125             delete aDialogAssoc;
       
   126             return KErrNone;
       
   127             }
       
   128 
       
   129         /**
       
   130         * A SIP response related a registration binding or an error response
       
   131         * that is related to registration binding has been received
       
   132         * from the network.
       
   133         *
       
   134         * @param aTransaction contains response elements
       
   135         * @param aRegistration registration binding this transaction belongs to
       
   136         */
       
   137         virtual TInt
       
   138             IncomingResponse (CSIPClientTransaction& /*aTransaction*/,
       
   139                               CSIPRegistrationBinding& /*aRegistration*/) { return KErrNone; }
       
   140 
       
   141         /**
       
   142         * An asynchronous error has occurred in the stack related to the
       
   143         * request indicated by the given transaction.
       
   144         *
       
   145         * @param aError system wide or SIP error code
       
   146         * @param aTransaction failed transaction
       
   147         * @param aSIPConnection a SIP connection
       
   148         */
       
   149         virtual TInt ErrorOccured (TInt /*aError*/,
       
   150                                    CSIPTransactionBase& /*aTransaction*/) { return KErrNone; }
       
   151 
       
   152         /**
       
   153         * An asynchronous error has occurred in the stack related
       
   154         * to the request indicated by the given transaction.
       
   155         *
       
   156         * @param aError system wide or SIP error code
       
   157         * @param aTransaction the failed transaction
       
   158         * @param aRegistration the failed registration binding
       
   159         */
       
   160         virtual TInt ErrorOccured (TInt /*aError*/,
       
   161                                    CSIPClientTransaction& /*aTransaction*/,
       
   162                                    CSIPRegistrationBinding& /*aRegistration*/) { return KErrNone; }
       
   163 
       
   164         /**
       
   165         * An asynchronous error has occured related to a request within
       
   166         * an existing dialog.
       
   167         *
       
   168         * @param aError system wide or SIP error code
       
   169         * @param aTransaction the failed transaction.
       
   170         * @param aDialogAssoc the failed dialog associoation.
       
   171         */
       
   172         virtual TInt ErrorOccured (
       
   173                     TInt /*aError*/,
       
   174                     CSIPTransactionBase& /*aTransaction*/,
       
   175                     CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNone; }
       
   176 
       
   177         /**
       
   178         * An asynchronous error has occured related to a refresh
       
   179         *
       
   180         * @param aError system wide or SIP error code
       
   181         * @param aSIPRefresh original refresh object.
       
   182         */
       
   183         virtual TInt ErrorOccured (TInt /*aError*/, CSIPRefresh& /*aSIPRefresh*/) { return KErrNone; }
       
   184 
       
   185         /**
       
   186         * An asynchronous error has occured related to a periodical refresh
       
   187         * that relates to a registration.
       
   188         *
       
   189         * @param aError system wide or SIP error code;
       
   190         *        KErrCouldNotConnect if the refresh has failed
       
   191         *        due to the suspended connection.
       
   192         * @param aRegistration associated registration binding
       
   193         */
       
   194         virtual TInt ErrorOccured (TInt /*aError*/,
       
   195                                    CSIPRegistrationBinding& /*aRegistration*/) { return KErrNone; }
       
   196 
       
   197         /**
       
   198         * An asynchronous error has occured related to a periodical refresh
       
   199         * that belongs to SIP dialog association.
       
   200         *
       
   201         * @param aError system wide or SIP error code;
       
   202         *        KErrCouldNotConnect if the refresh has failed
       
   203         *        due to the suspended connection.
       
   204         * @param aDialogAssoc SIP dialog association.
       
   205         */
       
   206         virtual TInt ErrorOccured (TInt /*aError*/,
       
   207                                    CSIPDialogAssocBase& /*aDialogAssoc*/) { return KErrNone; }
       
   208 
       
   209         /**
       
   210         * SIP stack has completed UAC core INVITE transaction 64*T1 seconds
       
   211         * after the reception of the first 2xx response. No more 2xx responses
       
   212         * can be received to the issued single INVITE.
       
   213         *
       
   214         * If the INVITE transaction does not create a dialog, or the INVITE
       
   215         * transaction encounters an error, this event will not be sent.
       
   216         *
       
   217         * @param aTransaction a complete UAC core INVITE transaction
       
   218         */
       
   219         virtual TInt InviteCompleted (CSIPClientTransaction& /*aTransaction*/) { return KErrNone; }
       
   220 
       
   221         /**
       
   222         * Invite was canceled with the CANCEL
       
   223         * @param aTransaction a canceled INVITE UAS transaction
       
   224         */
       
   225         virtual TInt InviteCanceled (CSIPServerTransaction& /*aTransaction*/) { return KErrNone; }
       
   226 
       
   227         /**
       
   228         * Connection state has changed.
       
   229         * If connection state has changed to EInactive or EUnavailable,
       
   230         * SIP stack has removed all stand-alone SIP refreshes, registrations
       
   231         * and dialog associations that client requested to refresh. Client may
       
   232         * re-issue refresh requests (stand-alone, registration or dialog
       
   233         * association related) when connection becomes EActive again.
       
   234         * SIP stack also terminates all pending SIP client transactions and no
       
   235         * errors are reported back to the client about the terminated
       
   236         * transactions nor about removed refreshes in order to avoid event
       
   237         * flood.
       
   238         *
       
   239         * @param aState indicates the current connection state
       
   240         */
       
   241         virtual TInt ConnectionStateChanged (CSIPConnection::TState /*aState*/) { return KErrNone; }
       
   242     };
       
   243 
       
   244 #endif // MUSAVASIPDEFAULTHANDLER_H