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