54 { |
54 { |
55 CSPLOGSTRING(CSPOBJECT, "CSPCall::~CSPCall <"); |
55 CSPLOGSTRING(CSPOBJECT, "CSPCall::~CSPCall <"); |
56 |
56 |
57 delete iParams; |
57 delete iParams; |
58 iCommonInfo.IndicateHangupComplete( *this ); |
58 iCommonInfo.IndicateHangupComplete( *this ); |
59 |
59 |
60 if ( iAudioHandler |
60 if ( iAudioHandler |
61 && iAudioStatus == ECSPCallAudioStatusActive ) |
61 && iAudioStatus == ECSPCallAudioStatusActive ) |
62 { |
62 { |
63 iAudioStatus = ECSPCallAudioStatusInactive; |
63 iAudioStatus = ECSPCallAudioStatusInactive; |
64 iAudioHandler->Stop(); |
64 iAudioHandler->Stop(); |
65 } |
65 } |
66 |
66 |
67 delete iUserToUserInformation; |
67 delete iUserToUserInformation; |
68 delete iRequester; |
68 delete iRequester; |
69 delete iCallEventMonitor; |
69 delete iCallEventMonitor; |
70 delete iCallStatusMonitor; |
70 delete iCallStatusMonitor; |
71 delete iCallCapsMonitor; |
71 delete iCallCapsMonitor; |
72 delete iCallInfoMonitor; |
72 delete iCallInfoMonitor; |
73 delete iForwardProvider; |
73 delete iForwardProvider; |
74 delete iTransferProvider; |
74 delete iTransferProvider; |
75 delete iUUIMonitor; |
75 delete iUUIMonitor; |
76 delete iUUIMessageSender; |
76 delete iUUIMessageSender; |
77 delete iSkypeId; |
77 delete iSkypeId; |
78 |
78 |
79 iObservers.Close(); |
79 iObservers.Close(); |
80 if ( iCall.SubSessionHandle() ) |
80 if ( iCall.SubSessionHandle() ) |
81 { |
81 { |
82 iCall.Close(); |
82 iCall.Close(); |
83 } |
83 } |
84 |
84 |
85 CSPLOGSTRING(CSPOBJECT, "CSPCall::~CSPCall >"); |
85 CSPLOGSTRING(CSPOBJECT, "CSPCall::~CSPCall >"); |
86 } |
86 } |
87 |
87 |
88 // --------------------------------------------------------------------------- |
88 // --------------------------------------------------------------------------- |
89 // CSPCall::SetAudioHandler |
89 // CSPCall::SetAudioHandler |
90 // --------------------------------------------------------------------------- |
90 // --------------------------------------------------------------------------- |
91 // |
91 // |
92 void CSPCall::SetAudioHandler( CSPAudioHandler* aHandler ) |
92 void CSPCall::SetAudioHandler( CSPAudioHandlerBase* aHandler ) |
93 { |
93 { |
94 CSPLOGSTRING2(CSPINT, "CSPCall::SetAudioHandler handler: %x", aHandler); |
94 CSPLOGSTRING2(CSPINT, "CSPCall::SetAudioHandler handler: %x", aHandler); |
95 iAudioHandler = aHandler; |
95 iAudioHandler = aHandler; |
|
96 |
|
97 if (iAudioHandler) |
|
98 { |
|
99 iAudioHandler->SetObserver(*this); |
|
100 } |
96 } |
101 } |
97 |
102 |
98 // --------------------------------------------------------------------------- |
103 // --------------------------------------------------------------------------- |
99 // CSPCall::SecuritySettingChanged |
104 // CSPCall::SecuritySettingChanged |
100 // --------------------------------------------------------------------------- |
105 // --------------------------------------------------------------------------- |
101 // |
106 // |
102 void CSPCall::SecuritySettingChanged( TInt aValue ) |
107 void CSPCall::SecuritySettingChanged( TInt aValue ) |
103 { |
108 { |
104 switch ( aValue ) |
109 switch ( aValue ) |
105 { |
110 { |
106 case MCSPSecuritySettingObserver::ESecureCall: |
111 case MCSPSecuritySettingObserver::ESecureCall: |
107 { |
112 { |
108 CSPLOGSTRING(CSPINT, |
113 CSPLOGSTRING(CSPINT, |
109 "CSPCall::SecuritySettingChanged Sending 'secure call' event"); |
114 "CSPCall::SecuritySettingChanged Sending 'secure call' event"); |
110 NotifyCallEventOccurred( MCCPCallObserver::ECCPSecureCall ); |
115 NotifyCallEventOccurred( MCCPCallObserver::ECCPSecureCall ); |
111 break; |
116 break; |
112 } |
117 } |
113 case MCSPSecuritySettingObserver::ENotSecureCall: |
118 case MCSPSecuritySettingObserver::ENotSecureCall: |
114 { |
119 { |
115 CSPLOGSTRING(CSPINT, |
120 CSPLOGSTRING(CSPINT, |
116 "CSPCall::SecuritySettingChanged Sending 'not secure call' event"); |
121 "CSPCall::SecuritySettingChanged Sending 'not secure call' event"); |
117 NotifyCallEventOccurred( MCCPCallObserver::ECCPNotSecureCall ); |
122 NotifyCallEventOccurred( MCCPCallObserver::ECCPNotSecureCall ); |
118 break; |
123 break; |
119 } |
124 } |
120 case MCSPSecuritySettingObserver::ESecureNotSpecified: |
125 case MCSPSecuritySettingObserver::ESecureNotSpecified: |
121 { |
126 { |
122 CSPLOGSTRING(CSPINT, |
127 CSPLOGSTRING(CSPINT, |
123 "CSPCall::SecuritySettingChanged Sending SecureNotSpecified"); |
128 "CSPCall::SecuritySettingChanged Sending SecureNotSpecified"); |
124 NotifyCallEventOccurred( MCCPCallObserver::ECCPSecureNotSpecified ); |
129 NotifyCallEventOccurred( MCCPCallObserver::ECCPSecureNotSpecified ); |
125 break; |
130 break; |
126 } |
131 } |
127 |
132 |
128 default: |
133 default: |
129 { |
134 { |
130 CSPLOGSTRING(CSPERROR, "CSPCall::SecuritySettingChanged, \ |
135 CSPLOGSTRING(CSPERROR, "CSPCall::SecuritySettingChanged, \ |
131 unknown event"); |
136 unknown event"); |
132 break; |
137 break; |
133 } |
138 } |
134 } |
139 } |
135 } |
140 } |
136 |
141 |
137 // --------------------------------------------------------------------------- |
142 // --------------------------------------------------------------------------- |
138 // CSPCall::RemoteAlertingToneStatusChanged |
143 // CSPCall::RemoteAlertingToneStatusChanged |
139 // Sends EarlyMediaStarted event to observer if network has started to |
144 // Sends EarlyMediaStarted event to observer if network has started to |
140 // play remote alerting tone. There is only one known use case: Network |
145 // play remote alerting tone. There is only one known use case: Network |
141 // starts playing alerting tone during connecting state. |
146 // starts playing alerting tone during connecting state. |
142 // |
147 // |
143 // This RemoteAlertingToneStatusChanged is called for every call, |
148 // This RemoteAlertingToneStatusChanged is called for every call, |
144 // so it is calls responsibility to determine if the |
149 // so it is calls responsibility to determine if the |
145 // observer should be notified. |
150 // observer should be notified. |
146 // --------------------------------------------------------------------------- |
151 // --------------------------------------------------------------------------- |
147 // |
152 // |
148 void CSPCall::RemoteAlertingToneStatusChanged( |
153 void CSPCall::RemoteAlertingToneStatusChanged( |
149 RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus ) |
154 RMmCustomAPI::TRemoteAlertingToneStatus aNewStatus ) |
150 { |
155 { |
151 CSPLOGSTRING2(CSPINT, |
156 CSPLOGSTRING2(CSPINT, |
152 "CSPCall::RemoteAlertingToneStatusChanged new status: %d", aNewStatus ); |
157 "CSPCall::RemoteAlertingToneStatusChanged new status: %d", aNewStatus ); |
153 |
158 |
154 if ( aNewStatus == RMmCustomAPI::EUiStopTone || |
159 if ( aNewStatus == RMmCustomAPI::EUiStopTone || |
155 aNewStatus == RMmCustomAPI::EUiNoTone ) // NW tells us to stop playing |
160 aNewStatus == RMmCustomAPI::EUiNoTone ) // NW tells us to stop playing |
156 { |
161 { |
157 // Connecting is only state where network starts playing the tone. |
162 // Connecting is only state where network starts playing the tone. |
158 if ( iCallState == MCCPCallObserver::ECCPStateConnecting ) |
163 if ( iCallState == MCCPCallObserver::ECCPStateConnecting ) |
159 { |
164 { |
160 NotifyCallEventOccurred( |
165 NotifyCallEventOccurred( |
161 MCCPCallObserver::ECCCSPEarlyMediaStarted ); |
166 MCCPCallObserver::ECCCSPEarlyMediaStarted ); |
162 } |
167 } |
163 } |
168 } |
164 } |
169 } |
165 |
170 |
166 // --------------------------------------------------------------------------- |
171 // --------------------------------------------------------------------------- |
167 // CSPCall::NotifyCallStateChangedETel |
172 // CSPCall::NotifyCallStateChangedETel |
168 // Notifies observers about state changes |
173 // Notifies observers about state changes |
169 // --------------------------------------------------------------------------- |
174 // --------------------------------------------------------------------------- |
170 // |
175 // |
171 void CSPCall::NotifyCallStateChangedETel( RMobileCall::TMobileCallStatus aState ) |
176 void CSPCall::NotifyCallStateChangedETel( RMobileCall::TMobileCallStatus aState ) |
172 { |
177 { |
173 CSPLOGSTRING3(CSPINT, |
178 CSPLOGSTRING3(CSPINT, |
174 "CSPCall::NotifyCallStateChangedETel < state: %d this: %x", |
179 "CSPCall::NotifyCallStateChangedETel < state: %d this: %x", |
175 aState, this ); |
180 aState, this ); |
176 switch ( aState ) |
181 switch ( aState ) |
177 { |
182 { |
178 /* |
183 /* |
179 Cannot receive any mapping call statuses from ETel to following |
184 Cannot receive any mapping call statuses from ETel to following |
180 optional states: |
185 optional states: |
181 |
186 |
182 ECCPStateForwarding MO call is being forwarded at receiver end |
187 ECCPStateForwarding MO call is being forwarded at receiver end |
183 ECCPStateQueued Call is queued locally. |
188 ECCPStateQueued Call is queued locally. |
184 |
189 |
185 The commented observer calls are for CS specific call states. |
190 The commented observer calls are for CS specific call states. |
186 */ |
191 */ |
187 |
192 |
188 // Indicates that the call is idle or unknown. |
193 // Indicates that the call is idle or unknown. |
189 case RMobileCall::EStatusIdle: |
194 case RMobileCall::EStatusIdle: |
190 case RMobileCall::EStatusUnknown: |
195 case RMobileCall::EStatusUnknown: |
191 { |
196 { |
192 CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Idle"); |
197 CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Idle"); |
193 |
198 |
194 // If audio still active |
199 // If audio still active |
195 if ( iAudioStatus == ECSPCallAudioStatusActive |
200 if ( iAudioStatus == ECSPCallAudioStatusActive |
196 && iAudioHandler |
201 && iAudioHandler |
197 && iParams->CallType() == CCPCall::ECallTypeCSVoice ) |
202 && iParams->CallType() == CCPCall::ECallTypeCSVoice ) |
198 { |
203 { |
199 iAudioStatus = ECSPCallAudioStatusInactive; |
204 iAudioStatus = ECSPCallAudioStatusInactive; |
200 iAudioHandler->Stop(); |
205 iAudioHandler->Stop(); |
201 } |
206 } |
202 |
207 |
203 // Notify error in case not going through disconnecting |
208 // Notify error in case not going through disconnecting |
204 if ( iCallState != MCCPCallObserver::ECCPStateDisconnecting |
209 if ( iCallState != MCCPCallObserver::ECCPStateDisconnecting |
205 && !iTerminationErrorNotified ) |
210 && !iTerminationErrorNotified ) |
206 { |
211 { |
207 CheckAndNotifyTerminationError(); |
212 CheckAndNotifyTerminationError(); |
208 } |
213 } |
209 |
214 |
210 NotifyCallStateChanged( MCCPCallObserver::ECCPStateIdle ); |
215 NotifyCallStateChanged( MCCPCallObserver::ECCPStateIdle ); |
211 iCommonInfo.IndicateHangupComplete( *this ); |
216 iCommonInfo.IndicateHangupComplete( *this ); |
212 break; |
217 break; |
213 } |
218 } |
214 // The call is dialling. |
219 // The call is dialling. |
218 if ( iAudioHandler && iParams->CallType() == CCPCall:: ECallTypeCSVoice ) |
223 if ( iAudioHandler && iParams->CallType() == CCPCall:: ECallTypeCSVoice ) |
219 { |
224 { |
220 iAudioStatus = ECSPCallAudioStatusActive; |
225 iAudioStatus = ECSPCallAudioStatusActive; |
221 iAudioHandler->Start(); |
226 iAudioHandler->Start(); |
222 } |
227 } |
223 |
228 |
224 iDontReportTerm = EFalse; |
229 iDontReportTerm = EFalse; |
225 NotifyCallStateChanged( MCCPCallObserver::ECCPStateDialling ); |
230 NotifyCallStateChanged( MCCPCallObserver::ECCPStateDialling ); |
226 break; |
231 break; |
227 } |
232 } |
228 //Indicates that the MT call is ringing but not answered yet by |
233 // Indicates that the MT call is ringing but not answered yet by |
229 // the local user |
234 // the local user |
230 case RMobileCall::EStatusRinging: |
235 case RMobileCall::EStatusRinging: |
231 { |
236 { |
232 CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Ringing"); |
237 CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Ringing"); |
233 NotifyCallStateChanged( MCCPCallObserver::ECCPStateRinging ); |
238 NotifyCallStateChanged( MCCPCallObserver::ECCPStateRinging ); |
234 break; |
239 break; |
235 } |
240 } |
236 // Indicates that the local user has answered the MT call but |
241 // Indicates that the local user has answered the MT call but |
237 // the network has not acknowledged the call connection yet. |
242 // the network has not acknowledged the call connection yet. |
238 case RMobileCall::EStatusAnswering: |
243 case RMobileCall::EStatusAnswering: |
239 { |
244 { |
240 CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Answering"); |
245 CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Answering"); |
241 |
246 |
242 if ( !iMobileOriginated |
247 if ( !iMobileOriginated |
243 && iAudioHandler |
248 && iAudioHandler |
244 && iAudioStatus == ECSPCallAudioStatusInactive |
249 && iAudioStatus == ECSPCallAudioStatusInactive |
245 && iParams->CallType() == CCPCall::ECallTypeCSVoice ) |
250 && iParams->CallType() == CCPCall::ECallTypeCSVoice ) |
246 { |
251 { |
247 iAudioStatus = ECSPCallAudioStatusActive; |
252 iAudioStatus = ECSPCallAudioStatusActive; |
248 iAudioHandler->Start(); |
253 iAudioHandler->Start(); |
323 { |
337 { |
324 CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Transferring"); |
338 CSPLOGSTRING(CSPINT, "CSPCall::NotifyCallStateChangedETel Transferring"); |
325 NotifyCallStateChanged( MCCPCallObserver::ECCPStateTransferring ); |
339 NotifyCallStateChanged( MCCPCallObserver::ECCPStateTransferring ); |
326 break; |
340 break; |
327 } |
341 } |
328 |
342 |
329 // Indicates that call is undergoing temporary channel loss |
343 // Indicates that call is undergoing temporary channel loss |
330 // and it may or may not be reconnected. |
344 // and it may or may not be reconnected. |
331 case RMobileCall::EStatusReconnectPending: // fall through |
345 case RMobileCall::EStatusReconnectPending: // fall through |
332 //Indicates that the call is the non-active half of an alternating |
346 //Indicates that the call is the non-active half of an alternating |
333 // call. This call is waiting for its active half or the remote |
347 // call. This call is waiting for its active half or the remote |
334 // end to switch alternating call mode. |
348 // end to switch alternating call mode. |
335 case RMobileCall::EStatusWaitingAlternatingCallSwitch: // fall through |
349 case RMobileCall::EStatusWaitingAlternatingCallSwitch: // fall through |
336 case RMobileCall::EStatusTransferAlerting: |
350 case RMobileCall::EStatusTransferAlerting: |
337 { |
351 { |
338 CSPLOGSTRING2(CSPINT, |
352 CSPLOGSTRING2(CSPINT, |
339 "CSPCall::NotifyCallStateChangedETel no special handling for state %d", |
353 "CSPCall::NotifyCallStateChangedETel no special handling for state %d", |
340 aState); |
354 aState); |
341 break; |
355 break; |
342 } |
356 } |
343 |
357 |
344 default: |
358 default: |
345 { |
359 { |
346 CSPLOGSTRING(CSPERROR, |
360 CSPLOGSTRING(CSPERROR, |
347 "CSPCall::NotifyCallStateChangedETel callstate UNKNOWN"); |
361 "CSPCall::NotifyCallStateChangedETel callstate UNKNOWN"); |
348 break; |
362 break; |
349 } |
363 } |
350 } |
364 } |
351 CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyCallStateChangedETel >"); |
365 CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyCallStateChangedETel >"); |
354 // --------------------------------------------------------------------------- |
368 // --------------------------------------------------------------------------- |
355 // CSPCall::NotifyCallEventOccurred |
369 // CSPCall::NotifyCallEventOccurred |
356 // Notifies observers about call events |
370 // Notifies observers about call events |
357 // --------------------------------------------------------------------------- |
371 // --------------------------------------------------------------------------- |
358 // |
372 // |
359 void CSPCall::NotifyCallEventOccurred( |
373 void CSPCall::NotifyCallEventOccurred( |
360 MCCPCallObserver::TCCPCallEvent aEvent ) |
374 MCCPCallObserver::TCCPCallEvent aEvent ) |
361 { |
375 { |
362 CSPLOGSTRING2(CSPINT, |
376 CSPLOGSTRING2(CSPINT, |
363 "CSPCall::NotifyCallEventOccurred < event: %d", aEvent); |
377 "CSPCall::NotifyCallEventOccurred < event: %d", aEvent); |
364 |
378 |
365 TInt obsCount = iObservers.Count(); |
379 TInt obsCount = iObservers.Count(); |
366 for ( TInt i = 0; i < obsCount; i++ ) |
380 for ( TInt i = 0; i < obsCount; i++ ) |
367 { |
381 { |
368 CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred obs=%d",i); |
382 CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred obs=%d",i); |
369 MCCPCallObserver *obs = iObservers[i]; |
383 MCCPCallObserver *obs = iObservers[i]; |
370 if ( obs ) |
384 if ( obs ) |
371 { |
385 { |
372 obs->CallEventOccurred( aEvent, this ); |
386 obs->CallEventOccurred( aEvent, this ); |
373 } |
387 } |
374 |
388 |
375 CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred ok obs=%d",i); |
389 CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred ok obs=%d",i); |
376 } |
390 } |
377 |
391 |
378 CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred > event: %d", aEvent); |
392 CSPLOGSTRING2(CSPINT, "CSPCall::NotifyCallEventOccurred > event: %d", aEvent); |
379 } |
393 } |
380 |
394 |
381 // --------------------------------------------------------------------------- |
395 // --------------------------------------------------------------------------- |
382 // CSPCall::NotifyTransferCallEventOccurred |
396 // CSPCall::NotifyTransferCallEventOccurred |
383 // Forward notification of transfer event to it's provider |
397 // Forward notification of transfer event to it's provider |
384 // --------------------------------------------------------------------------- |
398 // --------------------------------------------------------------------------- |
385 // |
399 // |
386 void CSPCall::NotifyTransferCallEventOccurred( |
400 void CSPCall::NotifyTransferCallEventOccurred( |
387 MCCPTransferObserver::TCCPTransferEvent aEvent ) |
401 MCCPTransferObserver::TCCPTransferEvent aEvent ) |
388 { |
402 { |
389 CSPLOGSTRING2(CSPINT, "CSPCall::NotifyTransferCallEventOccurred %d", aEvent); |
403 CSPLOGSTRING2(CSPINT, "CSPCall::NotifyTransferCallEventOccurred %d", aEvent); |
390 // forward the method call to CSPTransferProvider object |
404 // forward the method call to CSPTransferProvider object |
391 iTransferProvider->TransferEventOccurred( aEvent ); |
405 iTransferProvider->TransferEventOccurred( aEvent ); |
392 } |
406 } |
556 const TDesC& CSPCall::RemotePartyName() |
570 const TDesC& CSPCall::RemotePartyName() |
557 { |
571 { |
558 CSPLOGSTRING(CSPREQIN, "CSPCall::RemotePartyName"); |
572 CSPLOGSTRING(CSPREQIN, "CSPCall::RemotePartyName"); |
559 return iRemotePartyName; |
573 return iRemotePartyName; |
560 } |
574 } |
561 |
575 |
562 // --------------------------------------------------------------------------- |
576 // --------------------------------------------------------------------------- |
563 // From class MCCPCall |
577 // From class MCCPCall |
564 // CSPCall::DialledParty |
578 // CSPCall::DialledParty |
565 // --------------------------------------------------------------------------- |
579 // --------------------------------------------------------------------------- |
566 // |
580 // |
567 const TDesC& CSPCall::DialledParty() const |
581 const TDesC& CSPCall::DialledParty() const |
568 { |
582 { |
569 CSPLOGSTRING2(CSPREQIN, "CSPCall::DialledParty %S", &iRemotePartyNumber); |
583 CSPLOGSTRING2(CSPREQIN, "CSPCall::DialledParty %S", &iRemotePartyNumber); |
570 return iRemotePartyNumber; |
584 return iRemotePartyNumber; |
571 } |
585 } |
572 |
586 |
573 // --------------------------------------------------------------------------- |
587 // --------------------------------------------------------------------------- |
574 // From class MCCPCall |
588 // From class MCCPCall |
575 // CSPCall::Answer |
589 // CSPCall::Answer |
576 // --------------------------------------------------------------------------- |
590 // --------------------------------------------------------------------------- |
577 // |
591 // |
578 TInt CSPCall::Answer() |
592 TInt CSPCall::Answer() |
579 { |
593 { |
580 CSPLOGSTRING(CSPREQIN, "CSPCall::Answer <"); |
594 CSPLOGSTRING(CSPREQIN, "CSPCall::Answer <"); |
581 TInt ret( KErrNone ); |
595 TInt ret( KErrNone ); |
582 |
596 |
583 if ( iCallState == MCCPCallObserver::ECCPStateRinging |
597 if ( iCallState == MCCPCallObserver::ECCPStateRinging |
584 || iCallState == MCCPCallObserver::ECCPStateQueued ) |
598 || iCallState == MCCPCallObserver::ECCPStateQueued ) |
585 { |
599 { |
586 if( iMobileOriginated ) |
600 if( iMobileOriginated ) |
587 { |
601 { |
588 ret = KErrGeneral; |
602 ret = KErrGeneral; |
589 } |
603 } |
590 else if( iCallState != MCCPCallObserver::ECCPStateRinging && |
604 else if( iCallState != MCCPCallObserver::ECCPStateRinging && |
591 iCallState != MCCPCallObserver::ECCPStateQueued ) |
605 iCallState != MCCPCallObserver::ECCPStateQueued ) |
592 { |
606 { |
593 ret = KErrAccessDenied; |
607 ret = KErrAccessDenied; |
594 } |
608 } |
595 else |
609 else |
685 CSPLOGSTRING(CSPREQIN, "CSPCall::Queue Call Waiting Off"); |
699 CSPLOGSTRING(CSPREQIN, "CSPCall::Queue Call Waiting Off"); |
686 } |
700 } |
687 } |
701 } |
688 else |
702 else |
689 { |
703 { |
690 CSPLOGSTRING2(CSPERROR, |
704 CSPLOGSTRING2(CSPERROR, |
691 "CSPCall::Queue Error %d with CR. Call Waiting Off", |
705 "CSPCall::Queue Error %d with CR. Call Waiting Off", |
692 res); |
706 res); |
693 } |
707 } |
694 |
708 |
695 return KErrNotSupported; |
709 return KErrNotSupported; |
696 } |
710 } |
697 |
711 |
698 // --------------------------------------------------------------------------- |
712 // --------------------------------------------------------------------------- |
699 // From class MCCPCall |
713 // From class MCCPCall |
700 // CSPCall::Ringing |
714 // CSPCall::Ringing |
701 // --------------------------------------------------------------------------- |
715 // --------------------------------------------------------------------------- |
702 // |
716 // |
703 TInt CSPCall::Ringing() |
717 TInt CSPCall::Ringing() |
704 { |
718 { |
705 CSPLOGSTRING(CSPREQIN, "CSPCall::Ringing"); |
719 CSPLOGSTRING(CSPREQIN, "CSPCall::Ringing"); |
706 iDontReportTerm = ETrue; |
720 iDontReportTerm = ETrue; |
707 |
721 |
708 // Ringing state is accepted because MT-call goes to ringing |
722 // Ringing state is accepted because MT-call goes to ringing |
709 // state in the beginning based on ETel state maching. |
723 // state in the beginning based on ETel state maching. |
710 if ( iCallState == MCCPCallObserver::ECCPStateIdle || |
724 if ( iCallState == MCCPCallObserver::ECCPStateIdle || |
711 iCallState == MCCPCallObserver::ECCPStateRinging ) |
725 iCallState == MCCPCallObserver::ECCPStateRinging ) |
712 { |
726 { |
713 NotifyRingingState(); |
727 NotifyRingingState(); |
714 return KErrNone; |
728 return KErrNone; |
715 } |
729 } |
716 else if ( iCallState == MCCPCallObserver::ECCPStateAnswering ) |
730 else if ( iCallState == MCCPCallObserver::ECCPStateAnswering ) |
717 { |
731 { |
718 // Do nothing if already in Answering state (autoanswer). |
732 // Do nothing if already in Answering state (autoanswer). |
719 return KErrNone; |
733 return KErrNone; |
720 } |
734 } |
721 |
735 |
722 return KErrNotReady; |
736 return KErrNotReady; |
723 } |
737 } |
724 |
738 |
725 // --------------------------------------------------------------------------- |
739 // --------------------------------------------------------------------------- |
726 // From class MCCPCall |
740 // From class MCCPCall |
727 // CSPCall::HangUp |
741 // CSPCall::HangUp |
728 // --------------------------------------------------------------------------- |
742 // --------------------------------------------------------------------------- |
729 // |
743 // |
730 TInt CSPCall::HangUp() |
744 TInt CSPCall::HangUp() |
731 { |
745 { |
732 CSPLOGSTRING2(CSPREQIN, "CSPCall::HangUp this: %x", this); |
746 CSPLOGSTRING2(CSPREQIN, "CSPCall::HangUp this: %x", this); |
733 TInt ret( KErrNone ); |
747 TInt ret( KErrNone ); |
734 |
748 |
735 CSPEtelCallRequester::TRequestType req = iRequester->Request(); |
749 CSPEtelCallRequester::TRequestType req = iRequester->Request(); |
736 if ( req == CSPEtelCallRequester::ERequestTypeDial || |
750 if ( req == CSPEtelCallRequester::ERequestTypeDial || |
737 ( req == CSPEtelCallRequester::ERequestTypeDialEmergency ) ) |
751 ( req == CSPEtelCallRequester::ERequestTypeDialEmergency ) ) |
738 { |
752 { |
739 CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 1: Cancel ongoing dial"); |
753 CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp 1: Cancel ongoing dial"); |
740 ret = iRequester->DialCancel(); |
754 ret = iRequester->DialCancel(); |
741 CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp Canceled"); |
755 CSPLOGSTRING(CSPREQIN, "CSPCall::HangUp Canceled"); |
945 // --------------------------------------------------------------------------- |
959 // --------------------------------------------------------------------------- |
946 // From class MCCPCall |
960 // From class MCCPCall |
947 // CSPCall::TransferProvider |
961 // CSPCall::TransferProvider |
948 // --------------------------------------------------------------------------- |
962 // --------------------------------------------------------------------------- |
949 // |
963 // |
950 MCCPTransferProvider* CSPCall::TransferProviderL(const MCCPTransferObserver& |
964 MCCPTransferProvider* CSPCall::TransferProviderL(const MCCPTransferObserver& |
951 aObserver ) |
965 aObserver ) |
952 { |
966 { |
953 CSPLOGSTRING(CSPREQIN, "CSPCall::TransferProvider"); |
967 CSPLOGSTRING(CSPREQIN, "CSPCall::TransferProvider"); |
954 iTransferProvider->AddObserverL( aObserver ); |
968 iTransferProvider->AddObserverL( aObserver ); |
955 return iTransferProvider; |
969 return iTransferProvider; |
956 } |
970 } |
957 |
971 |
958 // --------------------------------------------------------------------------- |
972 // --------------------------------------------------------------------------- |
959 // From class MCCPCall |
973 // From class MCCPCall |
960 // CSPCall::ForwardProvider |
974 // CSPCall::ForwardProvider |
961 // --------------------------------------------------------------------------- |
975 // --------------------------------------------------------------------------- |
962 // |
976 // |
963 MCCPForwardProvider* CSPCall::ForwardProviderL( |
977 MCCPForwardProvider* CSPCall::ForwardProviderL( |
964 const MCCPForwardObserver& aObserver ) |
978 const MCCPForwardObserver& aObserver ) |
965 { |
979 { |
966 CSPLOGSTRING(CSPREQIN, "CSPCall::ForwardProvider"); |
980 CSPLOGSTRING(CSPREQIN, "CSPCall::ForwardProvider"); |
967 iForwardProvider->AddObserverL( aObserver ); |
981 iForwardProvider->AddObserverL( aObserver ); |
968 return iForwardProvider; |
982 return iForwardProvider; |
1160 default: |
1174 default: |
1161 CSPLOGSTRING(CSPERROR, "CSPCall::Tone: ERROR not found"); |
1175 CSPLOGSTRING(CSPERROR, "CSPCall::Tone: ERROR not found"); |
1162 break; |
1176 break; |
1163 } |
1177 } |
1164 } |
1178 } |
1165 |
1179 |
1166 CSPLOGSTRING2(CSPREQIN, "CSPCall::Tone > tone: %d", tone); |
1180 CSPLOGSTRING2(CSPREQIN, "CSPCall::Tone > tone: %d", tone); |
1167 return tone; |
1181 return tone; |
1168 } |
1182 } |
1169 |
1183 |
1170 // --------------------------------------------------------------------------- |
1184 // --------------------------------------------------------------------------- |
1171 // From class MCCPCSCall |
1185 // From class MCCPCSCall |
1172 // CSPCall::NoFdnCheck |
1186 // CSPCall::NoFdnCheck |
1173 // --------------------------------------------------------------------------- |
1187 // --------------------------------------------------------------------------- |
1174 // |
1188 // |
1175 void CSPCall::NoFDNCheck( ) |
1189 void CSPCall::NoFDNCheck( ) |
1176 { |
1190 { |
1177 CSPLOGSTRING(CSPREQIN, "CSPCall::NoFDNCheck"); |
1191 CSPLOGSTRING(CSPREQIN, "CSPCall::NoFDNCheck"); |
1178 iFdnCheck = EFalse; |
1192 iFdnCheck = EFalse; |
1179 } |
1193 } |
1180 |
1194 |
1181 // --------------------------------------------------------------------------- |
1195 // --------------------------------------------------------------------------- |
1182 // CSPCall::LogDialedNumber |
1196 // CSPCall::LogDialedNumber |
1183 // --------------------------------------------------------------------------- |
1197 // --------------------------------------------------------------------------- |
1184 // |
1198 // |
1185 TBool CSPCall::LogDialedNumber() const |
1199 TBool CSPCall::LogDialedNumber() const |
1186 { |
1200 { |
1187 CSPLOGSTRING(CSPREQIN, "CSPCall::LogDialedNumber true"); |
1201 CSPLOGSTRING(CSPREQIN, "CSPCall::LogDialedNumber true"); |
1188 return ETrue; |
1202 return ETrue; |
1189 } |
1203 } |
1190 |
1204 |
1191 // --------------------------------------------------------------------------- |
1205 // --------------------------------------------------------------------------- |
1192 // From class MCCPCSCall |
1206 // From class MCCPCSCall |
1193 // CSPCall::Dial |
1207 // CSPCall::Dial |
1194 // --------------------------------------------------------------------------- |
1208 // --------------------------------------------------------------------------- |
1195 // |
1209 // |
1207 TInt CSPCall::PerformDialRequest() |
1221 TInt CSPCall::PerformDialRequest() |
1208 { |
1222 { |
1209 CSPLOGSTRING(CSPREQIN, "CSPCall::PerformDialRequest"); |
1223 CSPLOGSTRING(CSPREQIN, "CSPCall::PerformDialRequest"); |
1210 iDialCompletionCode = KErrNone; |
1224 iDialCompletionCode = KErrNone; |
1211 iTerminationErrorNotified = EFalse; |
1225 iTerminationErrorNotified = EFalse; |
1212 |
1226 |
1213 // Send the User to User Information. |
1227 // Send the User to User Information. |
1214 if( iUserToUserInformation->Length() ) |
1228 if( iUserToUserInformation->Length() ) |
1215 { |
1229 { |
1216 iUUIMessageSender->SendUUIMessage( *iUserToUserInformation ); |
1230 iUUIMessageSender->SendUUIMessage( *iUserToUserInformation ); |
1217 } |
1231 } |
1218 |
1232 |
1219 return DialFdnCond( iFdnCheck ); |
1233 return DialFdnCond( iFdnCheck ); |
1220 } |
1234 } |
1221 |
1235 |
|
1236 // --------------------------------------------------------------------------- |
|
1237 // From class MCSPAudioHandlerObserver |
|
1238 // CSPCall::AudioStartingFailed |
|
1239 // --------------------------------------------------------------------------- |
|
1240 // |
|
1241 void CSPCall::AudioStartingFailed() |
|
1242 { |
|
1243 HangUp(); |
|
1244 } |
|
1245 |
1222 // --------------------------------------------------------------------------- |
1246 // --------------------------------------------------------------------------- |
1223 // CSPCall::CSPCall |
1247 // CSPCall::CSPCall |
1224 // --------------------------------------------------------------------------- |
1248 // --------------------------------------------------------------------------- |
1225 // |
1249 // |
1226 CSPCall::CSPCall( RMobileLine& aLine, |
1250 CSPCall::CSPCall( RMobileLine& aLine, |
1227 TBool aMobileOriginated, |
1251 TBool aMobileOriginated, |
1228 const TDesC& aName, |
1252 const TDesC& aName, |
1229 MCSPCommonInfo& aCommonInfo, |
1253 MCSPCommonInfo& aCommonInfo, |
1230 TBool aIsEmergencyCall ) : |
1254 TBool aIsEmergencyCall ) : |
1231 iLine( aLine ), |
1255 iLine( aLine ), |
1232 iMobileOriginated( aMobileOriginated ), |
1256 iMobileOriginated( aMobileOriginated ), |
1233 iName( aName ), |
1257 iName( aName ), |
1234 iParams( NULL ), |
1258 iParams( NULL ), |
1235 iCallState( MCCPCallObserver::ECCPStateIdle ), |
1259 iCallState( MCCPCallObserver::ECCPStateIdle ), |
1259 |
1283 |
1260 // --------------------------------------------------------------------------- |
1284 // --------------------------------------------------------------------------- |
1261 // CSPCall::ConstructL |
1285 // CSPCall::ConstructL |
1262 // Constructing CSPCall in 2nd phase |
1286 // Constructing CSPCall in 2nd phase |
1263 // --------------------------------------------------------------------------- |
1287 // --------------------------------------------------------------------------- |
1264 // |
1288 // |
1265 void CSPCall::ConstructL( const CCCECallParameters& aParams ) |
1289 void CSPCall::ConstructL( const CCCECallParameters& aParams ) |
1266 { |
1290 { |
1267 CSPLOGSTRING(CSPOBJECT, "CSPCall::ConstructL <"); |
1291 CSPLOGSTRING(CSPOBJECT, "CSPCall::ConstructL <"); |
1268 |
1292 |
1269 // Create cloned copy of call parameters |
1293 // Create cloned copy of call parameters |
1270 iParams = static_cast<CCCECallParameters*>( aParams.CloneL() ); |
1294 iParams = static_cast<CCCECallParameters*>( aParams.CloneL() ); |
1271 |
1295 |
1272 // Open call handle |
1296 // Open call handle |
1273 OpenCallHandleL(); |
1297 OpenCallHandleL(); |
1274 |
1298 |
1275 // Update call info |
1299 // Update call info |
1276 UpdateCallInfo(); |
1300 UpdateCallInfo(); |
1277 |
1301 |
1278 // Update call state from ETel |
1302 // Update call state from ETel |
1279 UpdateCallState(); |
1303 UpdateCallState(); |
1280 |
1304 |
1281 // Create call handlers for call related requests |
1305 // Create call handlers for call related requests |
1282 // and for monitoring call related events |
1306 // and for monitoring call related events |
1283 CreateCallHandlersL(); |
1307 CreateCallHandlersL(); |
1284 |
1308 |
1285 CSPLOGSTRING(CSPOBJECT, "CSPCall::ConstructL >"); |
1309 CSPLOGSTRING(CSPOBJECT, "CSPCall::ConstructL >"); |
1286 } |
1310 } |
1287 |
1311 |
1288 // --------------------------------------------------------------------------- |
1312 // --------------------------------------------------------------------------- |
1289 // CSPCall::OpenCallHandleL |
1313 // CSPCall::OpenCallHandleL |
1290 // Open call handle, calls either OpenNewCallL or OpenExistingCallL depending |
1314 // Open call handle, calls either OpenNewCallL or OpenExistingCallL depending |
1291 // of the call direction and if the call is a client call |
1315 // of the call direction and if the call is a client call |
1292 // --------------------------------------------------------------------------- |
1316 // --------------------------------------------------------------------------- |
1293 // |
1317 // |
1294 void CSPCall::OpenCallHandleL() |
1318 void CSPCall::OpenCallHandleL() |
1295 { |
1319 { |
1296 CSPLOGSTRING(CSPINT, "CSPCall::OpenCallHandleL <"); |
1320 CSPLOGSTRING(CSPINT, "CSPCall::OpenCallHandleL <"); |
1297 |
1321 |
1298 if ( iMobileOriginated ) |
1322 if ( iMobileOriginated ) |
1299 { |
1323 { |
1300 // There is no existing call on line, open new call |
1324 // There is no existing call on line, open new call |
1301 OpenNewCall(); |
1325 OpenNewCall(); |
1302 } |
1326 } |
1303 else |
1327 else |
1304 { |
1328 { |
1305 // Mobile terminated call on line, open existing call |
1329 // Mobile terminated call on line, open existing call |
1306 OpenExistingCallL( iName ); |
1330 OpenExistingCallL( iName ); |
1307 } |
1331 } |
1308 |
1332 |
1309 CSPLOGSTRING(CSPINT, "CSPCall::OpenCallHandleL >"); |
1333 CSPLOGSTRING(CSPINT, "CSPCall::OpenCallHandleL >"); |
1310 } |
1334 } |
1311 |
1335 |
1312 // --------------------------------------------------------------------------- |
1336 // --------------------------------------------------------------------------- |
1313 // CSPCall::UpdateCallInfoL |
1337 // CSPCall::UpdateCallInfoL |
1314 // Update call info including remote party name and number data |
1338 // Update call info including remote party name and number data |
1315 // --------------------------------------------------------------------------- |
1339 // --------------------------------------------------------------------------- |
1316 // |
1340 // |
1317 void CSPCall::UpdateCallInfo() |
1341 void CSPCall::UpdateCallInfo() |
1318 { |
1342 { |
1319 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfo <"); |
1343 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfo <"); |
1320 RMobileCall::TMobileCallInfoV7Pckg pck( iEtelCallInfo ); |
1344 RMobileCall::TMobileCallInfoV7Pckg pck( iEtelCallInfo ); |
1321 TInt err = GetMobileCallInfo( pck ); |
1345 TInt err = GetMobileCallInfo( pck ); |
1326 |
1350 |
1327 // --------------------------------------------------------------------------- |
1351 // --------------------------------------------------------------------------- |
1328 // CSPCall::UpdateCallInfoImpl |
1352 // CSPCall::UpdateCallInfoImpl |
1329 // Implementation for UpdateCallInfo(). |
1353 // Implementation for UpdateCallInfo(). |
1330 // --------------------------------------------------------------------------- |
1354 // --------------------------------------------------------------------------- |
1331 // |
1355 // |
1332 void CSPCall::UpdateCallInfoImpl( const RMobileCall::TMobileCallInfoV7& aCallInfo ) |
1356 void CSPCall::UpdateCallInfoImpl( const RMobileCall::TMobileCallInfoV7& aCallInfo ) |
1333 { |
1357 { |
1334 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfoImpl <"); |
1358 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfoImpl <"); |
1335 |
1359 |
1336 if ( iMobileOriginated ) |
1360 if ( iMobileOriginated ) |
1337 { |
1361 { |
1338 // Call wasn't added by ETel monitor, update info accordingly |
1362 // Call wasn't added by ETel monitor, update info accordingly |
1339 UpdateCallNameNumberInfo( aCallInfo, EFalse ); |
1363 UpdateCallNameNumberInfo( aCallInfo, EFalse ); |
1340 } |
1364 } |
1341 else |
1365 else |
1342 { |
1366 { |
1343 // Call was added by ETel monitor, update info accordingly |
1367 // Call was added by ETel monitor, update info accordingly |
1344 UpdateCallNameNumberInfo( aCallInfo, ETrue ); |
1368 UpdateCallNameNumberInfo( aCallInfo, ETrue ); |
1345 } |
1369 } |
1346 |
1370 |
1347 |
1371 |
1348 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfoImpl >"); |
1372 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallInfoImpl >"); |
1349 } |
1373 } |
1350 |
1374 |
1351 // --------------------------------------------------------------------------- |
1375 // --------------------------------------------------------------------------- |
1352 // CSPCall::UpdateCallOrigin |
1376 // CSPCall::UpdateCallOrigin |
1353 // Set call origin to CCCECallParameters. |
1377 // Set call origin to CCCECallParameters. |
1354 // --------------------------------------------------------------------------- |
1378 // --------------------------------------------------------------------------- |
1355 // |
1379 // |
1356 void CSPCall::UpdateCallOrigin( const RMobileCall::TMobileCallInfoV7& aCallInfo ) |
1380 void CSPCall::UpdateCallOrigin( const RMobileCall::TMobileCallInfoV7& aCallInfo ) |
1357 { |
1381 { |
1358 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallOrigin <"); |
1382 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallOrigin <"); |
1359 |
1383 |
1360 if ( RMobileCall::EOriginatorSIM == aCallInfo.iCallParamOrigin ) |
1384 if ( RMobileCall::EOriginatorSIM == aCallInfo.iCallParamOrigin ) |
1368 |
1392 |
1369 |
1393 |
1370 |
1394 |
1371 // --------------------------------------------------------------------------- |
1395 // --------------------------------------------------------------------------- |
1372 // CSPCall::UpdateCallStateL |
1396 // CSPCall::UpdateCallStateL |
1373 // |
1397 // |
1374 // --------------------------------------------------------------------------- |
1398 // --------------------------------------------------------------------------- |
1375 // |
1399 // |
1376 int CSPCall::UpdateCallState() |
1400 int CSPCall::UpdateCallState() |
1377 { |
1401 { |
1378 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallState <"); |
1402 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallState <"); |
1379 TInt err( KErrNone ); |
1403 TInt err( KErrNone ); |
1380 |
1404 |
1381 // Update call state from ETel |
1405 // Update call state from ETel |
1382 RMobileCall::TMobileCallStatus etelState; |
1406 RMobileCall::TMobileCallStatus etelState; |
1383 err = iCall.GetMobileCallStatus( etelState ); |
1407 err = iCall.GetMobileCallStatus( etelState ); |
1384 if ( KErrNone == err ) |
1408 if ( KErrNone == err ) |
1385 { |
1409 { |
1386 iCallState = CCPStateFromETelState( etelState ); |
1410 iCallState = CCPStateFromETelState( etelState ); |
1387 } |
1411 } |
1388 CSPLOGSTRING2(CSPINT, "CSPCall::UpdateCallState > res %d", err); |
1412 CSPLOGSTRING2(CSPINT, "CSPCall::UpdateCallState > res %d", err); |
1389 |
1413 |
1390 return err; |
1414 return err; |
1391 } |
1415 } |
1392 |
1416 |
1393 // --------------------------------------------------------------------------- |
1417 // --------------------------------------------------------------------------- |
1394 // CSPCall::NotifyRemotePartyNumberChanged |
1418 // CSPCall::NotifyRemotePartyNumberChanged |
1395 // |
1419 // |
1396 // --------------------------------------------------------------------------- |
1420 // --------------------------------------------------------------------------- |
1397 // |
1421 // |
1398 void CSPCall::NotifyRemotePartyNumberChanged() |
1422 void CSPCall::NotifyRemotePartyNumberChanged() |
1399 { |
1423 { |
1400 CSPLOGSTRING(CSPINT, "CSPCall::NotifyRemotePartyNumberChanged <"); |
1424 CSPLOGSTRING(CSPINT, "CSPCall::NotifyRemotePartyNumberChanged <"); |
1415 } |
1439 } |
1416 |
1440 |
1417 |
1441 |
1418 // --------------------------------------------------------------------------- |
1442 // --------------------------------------------------------------------------- |
1419 // CSPCall::CreateCallHandlersL |
1443 // CSPCall::CreateCallHandlersL |
1420 // Create call handlers for call related requests and call monitoring |
1444 // Create call handlers for call related requests and call monitoring |
1421 // --------------------------------------------------------------------------- |
1445 // --------------------------------------------------------------------------- |
1422 // |
1446 // |
1423 void CSPCall::CreateCallHandlersL() |
1447 void CSPCall::CreateCallHandlersL() |
1424 { |
1448 { |
1425 CSPLOGSTRING(CSPINT, "CSPCall::CreateCallHandlersL <"); |
1449 CSPLOGSTRING(CSPINT, "CSPCall::CreateCallHandlersL <"); |
1426 |
1450 |
1427 iRequester = CSPEtelCallRequester::NewL( *this, iCall ); |
1451 iRequester = CSPEtelCallRequester::NewL( *this, iCall ); |
1428 |
1452 |
1429 iCallEventMonitor = CSPEtelCallEventMonitor::NewL( *this, iCall ); |
1453 iCallEventMonitor = CSPEtelCallEventMonitor::NewL( *this, iCall ); |
1430 iCallEventMonitor->StartMonitoring(); |
1454 iCallEventMonitor->StartMonitoring(); |
1431 iCallStatusMonitor = CSPEtelCallStatusMonitor::NewL( *this, iCall ); |
1455 iCallStatusMonitor = CSPEtelCallStatusMonitor::NewL( *this, iCall ); |
1432 iCallStatusMonitor->StartMonitoring(); |
1456 iCallStatusMonitor->StartMonitoring(); |
1433 |
1457 |
1434 iCallCapsMonitor = CSPEtelCallCapsMonitor::NewL( *this, iCall ); |
1458 iCallCapsMonitor = CSPEtelCallCapsMonitor::NewL( *this, iCall ); |
1435 iCallCapsMonitor->StartMonitoring(); |
1459 iCallCapsMonitor->StartMonitoring(); |
1436 iCapsFlags = iCallCapsMonitor->FetchCallControlCapsL(); |
1460 iCapsFlags = iCallCapsMonitor->FetchCallControlCapsL(); |
1437 |
1461 |
1438 iCallInfoMonitor = CSPCallInfoMonitor::NewL( *this, iCall ); |
1462 iCallInfoMonitor = CSPCallInfoMonitor::NewL( *this, iCall ); |
1439 iCallInfoMonitor->StartMonitoring(); |
1463 iCallInfoMonitor->StartMonitoring(); |
1440 |
1464 |
1441 // Start UUI monitor and create message sender |
1465 // Start UUI monitor and create message sender |
1442 iSkypeId = TCSPSkypeIdParser::CreateSkypeIdBufferL(); |
1466 iSkypeId = TCSPSkypeIdParser::CreateSkypeIdBufferL(); |
1443 iUUIMonitor = CSPUUIMonitor::NewL( iCall,*this ); |
1467 iUUIMonitor = CSPUUIMonitor::NewL( iCall,*this ); |
1444 iUUIMonitor->StartMonitor(); |
1468 iUUIMonitor->StartMonitor(); |
1445 iUUIMessageSender = CSPUUIMessageSender::NewL( iCall ); |
1469 iUUIMessageSender = CSPUUIMessageSender::NewL( iCall ); |
1446 iUserToUserInformation = iParams->UUSId().AllocL(); |
1470 iUserToUserInformation = iParams->UUSId().AllocL(); |
1447 |
1471 |
1448 // Transfer provider |
1472 // Transfer provider |
1449 iTransferProvider = CSPTransferProvider::NewL( iCall, *this, iCommonInfo ); |
1473 iTransferProvider = CSPTransferProvider::NewL( iCall, *this, iCommonInfo ); |
1450 |
1474 |
1451 // Forward provider |
1475 // Forward provider |
1452 iForwardProvider = CSPForwardProvider::NewL(); |
1476 iForwardProvider = CSPForwardProvider::NewL(); |
1453 |
1477 |
1454 CSPLOGSTRING(CSPINT, "CSPCall::CreateCallHandlersL >"); |
1478 CSPLOGSTRING(CSPINT, "CSPCall::CreateCallHandlersL >"); |
1455 } |
1479 } |
1456 |
1480 |
1457 // --------------------------------------------------------------------------- |
1481 // --------------------------------------------------------------------------- |
1458 // CSPCall::NotifyRingingState |
1482 // CSPCall::NotifyRingingState |
1459 // Gets to ringing state |
1483 // Gets to ringing state |
1460 // --------------------------------------------------------------------------- |
1484 // --------------------------------------------------------------------------- |
1461 // |
1485 // |
1462 void CSPCall::NotifyRingingState( ) |
1486 void CSPCall::NotifyRingingState( ) |
1463 { |
1487 { |
1464 CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyRingingState"); |
1488 CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyRingingState"); |
1465 iCallState = MCCPCallObserver::ECCPStateRinging; |
1489 iCallState = MCCPCallObserver::ECCPStateRinging; |
1466 |
1490 |
1477 |
1501 |
1478 // --------------------------------------------------------------------------- |
1502 // --------------------------------------------------------------------------- |
1479 // CSPCall::CCPStateFromETelState |
1503 // CSPCall::CCPStateFromETelState |
1480 // Simple mapping between state enumerations. |
1504 // Simple mapping between state enumerations. |
1481 // --------------------------------------------------------------------------- |
1505 // --------------------------------------------------------------------------- |
1482 // |
1506 // |
1483 MCCPCallObserver::TCCPCallState CSPCall::CCPStateFromETelState( |
1507 MCCPCallObserver::TCCPCallState CSPCall::CCPStateFromETelState( |
1484 RMobileCall::TMobileCallStatus aEtelState ) |
1508 RMobileCall::TMobileCallStatus aEtelState ) |
1485 { |
1509 { |
1486 MCCPCallObserver::TCCPCallState ret = MCCPCallObserver::ECCPStateIdle; |
1510 MCCPCallObserver::TCCPCallState ret = MCCPCallObserver::ECCPStateIdle; |
1487 switch ( aEtelState ) |
1511 switch ( aEtelState ) |
1488 { |
1512 { |
1489 case RMobileCall::EStatusUnknown: |
1513 case RMobileCall::EStatusUnknown: |
1490 { |
1514 { |
1491 CSPLOGSTRING( CSPREQIN, |
1515 CSPLOGSTRING( CSPREQIN, |
1492 "CSPCall::State > RMobileCall::Unknown" ); |
1516 "CSPCall::State > RMobileCall::Unknown" ); |
1493 ret = MCCPCallObserver::ECCPStateIdle; |
1517 ret = MCCPCallObserver::ECCPStateIdle; |
1494 break; |
1518 break; |
1495 } |
1519 } |
1496 case RMobileCall::EStatusIdle: |
1520 case RMobileCall::EStatusIdle: |
1497 { |
1521 { |
1498 CSPLOGSTRING( CSPREQIN, |
1522 CSPLOGSTRING( CSPREQIN, |
1499 "CSPCall::State > RMobileCall::EStatusIdle" ); |
1523 "CSPCall::State > RMobileCall::EStatusIdle" ); |
1500 ret = MCCPCallObserver::ECCPStateIdle; |
1524 ret = MCCPCallObserver::ECCPStateIdle; |
1501 break; |
1525 break; |
1502 } |
1526 } |
1503 case RMobileCall::EStatusRinging: |
1527 case RMobileCall::EStatusRinging: |
1504 { |
1528 { |
1505 CSPLOGSTRING( CSPREQIN, |
1529 CSPLOGSTRING( CSPREQIN, |
1506 "CSPCall::State > RMobileCall::EStatusRinging" ); |
1530 "CSPCall::State > RMobileCall::EStatusRinging" ); |
1507 ret = MCCPCallObserver::ECCPStateRinging; |
1531 ret = MCCPCallObserver::ECCPStateRinging; |
1508 break; |
1532 break; |
1509 } |
1533 } |
1510 // Map the following to connecting status |
1534 // Map the following to connecting status |
1511 case RMobileCall::EStatusDialling: |
1535 case RMobileCall::EStatusDialling: |
1512 { |
1536 { |
1513 CSPLOGSTRING( CSPREQIN, "CSPCall::State > \ |
1537 CSPLOGSTRING( CSPREQIN, "CSPCall::State > \ |
1514 RMobileCall::EStatusDialling" ); |
1538 RMobileCall::EStatusDialling" ); |
1515 ret = MCCPCallObserver::ECCPStateDialling; |
1539 ret = MCCPCallObserver::ECCPStateDialling; |
1516 break; |
1540 break; |
1525 case RMobileCall::EStatusAnswering: |
1549 case RMobileCall::EStatusAnswering: |
1526 { |
1550 { |
1527 CSPLOGSTRING( CSPREQIN, "CSPCall::State > \ |
1551 CSPLOGSTRING( CSPREQIN, "CSPCall::State > \ |
1528 RMobileCall::Answering" ); |
1552 RMobileCall::Answering" ); |
1529 ret = MCCPCallObserver::ECCPStateAnswering; |
1553 ret = MCCPCallObserver::ECCPStateAnswering; |
1530 break; |
1554 break; |
1531 } |
1555 } |
1532 // Call is connected and active. |
1556 // Call is connected and active. |
1533 case RMobileCall::EStatusConnected: |
1557 case RMobileCall::EStatusConnected: |
1534 { |
1558 { |
1535 CSPLOGSTRING( CSPREQIN, |
1559 CSPLOGSTRING( CSPREQIN, |
1536 "CSPCall::State > RMobileCall::EStatusConnected" ); |
1560 "CSPCall::State > RMobileCall::EStatusConnected" ); |
1537 ret = MCCPCallObserver::ECCPStateConnected; |
1561 ret = MCCPCallObserver::ECCPStateConnected; |
1538 break; |
1562 break; |
1539 } |
1563 } |
1540 case RMobileCall::EStatusDisconnectingWithInband: |
1564 case RMobileCall::EStatusDisconnectingWithInband: |
1541 case RMobileCall::EStatusDisconnecting: |
1565 case RMobileCall::EStatusDisconnecting: |
1542 { |
1566 { |
1543 CSPLOGSTRING( CSPREQIN, |
1567 CSPLOGSTRING( CSPREQIN, |
1544 "CSPCall::State > RMobileCall::EStatusDisconnecting/Inband?"); |
1568 "CSPCall::State > RMobileCall::EStatusDisconnecting/Inband?"); |
1545 ret = MCCPCallObserver::ECCPStateDisconnecting; |
1569 ret = MCCPCallObserver::ECCPStateDisconnecting; |
1546 break; |
1570 break; |
1547 } |
1571 } |
1548 case RMobileCall::EStatusReconnectPending: |
1572 case RMobileCall::EStatusReconnectPending: |
1549 { |
1573 { |
1550 CSPLOGSTRING( CSPREQIN, |
1574 CSPLOGSTRING( CSPREQIN, |
1551 "CSPCall::State > RMobileCall::EStatusHangingUp" ); |
1575 "CSPCall::State > RMobileCall::EStatusHangingUp" ); |
1552 ret = MCCPCallObserver::ECCPStateDisconnecting; |
1576 ret = MCCPCallObserver::ECCPStateDisconnecting; |
1553 break; |
1577 break; |
1554 } |
1578 } |
1555 case RMobileCall::EStatusHold: |
1579 case RMobileCall::EStatusHold: |
1556 { |
1580 { |
1557 CSPLOGSTRING( CSPREQIN, |
1581 CSPLOGSTRING( CSPREQIN, |
1558 "CSPCall::State > RMobileCall::EStatusHold" ); |
1582 "CSPCall::State > RMobileCall::EStatusHold" ); |
1559 ret = MCCPCallObserver::ECCPStateHold; |
1583 ret = MCCPCallObserver::ECCPStateHold; |
1560 break; |
1584 break; |
1561 } |
1585 } |
1562 case RMobileCall::EStatusWaitingAlternatingCallSwitch: |
1586 case RMobileCall::EStatusWaitingAlternatingCallSwitch: |
1563 { |
1587 { |
1564 // This state is not used in real life. |
1588 // This state is not used in real life. |
1565 CSPLOGSTRING( CSPREQIN, |
1589 CSPLOGSTRING( CSPREQIN, |
1566 "CSPCall::State > RMobileCall::EStatusWaitingAlternatingCallSwitch" ); |
1590 "CSPCall::State > RMobileCall::EStatusWaitingAlternatingCallSwitch" ); |
1567 ret = MCCPCallObserver::ECCPStateConnected; |
1591 ret = MCCPCallObserver::ECCPStateConnected; |
1568 break; |
1592 break; |
1569 } |
1593 } |
1570 case RMobileCall::EStatusTransferring: |
1594 case RMobileCall::EStatusTransferring: |
1571 { |
1595 { |
1572 CSPLOGSTRING( CSPREQIN, |
1596 CSPLOGSTRING( CSPREQIN, |
1573 "CSPCall::State > RMobileCall::EStatusHold" ); |
1597 "CSPCall::State > RMobileCall::EStatusHold" ); |
1574 ret = MCCPCallObserver::ECCPStateTransferring; |
1598 ret = MCCPCallObserver::ECCPStateTransferring; |
1575 break; |
1599 break; |
1576 } |
1600 } |
1577 case RMobileCall::EStatusTransferAlerting: |
1601 case RMobileCall::EStatusTransferAlerting: |
1578 { |
1602 { |
1579 CSPLOGSTRING( CSPREQIN, |
1603 CSPLOGSTRING( CSPREQIN, |
1580 "CSPCall::State > RMobileCall::EStatusHold" ); |
1604 "CSPCall::State > RMobileCall::EStatusHold" ); |
1581 ret = MCCPCallObserver::ECCPStateTransferring; |
1605 ret = MCCPCallObserver::ECCPStateTransferring; |
1582 break; |
1606 break; |
1583 } |
1607 } |
1584 default: |
1608 default: |
1585 { |
1609 { |
1586 CSPLOGSTRING( CSPREQIN, |
1610 CSPLOGSTRING( CSPREQIN, |
1587 "CSPCall::CCPStateFromETelState unhandled state "); |
1611 "CSPCall::CCPStateFromETelState unhandled state "); |
1588 } |
1612 } |
1589 } |
1613 } |
1590 |
1614 |
1591 CSPLOGSTRING3(CSPINT, |
1615 CSPLOGSTRING3(CSPINT, |
1592 "CSPCall::CCPStateFromETelState ETel: %d CCP: %d", aEtelState, ret); |
1616 "CSPCall::CCPStateFromETelState ETel: %d CCP: %d", aEtelState, ret); |
1593 return ret; |
1617 return ret; |
1594 } |
1618 } |
1595 |
1619 |
1596 // --------------------------------------------------------------------------- |
1620 // --------------------------------------------------------------------------- |
1597 // CSPCall::NotifyCallStateChanged |
1621 // CSPCall::NotifyCallStateChanged |
1598 // Notifies observers about state changes |
1622 // Notifies observers about state changes |
1599 // --------------------------------------------------------------------------- |
1623 // --------------------------------------------------------------------------- |
1600 // |
1624 // |
1601 void CSPCall::NotifyCallStateChanged( MCCPCallObserver::TCCPCallState aState ) |
1625 void CSPCall::NotifyCallStateChanged( MCCPCallObserver::TCCPCallState aState ) |
1602 { |
1626 { |
1603 CSPLOGSTRING3(CSPINT, |
1627 CSPLOGSTRING3(CSPINT, |
1604 "CSPCall::NotifyCallStateChanged < state: %d this: %x", |
1628 "CSPCall::NotifyCallStateChanged < state: %d this: %x", |
1605 aState, this ); |
1629 aState, this ); |
1606 |
1630 |
1607 iCallState = aState; |
1631 iCallState = aState; |
1608 TBool notifyObservers( ETrue ); |
1632 TBool notifyObservers( ETrue ); |
1609 |
1633 |
1610 if ( !iMobileOriginated && MCCPCallObserver::ECCPStateRinging == aState ) |
1634 if ( !iMobileOriginated && MCCPCallObserver::ECCPStateRinging == aState ) |
1611 { |
1635 { |
1612 CSPLOGSTRING2(CSPINT, "CSPCall::No notify on ringing MT", aState); |
1636 CSPLOGSTRING2(CSPINT, "CSPCall::No notify on ringing MT", aState); |
1613 notifyObservers = EFalse; |
1637 notifyObservers = EFalse; |
1614 } |
1638 } |
1615 |
1639 |
1616 if ( notifyObservers ) |
1640 if ( notifyObservers ) |
1617 { |
1641 { |
1618 TInt obsCount = iObservers.Count(); |
1642 TInt obsCount = iObservers.Count(); |
1619 for ( TInt i = 0; i < obsCount; i++ ) |
1643 for ( TInt i = 0; i < obsCount; i++ ) |
1620 { |
1644 { |
1621 MCCPCallObserver *obs = iObservers[i]; |
1645 MCCPCallObserver *obs = iObservers[i]; |
1622 if ( obs ) |
1646 if ( obs ) |
1623 { |
1647 { |
1624 obs->CallStateChanged( aState, this ); |
1648 obs->CallStateChanged( aState, this ); |
1625 } |
1649 } |
1626 } |
1650 } |
1627 } |
1651 } |
1628 |
1652 |
1629 CSPLOGSTRING3(CSPINT, |
1653 CSPLOGSTRING3(CSPINT, |
1630 "CSPCall::NotifyCallStateChanged > state: %d this: %x", |
1654 "CSPCall::NotifyCallStateChanged > state: %d this: %x", |
1631 aState, this ); |
1655 aState, this ); |
1632 } |
1656 } |
1633 |
1657 |
1634 // --------------------------------------------------------------------------- |
1658 // --------------------------------------------------------------------------- |
1635 // CSPCall::NotifyCallStateChangedWithInband |
1659 // CSPCall::NotifyCallStateChangedWithInband |
1636 // Notifies observers about state changes |
1660 // Notifies observers about state changes |
1637 // --------------------------------------------------------------------------- |
1661 // --------------------------------------------------------------------------- |
1638 // |
1662 // |
1639 void CSPCall::NotifyCallStateChangedWithInband( |
1663 void CSPCall::NotifyCallStateChangedWithInband( |
1640 MCCPCallObserver::TCCPCallState aState ) |
1664 MCCPCallObserver::TCCPCallState aState ) |
1641 { |
1665 { |
1642 CSPLOGSTRING3(CSPINT, |
1666 CSPLOGSTRING3(CSPINT, |
1643 "CSPCall::NotifyCallStateChangedWithInBand < state: %d this: %x", |
1667 "CSPCall::NotifyCallStateChangedWithInBand < state: %d this: %x", |
1644 aState, this ); |
1668 aState, this ); |
1645 |
1669 |
1646 iCallState = aState; |
1670 iCallState = aState; |
1647 |
1671 |
1648 if ( !iMobileOriginated && MCCPCallObserver::ECCPStateRinging == aState ) |
1672 if ( !iMobileOriginated && MCCPCallObserver::ECCPStateRinging == aState ) |
1649 { |
1673 { |
1650 CSPLOGSTRING2(CSPINT, "CSPCall::No notify on ringing MT", aState); |
1674 CSPLOGSTRING2(CSPINT, "CSPCall::No notify on ringing MT", aState); |
1651 } |
1675 } |
1652 else |
1676 else |
1653 { |
1677 { |
1654 TInt obsCount = iObservers.Count(); |
1678 TInt obsCount = iObservers.Count(); |
1655 for ( TInt i = 0; i < obsCount; i++ ) |
1679 for ( TInt i = 0; i < obsCount; i++ ) |
1656 { |
1680 { |
1657 MCCPCallObserver *obs = iObservers[i]; |
1681 MCCPCallObserver *obs = iObservers[i]; |
1658 if ( obs ) |
1682 if ( obs ) |
1659 { |
1683 { |
1660 obs->CallStateChangedWithInband( aState, this ); |
1684 obs->CallStateChangedWithInband( aState, this ); |
1661 } |
1685 } |
1662 } |
1686 } |
1663 } |
1687 } |
1664 CSPLOGSTRING3(CSPINT, |
1688 CSPLOGSTRING3(CSPINT, |
1665 "CSPCall::NotifyCallStateChangedWithInband > state: %d this: %x", |
1689 "CSPCall::NotifyCallStateChangedWithInband > state: %d this: %x", |
1666 aState, this); |
1690 aState, this); |
1667 } |
1691 } |
1668 |
1692 |
1669 // --------------------------------------------------------------------------- |
1693 // --------------------------------------------------------------------------- |
1670 // CSPCall::ReadRepositoryL |
1694 // CSPCall::ReadRepositoryL |
1686 // Reads error code from ETel. |
1710 // Reads error code from ETel. |
1687 // --------------------------------------------------------------------------- |
1711 // --------------------------------------------------------------------------- |
1688 // |
1712 // |
1689 void CSPCall::CheckAndNotifyTerminationError() |
1713 void CSPCall::CheckAndNotifyTerminationError() |
1690 { |
1714 { |
1691 CSPLOGSTRING2(CSPINT, |
1715 CSPLOGSTRING2(CSPINT, |
1692 "CSPCall::CheckAndNotifyTerminationError dial completion code: %d", |
1716 "CSPCall::CheckAndNotifyTerminationError dial completion code: %d", |
1693 iDialCompletionCode); |
1717 iDialCompletionCode); |
1694 |
1718 |
1695 // Emergency error handling is separated into CSPEtelCallRequester |
1719 // Emergency error handling is separated into CSPEtelCallRequester |
1696 if ( !iIsEmergencyCall ) |
1720 if ( !iIsEmergencyCall ) |
1697 { |
1721 { |
1698 TInt termErr = ExitCodeError(); |
1722 TInt termErr = ExitCodeError(); |
1699 CSPLOGSTRING2(CSPINT, |
1723 CSPLOGSTRING2(CSPINT, |
1700 "CSPCall::CheckAndNotifyTerminationError exit code error: %d", |
1724 "CSPCall::CheckAndNotifyTerminationError exit code error: %d", |
1701 termErr); |
1725 termErr); |
1702 |
1726 |
1703 if ( termErr == KErrNone ) |
1727 if ( termErr == KErrNone ) |
1704 { |
1728 { |
1705 // Handle KErrGsmCCUnassignedNumber correctly |
1729 // Handle KErrGsmCCUnassignedNumber correctly |
1706 // because the value is not stored in exit code. |
1730 // because the value is not stored in exit code. |
1707 termErr = iDialCompletionCode; |
1731 termErr = iDialCompletionCode; |
1708 CSPLOGSTRING(CSPINT, |
1732 CSPLOGSTRING(CSPINT, |
1709 "CSPCall::CheckAndNotifyTerminationError use dial completion code"); |
1733 "CSPCall::CheckAndNotifyTerminationError use dial completion code"); |
1710 } |
1734 } |
1711 |
1735 |
1712 if ( termErr == KErrGsmRRPreEmptiveRelease ) |
1736 if ( termErr == KErrGsmRRPreEmptiveRelease ) |
1713 { |
1737 { |
1714 // Error KErrGsmRRPreEmptiveRelease occurs when there is active call |
1738 // Error KErrGsmRRPreEmptiveRelease occurs when there is active call |
1715 // and user make emergency call, can be ignored. |
1739 // and user make emergency call, can be ignored. |
1716 CSPLOGSTRING3( |
1740 CSPLOGSTRING3( |
1717 CSPERROR, |
1741 CSPERROR, |
1718 "CSPCall::CheckAndNotifyTerminationError preemptive release, ignore: %d", |
1742 "CSPCall::CheckAndNotifyTerminationError preemptive release, ignore: %d", |
1719 termErr, |
1743 termErr, |
1720 this ); |
1744 this ); |
1721 } |
1745 } |
1722 else if ( iDontReportTerm |
1746 else if ( iDontReportTerm |
1723 && ( termErr == KErrGsmCCNormalUnspecified |
1747 && ( termErr == KErrGsmCCNormalUnspecified |
1724 || termErr == KErrGsmCCCallRejected ) ) |
1748 || termErr == KErrGsmCCCallRejected ) ) |
1725 { |
1749 { |
1726 // Not an error, since this happens on normal |
1750 // Not an error, since this happens on normal |
1727 // call termination situation after connected call. |
1751 // call termination situation after connected call. |
1728 CSPLOGSTRING3(CSPERROR, |
1752 CSPLOGSTRING3(CSPERROR, |
1729 "CSPCall::CheckAndNotifyTerminationError DISCARD this: %x err: %d", |
1753 "CSPCall::CheckAndNotifyTerminationError DISCARD this: %x err: %d", |
1730 this, |
1754 this, |
1731 termErr); |
1755 termErr); |
1732 } |
1756 } |
1733 else if ( termErr ) |
1757 else if ( termErr ) |
1734 { |
1758 { |
1735 TCCPError ccpErr(ECCPErrorNone); |
1759 TCCPError ccpErr(ECCPErrorNone); |
1736 |
1760 |
1737 // Only a couple of error codes can have diagnostic information. |
1761 // Only a couple of error codes can have diagnostic information. |
1738 // aDiagnostic ought to be undefined in other situatios, |
1762 // aDiagnostic ought to be undefined in other situatios, |
1739 // but at least in this way we can really guarantee it. |
1763 // but at least in this way we can really guarantee it. |
1740 if ( termErr == KErrGsmCCFacilityRejected || |
1764 if ( termErr == KErrGsmCCFacilityRejected || |
1741 termErr == KErrGsmCCRequestedFacilityNotSubscribed || |
1765 termErr == KErrGsmCCRequestedFacilityNotSubscribed || |
1742 termErr == KErrGsmCCIncomingCallsBarredInCug || |
1766 termErr == KErrGsmCCIncomingCallsBarredInCug || |
1743 termErr == KErrGsmCCRequestedFacilityNotImplemented || |
1767 termErr == KErrGsmCCRequestedFacilityNotImplemented || |
1744 termErr == KErrGsmCCUserNotInCug ) |
1768 termErr == KErrGsmCCUserNotInCug ) |
1745 { |
1769 { |
1746 TName name; |
1770 TName name; |
1747 CallName( name ); |
1771 CallName( name ); |
1748 TInt diagErr = iCommonInfo.GetDiagnosticError( name ); |
1772 TInt diagErr = iCommonInfo.GetDiagnosticError( name ); |
1749 ccpErr = iRequester->MapError( diagErr ); |
1773 ccpErr = iRequester->MapError( diagErr ); |
1750 |
1774 |
1751 // Finally use exit code if diagnostic did not contain |
1775 // Finally use exit code if diagnostic did not contain |
1752 // any useful information. |
1776 // any useful information. |
1753 if ( ccpErr == ECCPRequestFailure ) |
1777 if ( ccpErr == ECCPRequestFailure ) |
1754 { |
1778 { |
1755 ccpErr = iRequester->MapError( termErr ); |
1779 ccpErr = iRequester->MapError( termErr ); |
1795 callError = KErrNone; |
1819 callError = KErrNone; |
1796 } |
1820 } |
1797 else |
1821 else |
1798 { |
1822 { |
1799 callError = ( ( iEtelCallInfo.iExitCode & 0x0000FFFF ) |
1823 callError = ( ( iEtelCallInfo.iExitCode & 0x0000FFFF ) |
1800 | 0xFFFF0000 ); |
1824 | 0xFFFF0000 ); |
1801 } |
1825 } |
1802 } |
1826 } |
1803 } |
1827 } |
1804 // Higher and lower 16 bits are zero |
1828 // Higher and lower 16 bits are zero |
1805 else if ( !( iEtelCallInfo.iExitCode & 0xFFFFFFFF ) ) |
1829 else if ( !( iEtelCallInfo.iExitCode & 0xFFFFFFFF ) ) |
1806 { |
1830 { |
1807 callError = KErrNone; |
1831 callError = KErrNone; |
1808 } |
1832 } |
1809 else |
1833 else |
1810 { |
1834 { |
1811 // No extended error, expand value to full range |
1835 // No extended error, expand value to full range |
1812 callError = ( iEtelCallInfo.iExitCode | 0xFFFF0000 ); |
1836 callError = ( iEtelCallInfo.iExitCode | 0xFFFF0000 ); |
1813 } |
1837 } |
1814 |
1838 |
1815 CSPLOGSTRING2(CSPINT, "CSPCall::ExitCodeError > err: %d", callError); |
1839 CSPLOGSTRING2(CSPINT, "CSPCall::ExitCodeError > err: %d", callError); |
1816 |
1840 |
1817 return callError; |
1841 return callError; |
1818 } |
1842 } |
1819 |
1843 |
1820 // --------------------------------------------------------------------------- |
1844 // --------------------------------------------------------------------------- |
1821 // CSPCall::UUSMessageReceived |
1845 // CSPCall::UUSMessageReceived |
1822 // --------------------------------------------------------------------------- |
1846 // --------------------------------------------------------------------------- |
1823 // |
1847 // |
1824 void CSPCall::UUSMessageReceived( const TDesC& aMessage ) |
1848 void CSPCall::UUSMessageReceived( const TDesC& aMessage ) |
1825 { |
1849 { |
1826 CSPLOGSTRING(CSPREQIN, "CSPCall::UUSMessageReceived"); |
1850 CSPLOGSTRING(CSPREQIN, "CSPCall::UUSMessageReceived"); |
1827 TCSPSkypeIdParser parser; |
1851 TCSPSkypeIdParser parser; |
1828 |
1852 |
1829 TPtr ptr = iSkypeId->Des(); |
1853 TPtr ptr = iSkypeId->Des(); |
1830 ptr.Zero(); |
1854 ptr.Zero(); |
1831 const TInt error( parser.Parse( aMessage, ptr ) ); |
1855 const TInt error( parser.Parse( aMessage, ptr ) ); |
1832 |
1856 |
1833 if ( !error ) |
1857 if ( !error ) |
1834 { |
1858 { |
1835 iRemotePartyName = ptr; |
1859 iRemotePartyName = ptr; |
1836 NotifyCallEventOccurred( MCCPCallObserver::ECCPNotifyRemotePartyInfoChange ); |
1860 NotifyCallEventOccurred( MCCPCallObserver::ECCPNotifyRemotePartyInfoChange ); |
1837 } |
1861 } |
1838 CSPLOGSTRING2(CSPINT, "CSPCall::UUSMessageReceived err: %d", error ); |
1862 CSPLOGSTRING2(CSPINT, "CSPCall::UUSMessageReceived err: %d", error ); |
1839 } |
1863 } |
1840 |
1864 |
1841 // --------------------------------------------------------------------------- |
1865 // --------------------------------------------------------------------------- |
1842 // CSPCall::NotifyRemotePartyInfoChanged |
1866 // CSPCall::NotifyRemotePartyInfoChanged |
1843 // --------------------------------------------------------------------------- |
1867 // --------------------------------------------------------------------------- |
1844 // |
1868 // |
1845 void CSPCall::NotifyRemotePartyInfoChanged( const TDesC& aRemotePartyName, |
1869 void CSPCall::NotifyRemotePartyInfoChanged( const TDesC& aRemotePartyName, |
1846 const TDesC& aRemotePartyNumber ) |
1870 const TDesC& aRemotePartyNumber ) |
1847 { |
1871 { |
1848 CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyRemotePartyInfoChanged"); |
1872 CSPLOGSTRING(CSPREQIN, "CSPCall::NotifyRemotePartyInfoChanged"); |
1849 if ( aRemotePartyName.Length() ) |
1873 if ( aRemotePartyName.Length() ) |
1850 { |
1874 { |
1851 iRemotePartyName = aRemotePartyName; |
1875 iRemotePartyName = aRemotePartyName; |
1852 } |
1876 } |
1853 |
1877 |
1854 if ( aRemotePartyNumber.Length() ) |
1878 if ( aRemotePartyNumber.Length() ) |
1855 { |
1879 { |
1856 iRemotePartyNumber = aRemotePartyNumber; |
1880 iRemotePartyNumber = aRemotePartyNumber; |
1857 } |
1881 } |
1858 |
1882 |
1859 NotifyCallEventOccurred( MCCPCallObserver::ECCPNotifyRemotePartyInfoChange ); |
1883 NotifyCallEventOccurred( MCCPCallObserver::ECCPNotifyRemotePartyInfoChange ); |
1860 } |
1884 } |
1861 |
1885 |
1862 // --------------------------------------------------------------------------- |
1886 // --------------------------------------------------------------------------- |
1863 // CSPCall::DontReportTerminationError |
1887 // CSPCall::DontReportTerminationError |
1864 // --------------------------------------------------------------------------- |
1888 // --------------------------------------------------------------------------- |
1865 // |
1889 // |
1866 void CSPCall::DontReportTerminationError() |
1890 void CSPCall::DontReportTerminationError() |
1867 { |
1891 { |
1868 CSPLOGSTRING(CSPREQIN, "CSPCall::DontReportTerminationError"); |
1892 CSPLOGSTRING(CSPREQIN, "CSPCall::DontReportTerminationError"); |
1869 iDontReportTerm = ETrue; |
1893 iDontReportTerm = ETrue; |
1870 } |
1894 } |
1871 |
1895 |
1881 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallNameNumberInfo <"); |
1905 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallNameNumberInfo <"); |
1882 |
1906 |
1883 iCallName.Zero(); |
1907 iCallName.Zero(); |
1884 iRemotePartyNumber.Zero(); |
1908 iRemotePartyNumber.Zero(); |
1885 iRemotePartyName.Zero(); |
1909 iRemotePartyName.Zero(); |
1886 |
1910 |
1887 if ( aCallAddedByMonitor ) |
1911 if ( aCallAddedByMonitor ) |
1888 { |
1912 { |
1889 CSPLOGSTRING(CSPINT, |
1913 CSPLOGSTRING(CSPINT, |
1890 "CSPCall::UpdateCallNameNumberInfo call added by monitor"); |
1914 "CSPCall::UpdateCallNameNumberInfo call added by monitor"); |
1891 |
1915 |
1892 // If call was created by ETel line status or incoming call monitor |
1916 // If call was created by ETel line status or incoming call monitor |
1893 // the call name is already known, only remote party info is fetched from |
1917 // the call name is already known, only remote party info is fetched from |
1894 // call info |
1918 // call info |
1895 iCallName.Append( iName ); |
1919 iCallName.Append( iName ); |
1896 iRemotePartyName.Append( aCallInfo.iRemoteParty.iCallingName ); |
1920 iRemotePartyName.Append( aCallInfo.iRemoteParty.iCallingName ); |
1897 iRemotePartyNumber.Append( aCallInfo.iRemoteParty.iRemoteNumber.iTelNumber ); |
1921 iRemotePartyNumber.Append( aCallInfo.iRemoteParty.iRemoteNumber.iTelNumber ); |
1898 } |
1922 } |
1899 else |
1923 else |
1900 { |
1924 { |
1901 CSPLOGSTRING(CSPINT, |
1925 CSPLOGSTRING(CSPINT, |
1902 "CSPCall::UpdateCallNameNumberInfo call added by plugin owner"); |
1926 "CSPCall::UpdateCallNameNumberInfo call added by plugin owner"); |
1903 |
1927 |
1904 // The call was not created by monitor and the remote number is already known, |
1928 // The call was not created by monitor and the remote number is already known, |
1905 // fetch only call name from call info |
1929 // fetch only call name from call info |
1906 iCallName.Append( aCallInfo.iCallName ); |
1930 iCallName.Append( aCallInfo.iCallName ); |
1907 iRemotePartyNumber.Append( iName ); |
1931 iRemotePartyNumber.Append( iName ); |
1908 } |
1932 } |
1909 |
1933 |
1910 CSPLOGSTRING2(CSPINT, |
1934 CSPLOGSTRING2(CSPINT, |
1911 "CSPCall::UpdateCallNameNumberInfo iCallName: %S", &iCallName ); |
1935 "CSPCall::UpdateCallNameNumberInfo iCallName: %S", &iCallName ); |
1912 CSPLOGSTRING2(CSPINT, |
1936 CSPLOGSTRING2(CSPINT, |
1913 "CSPCall::UpdateCallNameNumberInfo iRemotePartyNumber: %S", &iRemotePartyNumber ); |
1937 "CSPCall::UpdateCallNameNumberInfo iRemotePartyNumber: %S", &iRemotePartyNumber ); |
1914 CSPLOGSTRING2(CSPINT, |
1938 CSPLOGSTRING2(CSPINT, |
1915 "CSPCall::UpdateCallNameNumberInfo iRemotePartyName: %S", &iRemotePartyName ); |
1939 "CSPCall::UpdateCallNameNumberInfo iRemotePartyName: %S", &iRemotePartyName ); |
1916 |
1940 |
1917 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallNameNumberInfo >"); |
1941 CSPLOGSTRING(CSPINT, "CSPCall::UpdateCallNameNumberInfo >"); |
1918 } |
1942 } |
1919 |
1943 |
1920 // --------------------------------------------------------------------------- |
1944 // --------------------------------------------------------------------------- |
1921 // CSPCall::OpenNewCall |
1945 // CSPCall::OpenNewCall |
1922 // Open new call |
1946 // Open new call |
1923 // --------------------------------------------------------------------------- |
1947 // --------------------------------------------------------------------------- |
1924 // |
1948 // |
1925 void CSPCall::OpenNewCall() |
1949 void CSPCall::OpenNewCall() |
1926 { |
1950 { |
1927 CSPLOGSTRING(CSPINT, "CSPCall::OpenNewCall <"); |
1951 CSPLOGSTRING(CSPINT, "CSPCall::OpenNewCall <"); |
1928 |
1952 |
1929 // Open new call |
1953 // Open new call |
1930 __ASSERT_ALWAYS( iCall.OpenNewCall( iLine ) == KErrNone, |
1954 __ASSERT_ALWAYS( iCall.OpenNewCall( iLine ) == KErrNone, |
1931 Panic( ECSPPanicNoEtel ) ); |
1955 Panic( ECSPPanicNoEtel ) ); |
1932 |
1956 |
1933 CSPLOGSTRING(CSPINT, "CSPCall::OpenNewCall >"); |
1957 CSPLOGSTRING(CSPINT, "CSPCall::OpenNewCall >"); |
1934 } |
1958 } |
1935 |
1959 |
1936 // --------------------------------------------------------------------------- |
1960 // --------------------------------------------------------------------------- |
1937 // CSPCall::OpenExistingCallL |
1961 // CSPCall::OpenExistingCallL |
1938 // Open existing call |
1962 // Open existing call |
1939 // --------------------------------------------------------------------------- |
1963 // --------------------------------------------------------------------------- |
1940 // |
1964 // |
1941 void CSPCall::OpenExistingCallL( const TDesC& aName ) |
1965 void CSPCall::OpenExistingCallL( const TDesC& aName ) |
1942 { |
1966 { |
1943 CSPLOGSTRING2(CSPINT, |
1967 CSPLOGSTRING2(CSPINT, |
1944 "CSPCall::OpenExistingCallL < aName: %S", &aName); |
1968 "CSPCall::OpenExistingCallL < aName: %S", &aName); |
1945 |
1969 |
1946 // Open existing call with given name from current line |
1970 // Open existing call with given name from current line |
1947 TInt err = iCall.OpenExistingCall( iLine, aName ); |
1971 TInt err = iCall.OpenExistingCall( iLine, aName ); |
1948 |
1972 |
1949 if ( KErrNone != err ) |
1973 if ( KErrNone != err ) |
1950 { |
1974 { |
1951 CSPLOGSTRING2(CSPERROR, |
1975 CSPLOGSTRING2(CSPERROR, |
1952 "CSPCall::OpenCallHandleL OpenExistingCall error: %d, leaving", err); |
1976 "CSPCall::OpenCallHandleL OpenExistingCall error: %d, leaving", err); |
1953 User::Leave( err ); |
1977 User::Leave( err ); |
1954 } |
1978 } |
1955 |
1979 |
1956 CSPLOGSTRING(CSPINT, "CSPCall::OpenExistingCallL >"); |
1980 CSPLOGSTRING(CSPINT, "CSPCall::OpenExistingCallL >"); |
1957 } |
1981 } |