williamr@2: /* williamr@2: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Name : sipresolvedclient2.h williamr@2: * Part of : SIP Client Resolver API williamr@2: * Version : 1.0 williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef CSIPRESOLVEDCLIENT2_H williamr@2: #define CSIPRESOLVEDCLIENT2_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CSdpMediaField; williamr@2: williamr@2: // CONSTANTS williamr@2: /** Interface UID of this ECOM interface*/ williamr@2: const TUid KSIPResolvedClient2IFUid = { 0x10282EE5 }; williamr@2: williamr@2: // CLASS DEFINITION williamr@2: /** williamr@2: * @publishedAll williamr@2: * @released williamr@2: * williamr@2: * Interface that SIP stack's clients must realize williamr@2: * in order to be able to receive incoming SIP requests outside SIP dialogs. williamr@2: * Note that channel UIDs must be unique accross all SIP clients williamr@2: * e.g. clients may use UIDs assigned for binaries. williamr@2: * williamr@2: * SIP stack utilizes the plug-ins that implement williamr@2: * this interface in the following manner: williamr@2: * williamr@2: * 1) If the SIP request does not contain Accept-Contact-header(s), go to step 2. williamr@2: * SIP stack calls CSIPResolvedClient2::MatchAcceptContactsL williamr@2: * for all the plug-ins and applies the following logic: williamr@2: * a) None of the clients match -> go to step 2 williamr@2: * b) One client matches -> the SIP request is routed to the matching client williamr@2: * c) Several clients match -> go to step 2 williamr@2: * williamr@2: * 2) If the SIP request does not contain Event-header, go to step 3. williamr@2: * SIP stack calls CSIPResolvedClient2::MatchEventL williamr@2: * for all the plug-ins and applies the following logic: williamr@2: * a) None of the clients match -> go to step 3 williamr@2: * b) One client matches -> the SIP request is routed to the matching client williamr@2: * c) Several clients match -> go to step 3 williamr@2: * williamr@2: * 3) SIP stack calls CSIPResolvedClient2::MatchRequestL for all the plug-ins. williamr@2: * a) None of the clients match -> SIP generates an error response williamr@2: * b) One client matches -> the SIP request is routed to the matching client williamr@2: * c) Several clients match -> williamr@2: * SIP picks one of these clients randomly and routes the request to it. williamr@2: * The ROM-based clients are preferred. williamr@2: */ williamr@2: class CSIPResolvedClient2 : public CBase williamr@2: { williamr@2: public: // Destructor williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: inline ~CSIPResolvedClient2(); williamr@2: williamr@2: public: // Abstract methods williamr@2: williamr@2: /** williamr@2: * Matches the Accept-Contact-headers williamr@2: * to the client(s) represented by this plug-in. williamr@2: * This function is called for an incoming SIP request williamr@2: * if it contains Accept-Contact-header(s). williamr@2: * @param aMethod the method of the SIP request williamr@2: * @param aRequestUri the request-URI of the SIP request williamr@2: * @param aHeaders all the headers in the SIP request williamr@2: * @param aContent SIP request body; williamr@2: * zero-length descriptor if not present williamr@2: * @param aContentType the content-type of the SIP request. williamr@2: * Zero-pointer if body is not present. williamr@2: * @param aClientUid indicates client's UID for williamr@2: * SIP e.g. the one passed as a parameter to CSIP::NewL(). williamr@2: * @return ETrue, if the Accept-Contact-headers match to the client williamr@2: * represented by this plug-in, otherwise EFalse. williamr@2: */ williamr@2: virtual TBool MatchAcceptContactsL( williamr@2: RStringF aMethod, williamr@2: const CUri8& aRequestUri, williamr@2: const RPointerArray& aHeaders, williamr@2: const TDesC8& aContent, williamr@2: const CSIPContentTypeHeader* aContentType, williamr@2: TUid& aClientUid) = 0; williamr@2: williamr@2: /** williamr@2: * Matches the Event-header to the client(s) represented by this plug-in. williamr@2: * This function is called for an incoming SIP request, williamr@2: * if it contains an Event-header and williamr@2: * MatchAcceptContactsL returned EFalse. williamr@2: * @param aMethod the method of the SIP request williamr@2: * @param aRequestUri the request-URI of the SIP request williamr@2: * @param aHeaders all the headers in the SIP request williamr@2: * @param aContent SIP request body; williamr@2: * zero-length descriptor if not present williamr@2: * @param aContentType the content-type of the SIP request. williamr@2: * Zero-pointer if body is not present. williamr@2: * @param aClientUid indicates client's UID for williamr@2: * SIP e.g. the one passed as a parameter to CSIP::NewL(). williamr@2: * @return ETrue, if the Event-header matches to the client williamr@2: * represented by this plug-in, otherwise EFalse. williamr@2: */ williamr@2: virtual TBool MatchEventL( williamr@2: RStringF aMethod, williamr@2: const CUri8& aRequestUri, williamr@2: const RPointerArray& aHeaders, williamr@2: const TDesC8& aContent, williamr@2: const CSIPContentTypeHeader* aContentType, williamr@2: TUid& aClientUid) = 0; williamr@2: williamr@2: /** williamr@2: * Matches the whole SIP request to the client(s) williamr@2: * represented by this plug-in. williamr@2: * This function is called if the SIP request does not contain williamr@2: * Accept- or Event-headers or williamr@2: * MatchAcceptContactsL and MatchEventL returned EFalse. williamr@2: * @param aMethod the method of the SIP request williamr@2: * @param aRequestUri the request-URI of the SIP request williamr@2: * @param aHeaders all the headers in the SIP request williamr@2: * @param aContent SIP request body; williamr@2: * zero-length descriptor if not present williamr@2: * @param aContentType the content-type of the SIP request. williamr@2: * Zero-pointer if body is not present. williamr@2: * @param aClientUid indicates client's UID for williamr@2: * SIP e.g. the one passed as a parameter to CSIP::NewL(). williamr@2: * @return ETrue, if the request can be handled by the client williamr@2: * represented by this plug-in, otherwise EFalse. williamr@2: */ williamr@2: virtual TBool MatchRequestL( williamr@2: RStringF aMethod, williamr@2: const CUri8& aRequestUri, williamr@2: const RPointerArray& aHeaders, williamr@2: const TDesC8& aContent, williamr@2: const CSIPContentTypeHeader* aContentType, williamr@2: TUid& aClientUid) = 0; williamr@2: williamr@2: /** williamr@2: * Indicates whether the plug-in implements CSIPResolvedClient2::ConnectL williamr@2: * and by calling CSIPResolvedClient2::ConnectL williamr@2: * SIP stack is able to force the client to connect to SIP stack. williamr@2: * @return ETrue, if the plug-in supports williamr@2: * CSIPResolvedClient2::ConnectL, otherwise EFalse. williamr@2: */ williamr@2: virtual TBool ConnectSupported() = 0; williamr@2: williamr@2: /** williamr@2: * Requests the client to connect to SIP with williamr@2: * the resolved UID in case there's no client connection with the UID. williamr@2: * @param aClientUid previously resolved client UID williamr@2: */ williamr@2: virtual void ConnectL(const TUid& aClientUid) = 0; williamr@2: williamr@2: /** williamr@2: * Cancels a ConnectL request for a client. williamr@2: * Is called when for example a CANCEL for an INVITE is received williamr@2: * before the client connects to SIP stack. williamr@2: * @param aClientUid a UID for which ConnectL was previously called williamr@2: */ williamr@2: virtual void CancelConnect(const TUid& aClientUid) = 0; williamr@2: williamr@2: /** williamr@2: * Gets all the SIP message content types supported by the client. williamr@2: * @return 0..n SIP Content-Type-headers. williamr@2: * The ownership of the headers is transferred. williamr@2: */ williamr@2: virtual RPointerArray williamr@2: SupportedContentTypesL() = 0; williamr@2: williamr@2: /** williamr@2: * Gets all the SDP media-fields supported by the client. williamr@2: * @return 0..n SDP media-fields describing the client's media support. williamr@2: * The ownership of the media-fields is transferred. williamr@2: */ williamr@2: virtual RPointerArray williamr@2: SupportedSdpMediasL() = 0; williamr@2: williamr@2: williamr@2: /** williamr@2: * Adds client specific SIP-headers for the 200 OK for OPTIONS. williamr@2: * Each plug-in must check that the header to be added williamr@2: * is not yet in the array. For example when adding header williamr@2: * "Allow: INVITE" the client must check that williamr@2: * the header is not already present in the array. williamr@2: * @param aHeaders headers to be added to 200 OK for OPTIONS. williamr@2: * The ownership of the added headers is transferred to the caller. williamr@2: */ williamr@2: virtual void AddClientSpecificHeadersForOptionsResponseL( williamr@2: RPointerArray& aHeaders) = 0; williamr@2: williamr@2: public: // Data williamr@2: williamr@2: /// Unique key for implementations of this interface. williamr@2: TUid iInstanceKey; williamr@2: williamr@2: TUid iImplementationUid; williamr@2: williamr@2: protected: // Constructors: williamr@2: williamr@2: inline CSIPResolvedClient2(); williamr@2: }; williamr@2: williamr@2: #include "sipresolvedclient2.inl" williamr@2: williamr@2: #endif // CSIPRESOLVEDCLIENT2_H