|
1 /* |
|
2 * Copyright (c) 2005-2007 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 "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Monitors the VOIP calls. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MUSVOIPCALLMONITOR_H_ |
|
20 #define MUSVOIPCALLMONITOR_H_ |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 #include <ccallinformation.h> |
|
25 #include <mcall.h> |
|
26 #include <ccallinfoiter.h> |
|
27 |
|
28 #include "mussesseioninformationapi.h" |
|
29 #include "musunittesting.h" |
|
30 #include "mmuscallstateobserver.h" |
|
31 |
|
32 /** |
|
33 * Monitors the Internet telephony calls ( VOIP ) |
|
34 * Same condition of CS call criteria applies here to |
|
35 * for Mush. |
|
36 * @lib musaoplugin.dll |
|
37 */ |
|
38 class CMusVoipCallMonitor : public CActive |
|
39 { |
|
40 |
|
41 public: // constructors and destructor |
|
42 /** |
|
43 * Symbian two-phased constructor. |
|
44 */ |
|
45 static CMusVoipCallMonitor* NewL( TName& aCallName, |
|
46 MMusCallStateObserver& aCallStateObserver ); |
|
47 |
|
48 /** |
|
49 * Symbian two-phased constructor. |
|
50 */ |
|
51 static CMusVoipCallMonitor* NewLC( TName& aCallName ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CMusVoipCallMonitor(); |
|
57 |
|
58 private: // functions from base class CActive |
|
59 |
|
60 void RunL(); |
|
61 |
|
62 void DoCancel(); |
|
63 |
|
64 TInt RunError( TInt aError ); |
|
65 |
|
66 private: |
|
67 |
|
68 /** |
|
69 * C++ constructor. |
|
70 */ |
|
71 CMusVoipCallMonitor( TName& aCallName, MMusCallStateObserver& aCallStateObserver ); |
|
72 |
|
73 /** |
|
74 * Symbian 2nd-phase constructor. |
|
75 */ |
|
76 void ConstructL( ); |
|
77 |
|
78 public: |
|
79 |
|
80 /** |
|
81 * Compares the call names (aName == iCallName) |
|
82 * |
|
83 * @return ETrue if matches else EFalse |
|
84 */ |
|
85 TBool IsEqual(TName& aName); |
|
86 |
|
87 /** |
|
88 * Sets the call state PS Key value. |
|
89 * |
|
90 * @aVal one of the call event types |
|
91 */ |
|
92 void SetStateL(NMusSessionInformationApi::TMusCallEvent aVal); |
|
93 |
|
94 /** |
|
95 * Checks from voip call monitor if required data is ready. |
|
96 */ |
|
97 TBool IsDataReadyL(); |
|
98 |
|
99 private: |
|
100 |
|
101 /** |
|
102 * Sets the call Information like call direction and remote address |
|
103 */ |
|
104 void SetCallInfoL(); |
|
105 |
|
106 /** |
|
107 * Sets the call Provider Information (CallProvider Name is PS Key) |
|
108 */ |
|
109 void SetCallProviderInfoL( TUint32 aServiceId ); |
|
110 |
|
111 TBool RemoteInfoExistsL(); |
|
112 |
|
113 void MonitorForRemoteInfoL(); |
|
114 |
|
115 void StopRemoteInfoMonitoring(); |
|
116 |
|
117 void ReportStateChangeL( NMusSessionInformationApi::TMusCallEvent aVal ); |
|
118 |
|
119 static TInt GuardTimerExpired( TAny* aPtr ); |
|
120 |
|
121 /** |
|
122 * Returns current connected call Service ID. |
|
123 * @return Current connected call service ID, if there is at least one |
|
124 * call in connected state, otherwise KErrNotFound |
|
125 */ |
|
126 TUint32 CallServiceIdL(); |
|
127 |
|
128 void AddDomainFromOwnUsernameL( TUint32 aServiceId, TDes16& aUri ); |
|
129 |
|
130 // Resets the Call Provider Information. |
|
131 void ResetCallProviderName(); |
|
132 |
|
133 |
|
134 private: |
|
135 /* |
|
136 * Name of the call. |
|
137 */ |
|
138 TName& iCallName ; |
|
139 |
|
140 RProperty iPropertyEvent; |
|
141 |
|
142 /* |
|
143 * Reference of callstate observer not owned |
|
144 */ |
|
145 MMusCallStateObserver& iCallStateObserver; |
|
146 |
|
147 CDeltaTimer* iGuardTimer; |
|
148 TCallBack iGuardTimerCallBack; |
|
149 TDeltaTimerEntry iGuardTimerEntry; |
|
150 |
|
151 MUS_UNITTEST( UT_CMusVoipCallMonitor ) |
|
152 |
|
153 }; |
|
154 |
|
155 #endif /* MUSVOIPCALLMONITOR_H_ */ |