williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
* Name : sipresolvedclient2.h
|
williamr@2
|
16 |
* Part of : SIP Client Resolver API
|
williamr@2
|
17 |
* Version : 1.0
|
williamr@2
|
18 |
*
|
williamr@2
|
19 |
*/
|
williamr@2
|
20 |
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#ifndef CSIPRESOLVEDCLIENT2_H
|
williamr@2
|
24 |
#define CSIPRESOLVEDCLIENT2_H
|
williamr@2
|
25 |
|
williamr@2
|
26 |
// INCLUDES
|
williamr@2
|
27 |
#include <sipacceptcontactheader.h>
|
williamr@2
|
28 |
#include <sipeventheader.h>
|
williamr@2
|
29 |
#include <stringpool.h>
|
williamr@2
|
30 |
#include <uri8.h>
|
williamr@2
|
31 |
#include <sipheaderbase.h>
|
williamr@2
|
32 |
#include <sipcontenttypeheader.h>
|
williamr@2
|
33 |
#include <e32base.h>
|
williamr@2
|
34 |
|
williamr@2
|
35 |
// FORWARD DECLARATIONS
|
williamr@2
|
36 |
class CSdpMediaField;
|
williamr@2
|
37 |
|
williamr@2
|
38 |
// CONSTANTS
|
williamr@2
|
39 |
/** Interface UID of this ECOM interface*/
|
williamr@2
|
40 |
const TUid KSIPResolvedClient2IFUid = { 0x10282EE5 };
|
williamr@2
|
41 |
|
williamr@2
|
42 |
// CLASS DEFINITION
|
williamr@2
|
43 |
/**
|
williamr@2
|
44 |
* @publishedAll
|
williamr@2
|
45 |
* @released
|
williamr@2
|
46 |
*
|
williamr@2
|
47 |
* Interface that SIP stack's clients must realize
|
williamr@2
|
48 |
* in order to be able to receive incoming SIP requests outside SIP dialogs.
|
williamr@2
|
49 |
* Note that channel UIDs must be unique accross all SIP clients
|
williamr@2
|
50 |
* e.g. clients may use UIDs assigned for binaries.
|
williamr@2
|
51 |
*
|
williamr@2
|
52 |
* SIP stack utilizes the plug-ins that implement
|
williamr@2
|
53 |
* this interface in the following manner:
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
* 1) If the SIP request does not contain Accept-Contact-header(s), go to step 2.
|
williamr@2
|
56 |
* SIP stack calls CSIPResolvedClient2::MatchAcceptContactsL
|
williamr@2
|
57 |
* for all the plug-ins and applies the following logic:
|
williamr@2
|
58 |
* a) None of the clients match -> go to step 2
|
williamr@2
|
59 |
* b) One client matches -> the SIP request is routed to the matching client
|
williamr@2
|
60 |
* c) Several clients match -> go to step 2
|
williamr@2
|
61 |
*
|
williamr@2
|
62 |
* 2) If the SIP request does not contain Event-header, go to step 3.
|
williamr@2
|
63 |
* SIP stack calls CSIPResolvedClient2::MatchEventL
|
williamr@2
|
64 |
* for all the plug-ins and applies the following logic:
|
williamr@2
|
65 |
* a) None of the clients match -> go to step 3
|
williamr@2
|
66 |
* b) One client matches -> the SIP request is routed to the matching client
|
williamr@2
|
67 |
* c) Several clients match -> go to step 3
|
williamr@2
|
68 |
*
|
williamr@2
|
69 |
* 3) SIP stack calls CSIPResolvedClient2::MatchRequestL for all the plug-ins.
|
williamr@2
|
70 |
* a) None of the clients match -> SIP generates an error response
|
williamr@2
|
71 |
* b) One client matches -> the SIP request is routed to the matching client
|
williamr@2
|
72 |
* c) Several clients match ->
|
williamr@2
|
73 |
* SIP picks one of these clients randomly and routes the request to it.
|
williamr@2
|
74 |
* The ROM-based clients are preferred.
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
class CSIPResolvedClient2 : public CBase
|
williamr@2
|
77 |
{
|
williamr@2
|
78 |
public: // Destructor
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/**
|
williamr@2
|
81 |
* Destructor
|
williamr@2
|
82 |
*/
|
williamr@2
|
83 |
inline ~CSIPResolvedClient2();
|
williamr@2
|
84 |
|
williamr@2
|
85 |
public: // Abstract methods
|
williamr@2
|
86 |
|
williamr@2
|
87 |
/**
|
williamr@2
|
88 |
* Matches the Accept-Contact-headers
|
williamr@2
|
89 |
* to the client(s) represented by this plug-in.
|
williamr@2
|
90 |
* This function is called for an incoming SIP request
|
williamr@2
|
91 |
* if it contains Accept-Contact-header(s).
|
williamr@2
|
92 |
* @param aMethod the method of the SIP request
|
williamr@2
|
93 |
* @param aRequestUri the request-URI of the SIP request
|
williamr@2
|
94 |
* @param aHeaders all the headers in the SIP request
|
williamr@2
|
95 |
* @param aContent SIP request body;
|
williamr@2
|
96 |
* zero-length descriptor if not present
|
williamr@2
|
97 |
* @param aContentType the content-type of the SIP request.
|
williamr@2
|
98 |
* Zero-pointer if body is not present.
|
williamr@2
|
99 |
* @param aClientUid indicates client's UID for
|
williamr@2
|
100 |
* SIP e.g. the one passed as a parameter to CSIP::NewL().
|
williamr@2
|
101 |
* @return ETrue, if the Accept-Contact-headers match to the client
|
williamr@2
|
102 |
* represented by this plug-in, otherwise EFalse.
|
williamr@2
|
103 |
*/
|
williamr@2
|
104 |
virtual TBool MatchAcceptContactsL(
|
williamr@2
|
105 |
RStringF aMethod,
|
williamr@2
|
106 |
const CUri8& aRequestUri,
|
williamr@2
|
107 |
const RPointerArray<CSIPHeaderBase>& aHeaders,
|
williamr@2
|
108 |
const TDesC8& aContent,
|
williamr@2
|
109 |
const CSIPContentTypeHeader* aContentType,
|
williamr@2
|
110 |
TUid& aClientUid) = 0;
|
williamr@2
|
111 |
|
williamr@2
|
112 |
/**
|
williamr@2
|
113 |
* Matches the Event-header to the client(s) represented by this plug-in.
|
williamr@2
|
114 |
* This function is called for an incoming SIP request,
|
williamr@2
|
115 |
* if it contains an Event-header and
|
williamr@2
|
116 |
* MatchAcceptContactsL returned EFalse.
|
williamr@2
|
117 |
* @param aMethod the method of the SIP request
|
williamr@2
|
118 |
* @param aRequestUri the request-URI of the SIP request
|
williamr@2
|
119 |
* @param aHeaders all the headers in the SIP request
|
williamr@2
|
120 |
* @param aContent SIP request body;
|
williamr@2
|
121 |
* zero-length descriptor if not present
|
williamr@2
|
122 |
* @param aContentType the content-type of the SIP request.
|
williamr@2
|
123 |
* Zero-pointer if body is not present.
|
williamr@2
|
124 |
* @param aClientUid indicates client's UID for
|
williamr@2
|
125 |
* SIP e.g. the one passed as a parameter to CSIP::NewL().
|
williamr@2
|
126 |
* @return ETrue, if the Event-header matches to the client
|
williamr@2
|
127 |
* represented by this plug-in, otherwise EFalse.
|
williamr@2
|
128 |
*/
|
williamr@2
|
129 |
virtual TBool MatchEventL(
|
williamr@2
|
130 |
RStringF aMethod,
|
williamr@2
|
131 |
const CUri8& aRequestUri,
|
williamr@2
|
132 |
const RPointerArray<CSIPHeaderBase>& aHeaders,
|
williamr@2
|
133 |
const TDesC8& aContent,
|
williamr@2
|
134 |
const CSIPContentTypeHeader* aContentType,
|
williamr@2
|
135 |
TUid& aClientUid) = 0;
|
williamr@2
|
136 |
|
williamr@2
|
137 |
/**
|
williamr@2
|
138 |
* Matches the whole SIP request to the client(s)
|
williamr@2
|
139 |
* represented by this plug-in.
|
williamr@2
|
140 |
* This function is called if the SIP request does not contain
|
williamr@2
|
141 |
* Accept- or Event-headers or
|
williamr@2
|
142 |
* MatchAcceptContactsL and MatchEventL returned EFalse.
|
williamr@2
|
143 |
* @param aMethod the method of the SIP request
|
williamr@2
|
144 |
* @param aRequestUri the request-URI of the SIP request
|
williamr@2
|
145 |
* @param aHeaders all the headers in the SIP request
|
williamr@2
|
146 |
* @param aContent SIP request body;
|
williamr@2
|
147 |
* zero-length descriptor if not present
|
williamr@2
|
148 |
* @param aContentType the content-type of the SIP request.
|
williamr@2
|
149 |
* Zero-pointer if body is not present.
|
williamr@2
|
150 |
* @param aClientUid indicates client's UID for
|
williamr@2
|
151 |
* SIP e.g. the one passed as a parameter to CSIP::NewL().
|
williamr@2
|
152 |
* @return ETrue, if the request can be handled by the client
|
williamr@2
|
153 |
* represented by this plug-in, otherwise EFalse.
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
virtual TBool MatchRequestL(
|
williamr@2
|
156 |
RStringF aMethod,
|
williamr@2
|
157 |
const CUri8& aRequestUri,
|
williamr@2
|
158 |
const RPointerArray<CSIPHeaderBase>& aHeaders,
|
williamr@2
|
159 |
const TDesC8& aContent,
|
williamr@2
|
160 |
const CSIPContentTypeHeader* aContentType,
|
williamr@2
|
161 |
TUid& aClientUid) = 0;
|
williamr@2
|
162 |
|
williamr@2
|
163 |
/**
|
williamr@2
|
164 |
* Indicates whether the plug-in implements CSIPResolvedClient2::ConnectL
|
williamr@2
|
165 |
* and by calling CSIPResolvedClient2::ConnectL
|
williamr@2
|
166 |
* SIP stack is able to force the client to connect to SIP stack.
|
williamr@2
|
167 |
* @return ETrue, if the plug-in supports
|
williamr@2
|
168 |
* CSIPResolvedClient2::ConnectL, otherwise EFalse.
|
williamr@2
|
169 |
*/
|
williamr@2
|
170 |
virtual TBool ConnectSupported() = 0;
|
williamr@2
|
171 |
|
williamr@2
|
172 |
/**
|
williamr@2
|
173 |
* Requests the client to connect to SIP with
|
williamr@2
|
174 |
* the resolved UID in case there's no client connection with the UID.
|
williamr@2
|
175 |
* @param aClientUid previously resolved client UID
|
williamr@2
|
176 |
*/
|
williamr@2
|
177 |
virtual void ConnectL(const TUid& aClientUid) = 0;
|
williamr@2
|
178 |
|
williamr@2
|
179 |
/**
|
williamr@2
|
180 |
* Cancels a ConnectL request for a client.
|
williamr@2
|
181 |
* Is called when for example a CANCEL for an INVITE is received
|
williamr@2
|
182 |
* before the client connects to SIP stack.
|
williamr@2
|
183 |
* @param aClientUid a UID for which ConnectL was previously called
|
williamr@2
|
184 |
*/
|
williamr@2
|
185 |
virtual void CancelConnect(const TUid& aClientUid) = 0;
|
williamr@2
|
186 |
|
williamr@2
|
187 |
/**
|
williamr@2
|
188 |
* Gets all the SIP message content types supported by the client.
|
williamr@2
|
189 |
* @return 0..n SIP Content-Type-headers.
|
williamr@2
|
190 |
* The ownership of the headers is transferred.
|
williamr@2
|
191 |
*/
|
williamr@2
|
192 |
virtual RPointerArray<CSIPContentTypeHeader>
|
williamr@2
|
193 |
SupportedContentTypesL() = 0;
|
williamr@2
|
194 |
|
williamr@2
|
195 |
/**
|
williamr@2
|
196 |
* Gets all the SDP media-fields supported by the client.
|
williamr@2
|
197 |
* @return 0..n SDP media-fields describing the client's media support.
|
williamr@2
|
198 |
* The ownership of the media-fields is transferred.
|
williamr@2
|
199 |
*/
|
williamr@2
|
200 |
virtual RPointerArray<CSdpMediaField>
|
williamr@2
|
201 |
SupportedSdpMediasL() = 0;
|
williamr@2
|
202 |
|
williamr@2
|
203 |
|
williamr@2
|
204 |
/**
|
williamr@2
|
205 |
* Adds client specific SIP-headers for the 200 OK for OPTIONS.
|
williamr@2
|
206 |
* Each plug-in must check that the header to be added
|
williamr@2
|
207 |
* is not yet in the array. For example when adding header
|
williamr@2
|
208 |
* "Allow: INVITE" the client must check that
|
williamr@2
|
209 |
* the header is not already present in the array.
|
williamr@2
|
210 |
* @param aHeaders headers to be added to 200 OK for OPTIONS.
|
williamr@2
|
211 |
* The ownership of the added headers is transferred to the caller.
|
williamr@2
|
212 |
*/
|
williamr@2
|
213 |
virtual void AddClientSpecificHeadersForOptionsResponseL(
|
williamr@2
|
214 |
RPointerArray<CSIPHeaderBase>& aHeaders) = 0;
|
williamr@2
|
215 |
|
williamr@2
|
216 |
public: // Data
|
williamr@2
|
217 |
|
williamr@2
|
218 |
/// Unique key for implementations of this interface.
|
williamr@2
|
219 |
TUid iInstanceKey;
|
williamr@2
|
220 |
|
williamr@2
|
221 |
TUid iImplementationUid;
|
williamr@2
|
222 |
|
williamr@2
|
223 |
protected: // Constructors:
|
williamr@2
|
224 |
|
williamr@2
|
225 |
inline CSIPResolvedClient2();
|
williamr@2
|
226 |
};
|
williamr@2
|
227 |
|
williamr@2
|
228 |
#include "sipresolvedclient2.inl"
|
williamr@2
|
229 |
|
williamr@2
|
230 |
#endif // CSIPRESOLVEDCLIENT2_H
|