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@2
|
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
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 : sipclienttransaction.h
|
williamr@2
|
16 |
* Part of : SIP Client
|
williamr@2
|
17 |
* Interface :
|
williamr@2
|
18 |
* Version : 1.0
|
williamr@2
|
19 |
*
|
williamr@2
|
20 |
*/
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#ifndef CSIPCLIENTTRANSACTION_H
|
williamr@2
|
26 |
#define CSIPCLIENTTRANSACTION_H
|
williamr@2
|
27 |
|
williamr@2
|
28 |
// INCLUDES
|
williamr@2
|
29 |
#include "siptransactionbase.h"
|
williamr@2
|
30 |
|
williamr@2
|
31 |
// FORWARD DECLARATIONS
|
williamr@2
|
32 |
class CSIPRefresh;
|
williamr@2
|
33 |
|
williamr@2
|
34 |
// CLASS DECLARATION
|
williamr@2
|
35 |
|
williamr@2
|
36 |
/**
|
williamr@2
|
37 |
* @publishedAll
|
williamr@2
|
38 |
* @released
|
williamr@2
|
39 |
*
|
williamr@2
|
40 |
* Class for managing SIP client transactions.
|
williamr@2
|
41 |
* It provides services for ending and getting the SIP client transaction
|
williamr@2
|
42 |
* parameters. Some client transactions can also be canceled.
|
williamr@2
|
43 |
*
|
williamr@2
|
44 |
* The user of the class cannot instante this class.
|
williamr@2
|
45 |
* @lib sipclient
|
williamr@2
|
46 |
*/
|
williamr@2
|
47 |
class CSIPClientTransaction: public CSIPTransactionBase
|
williamr@2
|
48 |
{
|
williamr@2
|
49 |
public: // Destructor
|
williamr@2
|
50 |
|
williamr@2
|
51 |
/**
|
williamr@2
|
52 |
* Destructor
|
williamr@2
|
53 |
*/
|
williamr@2
|
54 |
IMPORT_C ~CSIPClientTransaction();
|
williamr@2
|
55 |
|
williamr@2
|
56 |
public: // New functions
|
williamr@2
|
57 |
|
williamr@2
|
58 |
/**
|
williamr@2
|
59 |
* Gets response elements of the most recent response.
|
williamr@2
|
60 |
* @return Response elements. Ownership isn't transferred.
|
williamr@2
|
61 |
*/
|
williamr@2
|
62 |
IMPORT_C const CSIPResponseElements* ResponseElements() const;
|
williamr@2
|
63 |
|
williamr@2
|
64 |
/**
|
williamr@2
|
65 |
* Cancels client transaction i.e. creates a CANCEL request and sends it
|
williamr@2
|
66 |
* to the remote UA.
|
williamr@2
|
67 |
* @pre State()==EProceeding
|
williamr@2
|
68 |
* @pre CancelAllowed()==ETrue
|
williamr@2
|
69 |
* @pre Connection().State()==EActive
|
williamr@2
|
70 |
* @return SIP CANCEL transaction, ownership is transferred.
|
williamr@2
|
71 |
* @leave KErrSIPInvalidTransactionState if canceling is not possible
|
williamr@2
|
72 |
* at all, or because the transaction is not in a proper state or the
|
williamr@2
|
73 |
* transaction is not related to a dialog.
|
williamr@2
|
74 |
* @leave KErrSIPResourceNotAvailable if a required SIP Client API
|
williamr@2
|
75 |
* object has been deleted
|
williamr@2
|
76 |
* @capability NetworkServices
|
williamr@2
|
77 |
*/
|
williamr@2
|
78 |
IMPORT_C CSIPClientTransaction* CancelL();
|
williamr@2
|
79 |
|
williamr@2
|
80 |
/**
|
williamr@2
|
81 |
* Gets the associated refresh with the transaction.
|
williamr@2
|
82 |
* If the refresh is associated with the transaction,
|
williamr@2
|
83 |
* transaction will be refreshed at defined interval.
|
williamr@2
|
84 |
* @return associated refresh or 0-pointer if there's no
|
williamr@2
|
85 |
* associated refresh. Ownership isn't transferred.
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
IMPORT_C const CSIPRefresh* Refresh() const;
|
williamr@2
|
88 |
|
williamr@2
|
89 |
/**
|
williamr@2
|
90 |
* Checks if the client transaction is such that it can be cancelled.
|
williamr@2
|
91 |
* This does no check whether the transaction is currently in such a
|
williamr@2
|
92 |
* state that the canceling can be done now.
|
williamr@2
|
93 |
*
|
williamr@2
|
94 |
* @return ETrue if client transaction can be cancelled;
|
williamr@2
|
95 |
* EFalse otherwise
|
williamr@2
|
96 |
*/
|
williamr@2
|
97 |
IMPORT_C virtual TBool CancelAllowed() const;
|
williamr@2
|
98 |
|
williamr@2
|
99 |
public: // Constructors, for internal use
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* Instantiates a CSIPClientTransaction object, leaves on failure.
|
williamr@2
|
103 |
*
|
williamr@2
|
104 |
* @param aType Identifies the transaction type
|
williamr@2
|
105 |
* @param aAssociation Object to which the transaction is associated
|
williamr@2
|
106 |
* with.
|
williamr@2
|
107 |
* @param aRefresh If transaction is refreshed, this points to a
|
williamr@2
|
108 |
* CSIPRefresh, otherwise this is NULL. Ownership is not transferred.
|
williamr@2
|
109 |
* @return SIP client transaction, ownership is transferred.
|
williamr@2
|
110 |
*/
|
williamr@2
|
111 |
static CSIPClientTransaction*
|
williamr@2
|
112 |
NewL(RStringF aType,
|
williamr@2
|
113 |
MTransactionAssociation& aAssociation,
|
williamr@2
|
114 |
CSIPRefresh* aRefresh=0);
|
williamr@2
|
115 |
|
williamr@2
|
116 |
/**
|
williamr@2
|
117 |
* Instantiates a CSIPClientTransaction object and pushes it into
|
williamr@2
|
118 |
* CleanupStack, leaves on failure.
|
williamr@2
|
119 |
*
|
williamr@2
|
120 |
* @param aType Identifies the transaction type
|
williamr@2
|
121 |
* @param aAssociation Object to which the transaction is associated
|
williamr@2
|
122 |
* with.
|
williamr@2
|
123 |
* @param aRefresh If transaction is refreshed, this points to a
|
williamr@2
|
124 |
* CSIPRefresh, otherwise this is NULL. Ownership is not transferred.
|
williamr@2
|
125 |
* @return SIP client transaction, ownership is transferred.
|
williamr@2
|
126 |
*/
|
williamr@2
|
127 |
static CSIPClientTransaction*
|
williamr@2
|
128 |
NewLC(RStringF aType,
|
williamr@2
|
129 |
MTransactionAssociation& aAssociation,
|
williamr@2
|
130 |
CSIPRefresh* aRefresh=0);
|
williamr@2
|
131 |
|
williamr@2
|
132 |
public: // New functions, for internal use
|
williamr@2
|
133 |
|
williamr@2
|
134 |
/**
|
williamr@2
|
135 |
* Sets the RequestId.
|
williamr@2
|
136 |
*
|
williamr@2
|
137 |
* @pre iRequestId == 0
|
williamr@2
|
138 |
* @pre aRequestId != 0
|
williamr@2
|
139 |
* @param aRequestId RequestId obtained from SIP client
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
void SetRequestId(TUint32 aRequestId);
|
williamr@2
|
142 |
|
williamr@2
|
143 |
/**
|
williamr@2
|
144 |
* Gets the associated refresh with the transaction and allows
|
williamr@2
|
145 |
* modification fo the refresh. This method is for internal use only.
|
williamr@2
|
146 |
*
|
williamr@2
|
147 |
* @return associated refresh or 0-pointer if there's no
|
williamr@2
|
148 |
* associated refresh. Ownership isn't transferred.
|
williamr@2
|
149 |
*/
|
williamr@2
|
150 |
CSIPRefresh* Refresh();
|
williamr@2
|
151 |
|
williamr@2
|
152 |
/**
|
williamr@2
|
153 |
* Clears the association from ClientTransaction to CSIPRefresh
|
williamr@2
|
154 |
*/
|
williamr@2
|
155 |
void RemoveRefresh();
|
williamr@2
|
156 |
|
williamr@2
|
157 |
protected: // Constructor
|
williamr@2
|
158 |
|
williamr@2
|
159 |
CSIPClientTransaction(MTransactionAssociation& aAssociation,
|
williamr@2
|
160 |
CSIPRefresh* aRefresh);
|
williamr@2
|
161 |
|
williamr@2
|
162 |
private: // Data
|
williamr@2
|
163 |
|
williamr@2
|
164 |
//Points to the refresh object if this transaction is refreshed.
|
williamr@2
|
165 |
//NULL if not refreshed. Not owned.
|
williamr@2
|
166 |
CSIPRefresh* iRefresh;
|
williamr@2
|
167 |
|
williamr@2
|
168 |
private: // For testing purposes
|
williamr@2
|
169 |
|
williamr@2
|
170 |
UNIT_TEST(CSIP_Test)
|
williamr@2
|
171 |
};
|
williamr@2
|
172 |
|
williamr@2
|
173 |
#endif
|