1.1 --- a/epoc32/include/sipreferdialogassoc.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sipreferdialogassoc.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,287 @@
1.4 -sipreferdialogassoc.h
1.5 +/*
1.6 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Name : sipreferdialogassoc.h
1.20 +* Part of : SIP Client
1.21 +* Interface : SDK API, SIP Client API
1.22 +* Version : 1.0
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +
1.28 +#ifndef CSIPREFERDIALOGASSOC_H
1.29 +#define CSIPREFERDIALOGASSOC_H
1.30 +
1.31 +// INCLUDES
1.32 +#include "sipdialogassocbase.h"
1.33 +
1.34 +// CONSTANTS
1.35 +
1.36 +// FORWARD DECLARATIONS
1.37 +class CUri8;
1.38 +class CSIPToHeader;
1.39 +class CSIPFromHeader;
1.40 +class CSIPContactHeader;
1.41 +class CSIPReferToHeader;
1.42 +class MSIPRegistrationContext;
1.43 +class CSIPConnection;
1.44 +
1.45 +// CLASS DECLARATION
1.46 +
1.47 +/**
1.48 +* @publishedAll
1.49 +* @released
1.50 +*
1.51 +* Class for managing SIP REFER dialog associations.
1.52 +* It provides services for creating, using and terminating SIP REFER
1.53 +* dialog associations. User can have multiple REFER dialog associations
1.54 +* per same SIP dialog.
1.55 +* Implementation handles SUBSCRIBE on the dialog level defined by Call-Id,
1.56 +* local and remote tags;
1.57 +* User is responsible for "Refer-to" header semantics.
1.58 +* @lib sipclient.lib
1.59 +*/
1.60 +class CSIPReferDialogAssoc: public CSIPDialogAssocBase
1.61 + {
1.62 + public: // Constructors and destructor
1.63 +
1.64 + /**
1.65 + * Two-phased constructor.
1.66 + * Should be used if response to the SIP request to be sent
1.67 + * will create a SIP dialog association.
1.68 + * @pre aReferTo != 0
1.69 + * @param aDialog a dialog to be associated with
1.70 + * @param aReferTo referred-to resource
1.71 + * @return New object; the ownership is transferred
1.72 + * @leave KErrArgument if aReferTo == 0
1.73 + */
1.74 + IMPORT_C static CSIPReferDialogAssoc*
1.75 + NewL(CSIPDialog& aDialog,
1.76 + CSIPReferToHeader* aReferTo);
1.77 +
1.78 + /**
1.79 + * Two-phased constructor.
1.80 + * Must be used if response to the SIP request to be sent
1.81 + * will create a SIP dialog association.
1.82 + * @pre aReferTo != 0
1.83 + * @param aDialog a dialog to be associated with
1.84 + * @param aReferTo referred-to resource
1.85 + * @return New object; the ownership is transferred
1.86 + * @leave KErrArgument if aReferTo == 0
1.87 + */
1.88 + IMPORT_C static CSIPReferDialogAssoc*
1.89 + NewLC(CSIPDialog& aDialog,
1.90 + CSIPReferToHeader* aReferTo);
1.91 +
1.92 + /**
1.93 + * Two-phased constructor
1.94 + * @pre aFrom != 0
1.95 + * @pre aReferTo != 0
1.96 + * @pre aRemoteUri != 0
1.97 + * The user of the class must not define tags in From-header
1.98 + * and To-header.
1.99 + * @param aConnection a SIP connection to be used with
1.100 + * dialog association
1.101 + * @param aFrom originator's address; the ownership is transfered
1.102 + * @param aRemoteUri a remote target URI that identifies a resource that
1.103 + * the request is addressed to.
1.104 + * @param aReferTo referred-to resource
1.105 + * @param aTo logical recipient's address; if not defined
1.106 + * the remote target uri will be used for To-header
1.107 + * construction; the ownership is transfered
1.108 + * @param aContact a contact to be used in dialog creation. Must be
1.109 + * given only if user intends to re-direct future requests;
1.110 + * the ownership is transfered
1.111 + * @return New object; the ownership is transferred.
1.112 + * @leave KErrArgument if aFrom == 0 or aRemoteuri == 0 or aReferTo == 0
1.113 + */
1.114 + IMPORT_C static CSIPReferDialogAssoc*
1.115 + NewL(CSIPConnection& aConnection,
1.116 + CSIPFromHeader* aFrom,
1.117 + CUri8* aRemoteUri,
1.118 + CSIPReferToHeader* aReferTo,
1.119 + CSIPToHeader* aTo=0,
1.120 + CSIPContactHeader* aContact=0);
1.121 +
1.122 + /**
1.123 + * Two-phased constructor
1.124 + * @pre aFrom != 0
1.125 + * @pre aReferTo != 0
1.126 + * @pre aRemoteUri != 0
1.127 + * The user of the class must not define tags in From-header
1.128 + * and To-header.
1.129 + * @param aConnection a SIP connection to be used with
1.130 + * dialog association
1.131 + * @param aFrom originator's address; the ownership is transfered
1.132 + * @param aRemoteUri a remote target URI that identifies a resource that
1.133 + * the request is addressed to.
1.134 + * @param aReferTo referred-to resource
1.135 + * @param aTo logical recipient's address; if not defined
1.136 + * the remote target uri will be used for To-header
1.137 + * construction; the ownership is transfered
1.138 + * @param aContact a contact to be used in dialog creation. Must be
1.139 + * given only if user intends to re-direct future requests;
1.140 + * the ownership is transfered
1.141 + * @return New object; the ownership is transferred.
1.142 + * @leave KErrArgument if aFrom == 0 or aRemoteuri == 0 or aReferTo == 0
1.143 + */
1.144 + IMPORT_C static CSIPReferDialogAssoc*
1.145 + NewLC(CSIPConnection& aConnection,
1.146 + CSIPFromHeader* aFrom,
1.147 + CUri8* aRemoteUri,
1.148 + CSIPReferToHeader* aReferTo,
1.149 + CSIPToHeader* aTo=0,
1.150 + CSIPContactHeader* aContact=0);
1.151 +
1.152 + /**
1.153 + * Two-phased constructor
1.154 + * @pre aReferTo != 0
1.155 + * @pre aRemoteUri != 0
1.156 + * The user of the class must not define tags in From-header
1.157 + * and To-header.
1.158 + * @pre aContext.IsContextActive() == ETrue
1.159 + * @param aConnection a SIP connection to be used with
1.160 + * dialog association
1.161 + * @param aRemoteUri a remote target URI that identifies a resource that
1.162 + * the request is targeted to.
1.163 + * @param aContext used for selecting outbound
1.164 + * proxy and originator's address (AOR) and contact
1.165 + * @param aReferTo referred-to resource
1.166 + * @param aFrom originator's address. If not defined it will
1.167 + * constructed using registration context (User's AOR);
1.168 + * the ownership is transfered
1.169 + * @param aTo logical recipient's address; if not defined
1.170 + * the remote target uri will be used for To-header
1.171 + * construction; the ownership is transfered
1.172 + * @param aContact a contact to be used in dialog creation. Must be
1.173 + * given only if user intends to re-direct future requests;
1.174 + * the ownership is transfered
1.175 + * @return New object: the ownership is transferred.
1.176 + * @leave KErrArgument if aRemoteuri == 0 or aReferTo == 0
1.177 + * @leave KErrSIPInvalidRegistrationState
1.178 + * if aContext.IsContextActive() == EFalse
1.179 + */
1.180 + IMPORT_C static CSIPReferDialogAssoc*
1.181 + NewL(CSIPConnection& aConnection,
1.182 + CUri8* aRemoteUri,
1.183 + const MSIPRegistrationContext& aContext,
1.184 + CSIPReferToHeader* aReferTo,
1.185 + CSIPFromHeader* aFrom=0,
1.186 + CSIPToHeader* aTo=0,
1.187 + CSIPContactHeader* aContact=0);
1.188 +
1.189 + /**
1.190 + * Two-phased constructor
1.191 + * @pre aReferTo != 0
1.192 + * @pre aRemoteUri != 0
1.193 + * The user of the class must not define tags in From-header
1.194 + * and To-header.
1.195 + * @pre aContext.IsContextActive()==ETrue
1.196 + * @param aConnection a SIP connection to be used with
1.197 + * dialog association
1.198 + * @param aRemoteUri a remote target URI that identifies a resource that
1.199 + * the request is targeted to.
1.200 + * @param aContext used for selecting outbound
1.201 + * proxy and originator's address (AOR) and contact
1.202 + * @param aReferTo referred-to resource
1.203 + * @param aFrom originator's address. If not defined it will
1.204 + * constructed using registration context (User's AOR);
1.205 + * the ownership is transfered
1.206 + * @param aTo logical recipient's address; if not defined
1.207 + * the remote target uri will be used for To-header
1.208 + * construction; the ownership is transfered
1.209 + * @param aContact a contact to be used in dialog creation. Must be
1.210 + * given only if user intends to re-direct future requests;
1.211 + * the ownership is transfered
1.212 + * @return New object; the ownership is transferred.
1.213 + * @leave KErrArgument if aRemoteuri == 0 or aReferTo == 0
1.214 + * @leave KErrSIPInvalidRegistrationState
1.215 + * if aContext.IsContextActive() == EFalse
1.216 + */
1.217 + IMPORT_C static CSIPReferDialogAssoc*
1.218 + NewLC(CSIPConnection& aConnection,
1.219 + CUri8* aRemoteUri,
1.220 + const MSIPRegistrationContext& aContext,
1.221 + CSIPReferToHeader* aReferTo,
1.222 + CSIPFromHeader* aFrom=0,
1.223 + CSIPToHeader* aTo=0,
1.224 + CSIPContactHeader* aContact=0);
1.225 +
1.226 + /**
1.227 + * Destructor
1.228 + */
1.229 + IMPORT_C ~CSIPReferDialogAssoc();
1.230 +
1.231 + public: //New functions
1.232 +
1.233 + /**
1.234 + * Creates REFER and sends it to the remote target.
1.235 + * leaves on failure.
1.236 + * 101-199 or 2xx response will create REFER dialog
1.237 + * association in case of first REFER request within
1.238 + * this dialog association.
1.239 + * @pre Dialog().Connection().State()==EActive
1.240 + * @pre Dialog().State()==CSIPDialog::EInit ||
1.241 + * Dialog().State()==CSIPDialog::EConfirmed
1.242 + * @param aElements optional SIP message headers and body. Ownership is
1.243 + * transferred.
1.244 + * @return REFER SIP transaction. Ownership is transferred.
1.245 + * @leave KErrSIPInvalidDialogState if dialog is in wrong state
1.246 + * @leave KErrSIPResourceNotAvailable if a required SIP Client API
1.247 + * object has been deleted.
1.248 + * @capability NetworkServices
1.249 + */
1.250 + IMPORT_C CSIPClientTransaction*
1.251 + SendReferL(CSIPMessageElements* aElements=0);
1.252 +
1.253 + /**
1.254 + * Gets referred-to resouce
1.255 + * @return referred-to resource
1.256 + */
1.257 + IMPORT_C const CSIPReferToHeader& ReferTo() const;
1.258 +
1.259 + public: // New functions, for internal use
1.260 +
1.261 + /**
1.262 + * Sends a REFER request.
1.263 + *
1.264 + * @pre Dialog().Connection().State()==EActive
1.265 + * @param aElements optional SIP message headers and body.
1.266 + * Ownership is transferred.
1.267 + * @param aWithinDialog ETrue if REFER is sent within dialog,
1.268 + * EFalse if REFER creates the dialog.
1.269 + * @return REFER SIP transaction. Ownership is transferred.
1.270 + */
1.271 + CSIPClientTransaction* DoSendReferL(CSIPMessageElements* aElements,
1.272 + TBool aWithinDialog);
1.273 +
1.274 + private: // Constructors
1.275 +
1.276 + CSIPReferDialogAssoc();
1.277 +
1.278 + static CSIPReferDialogAssoc* NewLC(CSIPConnection& aConnection,
1.279 + CUri8* aRemoteUri,
1.280 + CSIPReferToHeader* aReferTo,
1.281 + CSIPFromHeader* aFrom,
1.282 + CSIPToHeader* aTo,
1.283 + CSIPContactHeader* aContact,
1.284 + const MSIPRegistrationContext* aContext);
1.285 +
1.286 + private: // Data
1.287 +
1.288 + CSIPReferToHeader* iReferTo;
1.289 + };
1.290 +
1.291 +#endif