13 * |
13 * |
14 * Description: Telephony Multimedia Service |
14 * Description: Telephony Multimedia Service |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #ifndef __TMSSERVER_H |
18 #ifndef TMSSERVER_H |
19 #define __TMSSERVER_H |
19 #define TMSSERVER_H |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <mmcccodecinformation.h> |
22 #include <mmcccodecinformation.h> |
23 #include <tms.h> |
23 #include <tms.h> |
24 #include "tmsshared.h" |
24 #include "tmsshared.h" |
25 #include "tmsclientserver.h" |
25 #include "tmsclientserver.h" |
26 #include "tmsrtplayerobsrv.h" |
26 #include "tmsrtplayerobsrv.h" |
27 #include "tmsrtplayer.h" |
27 #include "tmsrtplayer.h" |
|
28 #include "tmsdtmfobserver.h" |
|
29 #include "tmsdtmftoneplayerobserver.h" |
28 |
30 |
29 namespace TMS { |
31 namespace TMS { |
30 |
32 |
31 // FORWARD DECLARATIONS |
33 // FORWARD DECLARATIONS |
32 class TMSServerShutDown; |
34 class TMSServerShutDown; |
35 class TMSGlobalEffectsSettings; |
37 class TMSGlobalEffectsSettings; |
36 class TMSTarEventHandler; |
38 class TMSTarEventHandler; |
37 class TMSCSPCenRepListener; |
39 class TMSCSPCenRepListener; |
38 class TMSCenRepAudioHandler; |
40 class TMSCenRepAudioHandler; |
39 class TMSDtmfEventHandler; |
41 class TMSDtmfEventHandler; |
|
42 class TMSAudioDtmfTonePlayer; |
|
43 class TMSDTMFProvider; |
|
44 class TMSDtmfNotifier; |
40 |
45 |
41 // ----------------------------------------------------------------------------- |
46 // ----------------------------------------------------------------------------- |
42 // TMSServer class |
47 // TMSServer class |
43 // ----------------------------------------------------------------------------- |
48 // ----------------------------------------------------------------------------- |
44 // |
49 // |
45 class TMSServer : public CServer2, |
50 class TMSServer : public CServer2, |
46 private TMSRtPlayerObsrv |
51 private TMSRtPlayerObsrv, |
|
52 private TMSDTMFObserver, |
|
53 private TMSDTMFTonePlayerObserver |
47 { |
54 { |
48 public: |
55 public: |
49 static void RunServerL(); |
56 static void RunServerL(); |
50 ~TMSServer(); |
57 ~TMSServer(); |
51 |
58 |
52 void AddSession(); |
59 void AddSession(); |
53 void DropSession(); |
60 void DropSession(); |
54 TInt SessionCount() const; |
61 TInt SessionCount() const; |
55 |
|
56 void SetDnLinkSession(const TBool aSession); |
|
57 void SetUpLinkSession(const TBool aSession); |
|
58 |
|
59 TBool HasDnLinkSession() const; |
|
60 TBool HasUpLinkSession() const; |
|
61 |
62 |
62 void GetNewTMSCallSessionHandleL(RHandleBase& aHandle); |
63 void GetNewTMSCallSessionHandleL(RHandleBase& aHandle); |
63 TInt SetOutput(CSession2* sid, TInt output); |
64 TInt SetOutput(CSession2* sid, TInt output); |
64 TInt GetOutput(const RMessage2& aMessage); |
65 TInt GetOutput(const RMessage2& aMessage); |
65 TInt GetPreviousOutput(const RMessage2& aMessage); |
66 TInt GetPreviousOutput(const RMessage2& aMessage); |
73 TInt GetGain(const RMessage2& aMessage); |
74 TInt GetGain(const RMessage2& aMessage); |
74 TInt SetGain(CSession2* sid, TInt level); |
75 TInt SetGain(CSession2* sid, TInt level); |
75 TInt GetSupportedCodecs(const TMSStreamType strmType, |
76 TInt GetSupportedCodecs(const TMSStreamType strmType, |
76 RArray<TFourCC>*& aCodecs); |
77 RArray<TFourCC>*& aCodecs); |
77 |
78 |
78 TInt NotifyTarClients(TRoutingMsgBufPckg routingpckg); |
79 // for DTMF player |
|
80 TInt InitDTMF(const RMessage2& aMessage); |
79 TInt StartDTMF(const RMessage2& aMessage); |
81 TInt StartDTMF(const RMessage2& aMessage); |
80 TInt StopDTMF(const RMessage2& aMessage); |
82 TInt StopDTMF(const RMessage2& aMessage); |
81 TInt ContinueSendingDTMF(const RMessage2& aMessage); |
83 TInt ContinueSendingDTMF(const RMessage2& aMessage); |
82 TInt NotifyDtmfClients(TmsMsgBufPckg dtmfpckg); |
84 TInt NotifyDtmfClients(TmsMsgBufPckg dtmfpckg); |
83 |
85 gint FindActiveCallType(); |
|
86 |
|
87 TInt NotifyTarClients(TRoutingMsgBufPckg routingpckg); |
84 void StartDTMFNotifierL(); |
88 void StartDTMFNotifierL(); |
85 void CancelDTMFNotifier(); |
89 void CancelDTMFNotifier(); |
86 void StartRoutingNotifierL(); |
90 void StartRoutingNotifierL(); |
87 void CancelRoutingNotifier(); |
91 void CancelRoutingNotifier(); |
88 void StartCenRepHandlerL(); |
92 void StartCenRepHandlerL(); |
104 void MuteRingTone(); |
108 void MuteRingTone(); |
105 |
109 |
106 // from TMSRtPlayerObsrv |
110 // from TMSRtPlayerObsrv |
107 void RtPlayerEvent(TInt aEventType, TInt aError); |
111 void RtPlayerEvent(TInt aEventType, TInt aError); |
108 |
112 |
|
113 //From TMSDTMFTonePlayerObserver |
|
114 void DTMFInitCompleted(gint status); |
|
115 void DTMFToneFinished(gint status); |
|
116 |
|
117 //From TMSDTMFObserver |
|
118 void HandleDTMFEvent(const TMSDTMFObserver::TCCPDtmfEvent event, |
|
119 const gint status, const TChar tone); |
|
120 |
109 private: |
121 private: |
110 static TMSServer* NewLC(); |
122 static TMSServer* NewLC(); |
111 TMSServer(); |
123 TMSServer(); |
112 void ConstructL(); |
124 void ConstructL(); |
113 CSession2* NewSessionL(const TVersion& aVersion, |
125 CSession2* NewSessionL(const TVersion& aVersion, |
119 TInt SendMessageToCallServ(TInt func, TIpcArgs args); |
131 TInt SendMessageToCallServ(TInt func, TIpcArgs args); |
120 |
132 |
121 private: |
133 private: |
122 TInt iSession; |
134 TInt iSession; |
123 TMSServerShutDown *iShutdownTimer; |
135 TMSServerShutDown *iShutdownTimer; |
124 |
|
125 TBool iDnlinkSession; |
|
126 TBool iUplinkSession; |
|
127 |
136 |
128 mutable RPointerArray<TMSStartAndMonitorTMSCallThread> iTMSCallServList; |
137 mutable RPointerArray<TMSStartAndMonitorTMSCallThread> iTMSCallServList; |
129 TMSGlobalEffectsSettings* iEffectSettings; |
138 TMSGlobalEffectsSettings* iEffectSettings; |
130 TMSTarEventHandler* iTarHandler; |
139 TMSTarEventHandler* iTarHandler; |
131 TMSCenRepAudioHandler* iAudioCenRepHandler; |
140 TMSCenRepAudioHandler* iAudioCenRepHandler; |
132 TMSAudioOutput iCurrentRouting; |
141 TMSAudioOutput iCurrentRouting; |
133 TMSDtmfEventHandler* iDTMFHandler; |
142 TMSDtmfEventHandler* iDTMFHandler; |
134 TInt iTarHandlerCount; |
143 TInt iTarHandlerCount; |
135 TInt iAudioCenRepHandlerCount; |
144 TInt iAudioCenRepHandlerCount; |
136 TInt iDTMFHandlerCount; |
145 TInt iDTMFHandlerCount; |
|
146 TMSCallType iActiveCallType; |
137 |
147 |
138 // for RT |
148 // for RT |
139 TMSRingTonePlayer* iTMSRtPlayer; |
149 TMSRingTonePlayer* iTMSRtPlayer; |
140 HBufC* iRtFile; |
150 HBufC* iRtFile; |
141 HBufC8* iRtSequence; |
151 HBufC8* iRtSequence; |
142 HBufC* iTtsText; |
152 HBufC* iTtsText; |
|
153 |
|
154 // for DTMF |
|
155 TMSAudioDtmfTonePlayer* iDTMFDnlinkPlayer; |
|
156 TMSDtmfNotifier* iDTMFNotifier; |
|
157 TMSAudioDtmfTonePlayer* iDTMFUplinkPlayer; |
|
158 TMSDTMFProvider* iDTMFUplinkPlayerEtel; |
143 |
159 |
144 // for codecs count |
160 // for codecs count |
145 RArray<TFourCC> iDnlCodecs; |
161 RArray<TFourCC> iDnlCodecs; |
146 RArray<TFourCC> iUplCodecs; |
162 RArray<TFourCC> iUplCodecs; |
147 }; |
163 }; |