1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/sipresolvedclient2.h Wed Mar 31 12:27:01 2010 +0100
1.3 @@ -0,0 +1,230 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* 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
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Name : sipresolvedclient2.h
1.19 +* Part of : SIP Client Resolver API
1.20 +* Version : 1.0
1.21 +*
1.22 +*/
1.23 +
1.24 +
1.25 +
1.26 +#ifndef CSIPRESOLVEDCLIENT2_H
1.27 +#define CSIPRESOLVEDCLIENT2_H
1.28 +
1.29 +// INCLUDES
1.30 +#include <sipacceptcontactheader.h>
1.31 +#include <sipeventheader.h>
1.32 +#include <stringpool.h>
1.33 +#include <uri8.h>
1.34 +#include <sipheaderbase.h>
1.35 +#include <sipcontenttypeheader.h>
1.36 +#include <e32base.h>
1.37 +
1.38 +// FORWARD DECLARATIONS
1.39 +class CSdpMediaField;
1.40 +
1.41 +// CONSTANTS
1.42 +/** Interface UID of this ECOM interface*/
1.43 +const TUid KSIPResolvedClient2IFUid = { 0x10282EE5 };
1.44 +
1.45 +// CLASS DEFINITION
1.46 +/**
1.47 +* @publishedAll
1.48 +* @released
1.49 +*
1.50 +* Interface that SIP stack's clients must realize
1.51 +* in order to be able to receive incoming SIP requests outside SIP dialogs.
1.52 +* Note that channel UIDs must be unique accross all SIP clients
1.53 +* e.g. clients may use UIDs assigned for binaries.
1.54 +*
1.55 +* SIP stack utilizes the plug-ins that implement
1.56 +* this interface in the following manner:
1.57 +*
1.58 +* 1) If the SIP request does not contain Accept-Contact-header(s), go to step 2.
1.59 +* SIP stack calls CSIPResolvedClient2::MatchAcceptContactsL
1.60 +* for all the plug-ins and applies the following logic:
1.61 +* a) None of the clients match -> go to step 2
1.62 +* b) One client matches -> the SIP request is routed to the matching client
1.63 +* c) Several clients match -> go to step 2
1.64 +*
1.65 +* 2) If the SIP request does not contain Event-header, go to step 3.
1.66 +* SIP stack calls CSIPResolvedClient2::MatchEventL
1.67 +* for all the plug-ins and applies the following logic:
1.68 +* a) None of the clients match -> go to step 3
1.69 +* b) One client matches -> the SIP request is routed to the matching client
1.70 +* c) Several clients match -> go to step 3
1.71 +*
1.72 +* 3) SIP stack calls CSIPResolvedClient2::MatchRequestL for all the plug-ins.
1.73 +* a) None of the clients match -> SIP generates an error response
1.74 +* b) One client matches -> the SIP request is routed to the matching client
1.75 +* c) Several clients match ->
1.76 +* SIP picks one of these clients randomly and routes the request to it.
1.77 +* The ROM-based clients are preferred.
1.78 +*/
1.79 +class CSIPResolvedClient2 : public CBase
1.80 + {
1.81 + public: // Destructor
1.82 +
1.83 + /**
1.84 + * Destructor
1.85 + */
1.86 + inline ~CSIPResolvedClient2();
1.87 +
1.88 + public: // Abstract methods
1.89 +
1.90 + /**
1.91 + * Matches the Accept-Contact-headers
1.92 + * to the client(s) represented by this plug-in.
1.93 + * This function is called for an incoming SIP request
1.94 + * if it contains Accept-Contact-header(s).
1.95 + * @param aMethod the method of the SIP request
1.96 + * @param aRequestUri the request-URI of the SIP request
1.97 + * @param aHeaders all the headers in the SIP request
1.98 + * @param aContent SIP request body;
1.99 + * zero-length descriptor if not present
1.100 + * @param aContentType the content-type of the SIP request.
1.101 + * Zero-pointer if body is not present.
1.102 + * @param aClientUid indicates client's UID for
1.103 + * SIP e.g. the one passed as a parameter to CSIP::NewL().
1.104 + * @return ETrue, if the Accept-Contact-headers match to the client
1.105 + * represented by this plug-in, otherwise EFalse.
1.106 + */
1.107 + virtual TBool MatchAcceptContactsL(
1.108 + RStringF aMethod,
1.109 + const CUri8& aRequestUri,
1.110 + const RPointerArray<CSIPHeaderBase>& aHeaders,
1.111 + const TDesC8& aContent,
1.112 + const CSIPContentTypeHeader* aContentType,
1.113 + TUid& aClientUid) = 0;
1.114 +
1.115 + /**
1.116 + * Matches the Event-header to the client(s) represented by this plug-in.
1.117 + * This function is called for an incoming SIP request,
1.118 + * if it contains an Event-header and
1.119 + * MatchAcceptContactsL returned EFalse.
1.120 + * @param aMethod the method of the SIP request
1.121 + * @param aRequestUri the request-URI of the SIP request
1.122 + * @param aHeaders all the headers in the SIP request
1.123 + * @param aContent SIP request body;
1.124 + * zero-length descriptor if not present
1.125 + * @param aContentType the content-type of the SIP request.
1.126 + * Zero-pointer if body is not present.
1.127 + * @param aClientUid indicates client's UID for
1.128 + * SIP e.g. the one passed as a parameter to CSIP::NewL().
1.129 + * @return ETrue, if the Event-header matches to the client
1.130 + * represented by this plug-in, otherwise EFalse.
1.131 + */
1.132 + virtual TBool MatchEventL(
1.133 + RStringF aMethod,
1.134 + const CUri8& aRequestUri,
1.135 + const RPointerArray<CSIPHeaderBase>& aHeaders,
1.136 + const TDesC8& aContent,
1.137 + const CSIPContentTypeHeader* aContentType,
1.138 + TUid& aClientUid) = 0;
1.139 +
1.140 + /**
1.141 + * Matches the whole SIP request to the client(s)
1.142 + * represented by this plug-in.
1.143 + * This function is called if the SIP request does not contain
1.144 + * Accept- or Event-headers or
1.145 + * MatchAcceptContactsL and MatchEventL returned EFalse.
1.146 + * @param aMethod the method of the SIP request
1.147 + * @param aRequestUri the request-URI of the SIP request
1.148 + * @param aHeaders all the headers in the SIP request
1.149 + * @param aContent SIP request body;
1.150 + * zero-length descriptor if not present
1.151 + * @param aContentType the content-type of the SIP request.
1.152 + * Zero-pointer if body is not present.
1.153 + * @param aClientUid indicates client's UID for
1.154 + * SIP e.g. the one passed as a parameter to CSIP::NewL().
1.155 + * @return ETrue, if the request can be handled by the client
1.156 + * represented by this plug-in, otherwise EFalse.
1.157 + */
1.158 + virtual TBool MatchRequestL(
1.159 + RStringF aMethod,
1.160 + const CUri8& aRequestUri,
1.161 + const RPointerArray<CSIPHeaderBase>& aHeaders,
1.162 + const TDesC8& aContent,
1.163 + const CSIPContentTypeHeader* aContentType,
1.164 + TUid& aClientUid) = 0;
1.165 +
1.166 + /**
1.167 + * Indicates whether the plug-in implements CSIPResolvedClient2::ConnectL
1.168 + * and by calling CSIPResolvedClient2::ConnectL
1.169 + * SIP stack is able to force the client to connect to SIP stack.
1.170 + * @return ETrue, if the plug-in supports
1.171 + * CSIPResolvedClient2::ConnectL, otherwise EFalse.
1.172 + */
1.173 + virtual TBool ConnectSupported() = 0;
1.174 +
1.175 + /**
1.176 + * Requests the client to connect to SIP with
1.177 + * the resolved UID in case there's no client connection with the UID.
1.178 + * @param aClientUid previously resolved client UID
1.179 + */
1.180 + virtual void ConnectL(const TUid& aClientUid) = 0;
1.181 +
1.182 + /**
1.183 + * Cancels a ConnectL request for a client.
1.184 + * Is called when for example a CANCEL for an INVITE is received
1.185 + * before the client connects to SIP stack.
1.186 + * @param aClientUid a UID for which ConnectL was previously called
1.187 + */
1.188 + virtual void CancelConnect(const TUid& aClientUid) = 0;
1.189 +
1.190 + /**
1.191 + * Gets all the SIP message content types supported by the client.
1.192 + * @return 0..n SIP Content-Type-headers.
1.193 + * The ownership of the headers is transferred.
1.194 + */
1.195 + virtual RPointerArray<CSIPContentTypeHeader>
1.196 + SupportedContentTypesL() = 0;
1.197 +
1.198 + /**
1.199 + * Gets all the SDP media-fields supported by the client.
1.200 + * @return 0..n SDP media-fields describing the client's media support.
1.201 + * The ownership of the media-fields is transferred.
1.202 + */
1.203 + virtual RPointerArray<CSdpMediaField>
1.204 + SupportedSdpMediasL() = 0;
1.205 +
1.206 +
1.207 + /**
1.208 + * Adds client specific SIP-headers for the 200 OK for OPTIONS.
1.209 + * Each plug-in must check that the header to be added
1.210 + * is not yet in the array. For example when adding header
1.211 + * "Allow: INVITE" the client must check that
1.212 + * the header is not already present in the array.
1.213 + * @param aHeaders headers to be added to 200 OK for OPTIONS.
1.214 + * The ownership of the added headers is transferred to the caller.
1.215 + */
1.216 + virtual void AddClientSpecificHeadersForOptionsResponseL(
1.217 + RPointerArray<CSIPHeaderBase>& aHeaders) = 0;
1.218 +
1.219 + public: // Data
1.220 +
1.221 + /// Unique key for implementations of this interface.
1.222 + TUid iInstanceKey;
1.223 +
1.224 + TUid iImplementationUid;
1.225 +
1.226 + protected: // Constructors:
1.227 +
1.228 + inline CSIPResolvedClient2();
1.229 + };
1.230 +
1.231 +#include "sipresolvedclient2.inl"
1.232 +
1.233 +#endif // CSIPRESOLVEDCLIENT2_H