williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2007-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 : sip.h
|
williamr@2
|
16 |
* Part of : SIP Client
|
williamr@2
|
17 |
* Interface : SDK API, SIP Client API
|
williamr@2
|
18 |
* Version : 2.0
|
williamr@2
|
19 |
*
|
williamr@2
|
20 |
*/
|
williamr@2
|
21 |
|
williamr@2
|
22 |
|
williamr@2
|
23 |
|
williamr@2
|
24 |
#ifndef CSIP_H
|
williamr@2
|
25 |
#define CSIP_H
|
williamr@2
|
26 |
|
williamr@2
|
27 |
// INCLUDES
|
williamr@2
|
28 |
#include <e32base.h>
|
williamr@2
|
29 |
#include "_sipcodecdefs.h"
|
williamr@2
|
30 |
|
williamr@2
|
31 |
// FORWARD DECLARATIONS
|
williamr@2
|
32 |
class CDesC8Array;
|
williamr@2
|
33 |
class MSIPObserver;
|
williamr@2
|
34 |
class CSIPConnection;
|
williamr@2
|
35 |
class CSIPImplementation;
|
williamr@2
|
36 |
|
williamr@2
|
37 |
// CLASS DECLARATION
|
williamr@2
|
38 |
|
williamr@2
|
39 |
/**
|
williamr@2
|
40 |
* @publishedAll
|
williamr@2
|
41 |
* @released
|
williamr@2
|
42 |
*
|
williamr@2
|
43 |
* Class for connecting to SIP server.
|
williamr@2
|
44 |
*
|
williamr@2
|
45 |
* This class provides the connection to the SIP server and
|
williamr@2
|
46 |
* provides functions for quering supported SIP security mechanisms and
|
williamr@2
|
47 |
* the support of signalling compression (SigComp).
|
williamr@2
|
48 |
*
|
williamr@2
|
49 |
* Note that the implementation uses strings defined in the SIP Codec
|
williamr@2
|
50 |
* string pool. During instantiation the class will open SIP codec string pool
|
williamr@2
|
51 |
* for getting static strings and getting and setting dynamic strings.
|
williamr@2
|
52 |
*
|
williamr@2
|
53 |
* The user can create only one instance of this class. (a singleton class).
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
* @lib sipclient.lib
|
williamr@2
|
56 |
*/
|
williamr@2
|
57 |
class CSIP : public CBase
|
williamr@2
|
58 |
{
|
williamr@2
|
59 |
public: // Constructors and destructor
|
williamr@2
|
60 |
|
williamr@2
|
61 |
/**
|
williamr@2
|
62 |
* Two-phased constructor.
|
williamr@2
|
63 |
* @param aUid an unique id that identifies client
|
williamr@2
|
64 |
* @param aObserver a observer for asynchronous event
|
williamr@2
|
65 |
* @return New object, ownership is transferred
|
williamr@2
|
66 |
* @capability WriteDeviceData
|
williamr@2
|
67 |
*/
|
williamr@2
|
68 |
IMPORT_C static CSIP* NewL(const TUid& aUid,
|
williamr@2
|
69 |
MSIPObserver& aObserver);
|
williamr@2
|
70 |
|
williamr@2
|
71 |
/**
|
williamr@2
|
72 |
* Two-phased constructor.
|
williamr@2
|
73 |
* Constructs an object and adds the pointer to the cleanup stack.
|
williamr@2
|
74 |
* @param aUid an unique id that identifies client
|
williamr@2
|
75 |
* @param aObserver a observer for asynchronous event
|
williamr@2
|
76 |
* @return New object, ownership is transferred
|
williamr@2
|
77 |
* @capability WriteDeviceData
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
IMPORT_C static CSIP* NewLC(const TUid& aUid,
|
williamr@2
|
80 |
MSIPObserver& aObserver);
|
williamr@2
|
81 |
|
williamr@2
|
82 |
/**
|
williamr@2
|
83 |
* Destructor.
|
williamr@2
|
84 |
*/
|
williamr@2
|
85 |
IMPORT_C ~CSIP();
|
williamr@2
|
86 |
|
williamr@2
|
87 |
public: // New functions
|
williamr@2
|
88 |
|
williamr@2
|
89 |
/**
|
williamr@2
|
90 |
* Gets all supported security mechanisms
|
williamr@2
|
91 |
* @return supported SIP security mechanisms names (e.g. digest);
|
williamr@2
|
92 |
* the ownership is transferred
|
williamr@2
|
93 |
*/
|
williamr@2
|
94 |
IMPORT_C CDesC8Array* SupportedSecurityMechanismsL() const;
|
williamr@2
|
95 |
|
williamr@2
|
96 |
/**
|
williamr@2
|
97 |
* Checks if the signalling compression (SigComp) is supported.
|
williamr@2
|
98 |
* Leaves on failure with a system wide error code.
|
williamr@2
|
99 |
* @return ETrue if supported, EFalse otherwise
|
williamr@2
|
100 |
*/
|
williamr@2
|
101 |
IMPORT_C TBool IsSigCompSupportedL() const;
|
williamr@2
|
102 |
|
williamr@2
|
103 |
/**
|
williamr@2
|
104 |
* Gets negotiated security mechanism with the next hop
|
williamr@2
|
105 |
* on the signaling path.
|
williamr@2
|
106 |
* @param aHop the next hop's FQDN or numeric IP address
|
williamr@2
|
107 |
* @return negotiated security mechanism or zero-pointer in case no
|
williamr@2
|
108 |
* security mechanism was negotiated with the next hop;
|
williamr@2
|
109 |
* the ownership is transferred
|
williamr@2
|
110 |
*/
|
williamr@2
|
111 |
IMPORT_C HBufC8* NegotiatedSecurityMechanismL(const TDesC8& aHop);
|
williamr@2
|
112 |
|
williamr@2
|
113 |
/**
|
williamr@2
|
114 |
* Checks if the user has a connection created for given IAP-id
|
williamr@2
|
115 |
* @param aIapId IAP-id
|
williamr@2
|
116 |
* @return sip connection or 0-pointer if connection does not exist.
|
williamr@2
|
117 |
* Ownership is not transferred.
|
williamr@2
|
118 |
*/
|
williamr@2
|
119 |
IMPORT_C CSIPConnection* Connection(TUint32 aIapId) const;
|
williamr@2
|
120 |
|
williamr@2
|
121 |
/*
|
williamr@2
|
122 |
* By default the SIP built-in security mechanisms are enabled.
|
williamr@2
|
123 |
* @param aEnabled if set to EFalse the build-in SIP security handling
|
williamr@2
|
124 |
* mechanism is disabled.
|
williamr@2
|
125 |
*/
|
williamr@2
|
126 |
IMPORT_C void SetSecurityHandlingL(TBool aEnabled);
|
williamr@2
|
127 |
|
williamr@2
|
128 |
/*
|
williamr@2
|
129 |
* Tests if SIP security handling mechanism is enabled/disabled
|
williamr@2
|
130 |
* @return ETrue if built-in mechanisms are enabled, EFalse otherwise.
|
williamr@2
|
131 |
*/
|
williamr@2
|
132 |
IMPORT_C TBool IsSecurityHandlingEnabled() const;
|
williamr@2
|
133 |
|
williamr@2
|
134 |
public: // New functions, for internal use
|
williamr@2
|
135 |
|
williamr@2
|
136 |
/**
|
williamr@2
|
137 |
* Returns the CSIPImplementation.
|
williamr@2
|
138 |
*
|
williamr@2
|
139 |
* @return CSIPImplementation
|
williamr@2
|
140 |
*/
|
williamr@2
|
141 |
CSIPImplementation& Implementation();
|
williamr@2
|
142 |
|
williamr@2
|
143 |
private: // Constructors
|
williamr@2
|
144 |
CSIP();
|
williamr@2
|
145 |
|
williamr@2
|
146 |
void ConstructL(const TUid& aUid, MSIPObserver& aObserver);
|
williamr@2
|
147 |
|
williamr@2
|
148 |
private: // Data
|
williamr@2
|
149 |
CSIPImplementation* iImplementation;
|
williamr@2
|
150 |
|
williamr@2
|
151 |
private: // For testing purposes
|
williamr@2
|
152 |
|
williamr@2
|
153 |
UNIT_TEST(CSIP_Test)
|
williamr@2
|
154 |
UNIT_TEST(CSIPRegistrationBinding_Test)
|
williamr@2
|
155 |
UNIT_TEST(CSIPInviteDialogAssoc_Test)
|
williamr@2
|
156 |
UNIT_TEST(CSIPSubscribeDialogAssoc_Test)
|
williamr@2
|
157 |
UNIT_TEST(CSIPReferDialogAssoc_Test)
|
williamr@2
|
158 |
|
williamr@2
|
159 |
__DECLARE_TEST;
|
williamr@2
|
160 |
};
|
williamr@2
|
161 |
|
williamr@2
|
162 |
#endif
|