williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2005-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 : sipdialogassocbase.h
|
williamr@2
|
16 |
* Part of : SIP Client
|
williamr@2
|
17 |
* Interface : SDK API, SIP Client API
|
williamr@2
|
18 |
* Version : 1.0
|
williamr@2
|
19 |
*
|
williamr@2
|
20 |
*/
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#ifndef CSIPDIALOGASSOCBASE_H
|
williamr@2
|
25 |
#define CSIPDIALOGASSOCBASE_H
|
williamr@2
|
26 |
|
williamr@2
|
27 |
// INCLUDES
|
williamr@2
|
28 |
#include <stringpool.h>
|
williamr@2
|
29 |
|
williamr@2
|
30 |
// FORWARD DECLARATIONS
|
williamr@2
|
31 |
class CSIPMessageElements;
|
williamr@2
|
32 |
class CSIPClientTransaction;
|
williamr@2
|
33 |
class CSIPDialog;
|
williamr@2
|
34 |
class CSIPRefresh;
|
williamr@2
|
35 |
class CSIPServerTransaction;
|
williamr@2
|
36 |
class CSIPDialogAssocImplementation;
|
williamr@2
|
37 |
|
williamr@2
|
38 |
// CLASS DECLARATION
|
williamr@2
|
39 |
|
williamr@2
|
40 |
/**
|
williamr@2
|
41 |
* @publishedAll
|
williamr@2
|
42 |
* @released
|
williamr@2
|
43 |
*
|
williamr@2
|
44 |
* Base class for SIP dialog associations. It provides services for getting
|
williamr@2
|
45 |
* associated SIP dialog, actual dialog association type and for sending non
|
williamr@2
|
46 |
* target refresh requests within the dialog association.
|
williamr@2
|
47 |
* @lib sipclient
|
williamr@2
|
48 |
*/
|
williamr@2
|
49 |
class CSIPDialogAssocBase : public CBase
|
williamr@2
|
50 |
{
|
williamr@2
|
51 |
public: // Destructor
|
williamr@2
|
52 |
|
williamr@2
|
53 |
/**
|
williamr@2
|
54 |
* Destructor
|
williamr@2
|
55 |
* @internalComponent
|
williamr@2
|
56 |
*/
|
williamr@2
|
57 |
virtual ~CSIPDialogAssocBase();
|
williamr@2
|
58 |
|
williamr@2
|
59 |
public: // New functions
|
williamr@2
|
60 |
|
williamr@2
|
61 |
/**
|
williamr@2
|
62 |
* Gets the dialog this dialog association belongs to
|
williamr@2
|
63 |
* @return associated dialog
|
williamr@2
|
64 |
*/
|
williamr@2
|
65 |
IMPORT_C const CSIPDialog& Dialog() const;
|
williamr@2
|
66 |
|
williamr@2
|
67 |
/**
|
williamr@2
|
68 |
* Gets dialog this dialog association belongs to
|
williamr@2
|
69 |
* @return associated dialog
|
williamr@2
|
70 |
*/
|
williamr@2
|
71 |
IMPORT_C CSIPDialog& Dialog();
|
williamr@2
|
72 |
|
williamr@2
|
73 |
/**
|
williamr@2
|
74 |
* Creates SIP request and sends it to the remote target.
|
williamr@2
|
75 |
* This function should be used for sending SIP extension
|
williamr@2
|
76 |
* requests within dialog assocation that do not cause
|
williamr@2
|
77 |
* sip dialog associations to be created. In SIP terms
|
williamr@2
|
78 |
* this request is non target refresh request.
|
williamr@2
|
79 |
* @pre SIPDialog().State() != CSIPDialog::EInit &&
|
williamr@2
|
80 |
* SIPDialog().State() != CSIPDialog::ETerminated
|
williamr@2
|
81 |
* @pre Dialog().Connection().State() == EActive
|
williamr@2
|
82 |
* @pre aMethod != "REGISTER" |"INVITE" | "BYE" | "CANCEL" | "ACK" |
|
williamr@2
|
83 |
* "SUBSCRIBE" | "NOTIFY" | "UPDATE" | "PRACK" | "REFER"
|
williamr@2
|
84 |
* @param aElements contains optional SIP message headers and body.
|
williamr@2
|
85 |
* Ownership is transferred.
|
williamr@2
|
86 |
* @return SIP extension client transaction. Ownership is transferred.
|
williamr@2
|
87 |
* @leave KErrSIPInvalidDialogState If dialog's state is not correct
|
williamr@2
|
88 |
* @leave KErrArgument if invalid value has been set to aMethod
|
williamr@2
|
89 |
* @leave KErrSIPResourceNotAvailable if a required SIP Client API
|
williamr@2
|
90 |
* object has been deleted
|
williamr@2
|
91 |
* @capability NetworkServices
|
williamr@2
|
92 |
*/
|
williamr@2
|
93 |
IMPORT_C virtual CSIPClientTransaction*
|
williamr@2
|
94 |
SendNonTargetRefreshRequestL(RStringF aMethod,
|
williamr@2
|
95 |
CSIPMessageElements* aElements);
|
williamr@2
|
96 |
|
williamr@2
|
97 |
/**
|
williamr@2
|
98 |
* Gets dialog association type.
|
williamr@2
|
99 |
*
|
williamr@2
|
100 |
* @return dialog association type e.g. "INVITE", "SUBSCRIBE" etc...
|
williamr@2
|
101 |
*/
|
williamr@2
|
102 |
IMPORT_C RStringF Type() const;
|
williamr@2
|
103 |
|
williamr@2
|
104 |
/**
|
williamr@2
|
105 |
* Tests if the request is a non target refresh request
|
williamr@2
|
106 |
* @param aMethod a method to test
|
williamr@2
|
107 |
* @return ETrue if is non target refresh request; EFalse otherwise
|
williamr@2
|
108 |
*/
|
williamr@2
|
109 |
IMPORT_C TBool IsNonTargetRefreshRequest(RStringF aMethod) const;
|
williamr@2
|
110 |
|
williamr@2
|
111 |
public: // New functions, for internal use
|
williamr@2
|
112 |
|
williamr@2
|
113 |
/**
|
williamr@2
|
114 |
* Returns the implementation instance.
|
williamr@2
|
115 |
* @return CSIPDialogAssocImplementation
|
williamr@2
|
116 |
*/
|
williamr@2
|
117 |
CSIPDialogAssocImplementation& Implementation();
|
williamr@2
|
118 |
|
williamr@2
|
119 |
/**
|
williamr@2
|
120 |
* Searches for a refresh with the matching id. Default implementation
|
williamr@2
|
121 |
* returns NULL. Those classes derived from CSIPDialogAssocBase, which
|
williamr@2
|
122 |
* can contain refreshes must implement this function for searching the
|
williamr@2
|
123 |
* correct refresh.
|
williamr@2
|
124 |
*
|
williamr@2
|
125 |
* @return CSIPRefresh if found, NULL otherwise.
|
williamr@2
|
126 |
* The ownership is not transferred.
|
williamr@2
|
127 |
* @internalComponent
|
williamr@2
|
128 |
*/
|
williamr@2
|
129 |
virtual CSIPRefresh* FindRefresh(TUint32 aRefreshId);
|
williamr@2
|
130 |
|
williamr@2
|
131 |
/**
|
williamr@2
|
132 |
* @internalComponent
|
williamr@2
|
133 |
*/
|
williamr@2
|
134 |
virtual void DeletingRefresh(CSIPRefresh& aRefresh, TUint32 aRefreshId);
|
williamr@2
|
135 |
|
williamr@2
|
136 |
protected: // Constructors, for internal use
|
williamr@2
|
137 |
|
williamr@2
|
138 |
/*
|
williamr@2
|
139 |
* Constructor
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
CSIPDialogAssocBase();
|
williamr@2
|
142 |
|
williamr@2
|
143 |
void ConstructL(RStringF aType, CSIPDialog& aDialog);
|
williamr@2
|
144 |
void ConstructL(RStringF aType,
|
williamr@2
|
145 |
CSIPDialog& aDialog,
|
williamr@2
|
146 |
CSIPServerTransaction& aTransaction);
|
williamr@2
|
147 |
|
williamr@2
|
148 |
protected: // Data
|
williamr@2
|
149 |
|
williamr@2
|
150 |
/**
|
williamr@2
|
151 |
* Implementation instance, CSIPDialogAssocBase owns it
|
williamr@2
|
152 |
* @internalComponent
|
williamr@2
|
153 |
*/
|
williamr@2
|
154 |
CSIPDialogAssocImplementation* iImplementation;
|
williamr@2
|
155 |
|
williamr@2
|
156 |
private: // For testing purposes
|
williamr@4
|
157 |
#ifdef CPPUNIT_TEST
|
williamr@4
|
158 |
friend class CSIPInviteDialogAssoc_Test;
|
williamr@4
|
159 |
#endif
|
williamr@4
|
160 |
void __DbgTestInvariant() const;
|
williamr@2
|
161 |
|
williamr@2
|
162 |
};
|
williamr@2
|
163 |
|
williamr@2
|
164 |
#endif
|