Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
16 * Part of : SIP Client
17 * Interface : SDK API, SIP Client API
30 #include <stringpool.h>
31 #include "_sipcodecdefs.h"
33 // FORWARD DECLARATIONS
35 class CSIPConnectionImplementation;
36 class MSIPRegistrationContext;
37 class CSIPDialogAssocBase;
40 class CSIPCallIDHeader;
42 class CSIPDialogImplementation;
50 * Class for managing SIP dialogs.
51 * It provides services querying dialog state, obtaining the dialog related
52 * SIP headers and getting all dialog associations.
54 * The user of the class cannot instantiate this class.
58 class CSIPDialog: public CBase
64 /** Initiliazed state */
68 /** Confirmed state */
70 /** Terminated state */
74 public: //New functions
77 * @return dialog state
79 IMPORT_C CSIPDialog::TState State() const;
82 * Gets all dialog associations.
83 * @return All dialog associations. Ownership of the array or the items
84 * inside it, is not transferred.
86 IMPORT_C const RPointerArray<CSIPDialogAssocBase>&
87 SIPDialogAssociations() const;
90 * Gets used registration context for this dialog
91 * @return associated registration or 0-pointer otherwise.
92 * Ownership is not transferred.
94 IMPORT_C const MSIPRegistrationContext* RegistrationContext() const;
97 * Checks if the dialog association belongs to this dialog
98 * @param aDialogAssoc a dialog association
99 * @return ETrue if belongs, EFalse otherwise
102 IsAssociated(const CSIPDialogAssocBase& aDialogAssoc) const;
105 * Gets the SIP connection used for this dialog
106 * @return SIP connection used for the dialog, or 0-pointer if the
107 * connection has been deleted. Ownership isn't transferred.
109 IMPORT_C CSIPConnection* Connection();
112 * Gets the SIP connection used for this dialog.
113 * @return SIP connection used for the dialog, or 0-pointer if the
114 * connection has been deleted. Ownership isn't transferred.
116 IMPORT_C const CSIPConnection* Connection() const;
119 * Gets originator's address
120 * @return originator's address (From-header)
122 IMPORT_C const CSIPFromHeader& FromHeader() const;
125 * Gets recipient's address
126 * @return recipient's address (To-header)
128 IMPORT_C const CSIPToHeader& ToHeader() const;
131 * Gets remote-uri used during dialog creation
132 * @return Remote target uri
134 IMPORT_C const CUri8& RemoteURI() const;
137 * Gets Call-ID of SIP dialog
138 * @pre State()==CSIPDialog::EEarly || State()==CSIPDialog::EConfirmed
139 * @return Call-ID of SIP dialog
140 * @leave KErrSIPInvalidDialogState if dialog doesn't yet have a Call-ID
142 IMPORT_C const CSIPCallIDHeader& CallIdL() const;
145 * Compares this object to another object
146 * @param aDialog CSIPDialog object to compare
147 * @returns ETrue if the objects are equal, otherwise EFalse
149 IMPORT_C TBool operator==(const CSIPDialog& aDialog) const;
152 * Sets the dialog to state to CSIPDialog::EInit.
153 * The local dialog identifier data
154 * (Call-ID, CSeq and From-header's tag) will be reused.
155 * After calling this function, the dialog that was already terminated
156 * can be used for sending the dialog initiating request such as
157 * INVITE or SUBSCRIBE reusing the stored Call-ID and From-header's tag
158 * and the stored CSeq incremented by one.
159 * @pre State()==CSIPDialog::ETerminated
160 * @returns KErrNone if succesful and KErrNoMemory if the memory is low.
162 IMPORT_C TInt ReuseInitialRequestData();
164 public: //Constructors and destructor, for internal use
166 * Two-phased constructor.
167 * This constructor should be used if the user has received
168 * SIP request that creates a SIP dialog association.
170 * @param aConnImplementation Implementation of the used SIP connection
171 * @return New object, ownership is transferred.
174 NewL(CSIPConnectionImplementation& aConnImplementation);
177 * Two-phased constructor
178 * This constructor should be used if the user has received
179 * SIP request that creates a SIP dialog association.
181 * @param aConnImplementation Implementation of the used SIP connection
182 * @return New object, ownership is transferred.
185 NewLC(CSIPConnectionImplementation& aConnImplementation);
188 * Two-phased constructor
189 * This constructor should be used if the user has received
190 * SIP request that creates a SIP dialog association.
192 * @param aConnImplementation Implementation of the used SIP connection
193 * @param aContext Registration context whose outbound proxy and other
194 * parameters are to be used.
195 * @return New object, ownership is transferred.
198 NewL(CSIPConnectionImplementation& aConnImplementation,
199 const MSIPRegistrationContext& aContext);
202 * Two-phased constructor
203 * This constructor should be used if the user has received
204 * SIP request that creates a SIP dialog association.
206 * @param aConnImplementation Implementation of the used SIP connection
207 * @param aContext Registration context whose outbound proxy and other
208 * parameters are to be used.
209 * @return New object, ownership is transferred.
212 NewLC(CSIPConnectionImplementation& aConnImplementation,
213 const MSIPRegistrationContext& aContext);
220 public: // New functions, for internal use
223 * Returns the CSIPDialogImplementation.
224 * @return CSIPDialogImplementation
226 CSIPDialogImplementation& Implementation();
228 private: // Constructors
232 void ConstructL(CSIPConnectionImplementation& aConnImplementation);
234 void ConstructL(CSIPConnectionImplementation& aConnImplementation,
235 const MSIPRegistrationContext& aContext);
239 //Implementation instance, CSIPDialog doesn't own it
240 CSIPDialogImplementation* iImplementation;
242 private: // For testing purposes
245 UNIT_TEST(CSIPInviteDialogAssoc_Test)
246 UNIT_TEST(CSIPSubscribeDialogAssoc_Test)
247 UNIT_TEST(CSIPReferDialogAssoc_Test)