101 } |
103 } |
102 else |
104 else |
103 { |
105 { |
104 profile = iProfileRegistry->DefaultProfileL(); |
106 profile = iProfileRegistry->DefaultProfileL(); |
105 } |
107 } |
106 |
108 CleanupStack::PushL( profile ); |
|
109 TBool profileRegistered = EFalse; |
|
110 User::LeaveIfError( profile->GetParameter( KSIPProfileRegistered, |
|
111 profileRegistered ) ); |
|
112 CleanupStack::Pop( profile ); |
107 delete iSipProfile; |
113 delete iSipProfile; |
108 iSipProfile = profile; |
114 iSipProfile = profile; |
109 } |
115 } |
110 |
116 |
|
117 |
111 // ----------------------------------------------------------------------------- |
118 // ----------------------------------------------------------------------------- |
112 // |
119 // |
113 // ----------------------------------------------------------------------------- |
120 // ----------------------------------------------------------------------------- |
114 // |
121 // |
115 CSIPProfile* CMusSipProfileHandler::Profile() |
122 CSIPProfile* CMusSipProfileHandler::Profile() |
116 { |
123 { |
117 return iSipProfile; |
124 return iSipProfile; |
118 } |
125 } |
|
126 |
|
127 #if 0 //TODO: should this be removed? |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 // ----------------------------------------------------------------------------- |
|
131 // |
|
132 CSIPProfile& CMusSipProfileHandler::SipProfileL( TInt aSipProfileId ) |
|
133 { |
|
134 MUS_LOG1( "mus: [ENGINE] -> CMusSipProfileHandler::SipProfileL(),\ |
|
135 od #%d", aSipProfileId ) |
|
136 |
|
137 if ( !iSipProfile ) |
|
138 { |
|
139 if ( aSipProfileId != 0 ) |
|
140 { |
|
141 iSipProfile = iProfileRegistry->ProfileL( aSipProfileId ); |
|
142 } |
|
143 else |
|
144 { |
|
145 iSipProfile = iProfileRegistry->DefaultProfileL(); |
|
146 } |
|
147 } |
|
148 |
|
149 // The parameter val indicates if the profile can be immediately |
|
150 // used for creating a session, or if the client must wait for |
|
151 // the profile to be registered. |
|
152 TBool profileRegistered = EFalse; |
|
153 |
|
154 User::LeaveIfError( iSipProfile->GetParameter( KSIPProfileRegistered, |
|
155 profileRegistered ) ); |
|
156 |
|
157 if ( !profileRegistered ) |
|
158 { |
|
159 |
|
160 #if (defined (__WINS__) || defined(__WINSCW__)) |
|
161 |
|
162 iProfileRegistry->EnableL( *iSipProfile, *this ); |
|
163 |
|
164 User::LeaveIfError( iSipProfile->GetParameter( KSIPProfileRegistered, |
|
165 profileRegistered ) ); |
|
166 |
|
167 if( !profileRegistered ) |
|
168 { |
|
169 CActiveScheduler::Start(); |
|
170 |
|
171 User::LeaveIfError( iSipProfile->GetParameter( |
|
172 KSIPProfileRegistered, |
|
173 profileRegistered ) ); |
|
174 |
|
175 if ( !profileRegistered ) |
|
176 { |
|
177 User::Leave( KErrNotReady ); |
|
178 } |
|
179 } |
|
180 |
|
181 #else |
|
182 |
|
183 User::Leave( KErrNotReady ); |
|
184 |
|
185 #endif |
|
186 |
|
187 } |
|
188 |
|
189 |
|
190 MUS_LOG( "mus: [ENGINE] <- CMusSipProfileHandler::SipProfileL()" ) |
|
191 |
|
192 return *iSipProfile; |
|
193 } |
|
194 #endif |
|
195 |
119 |
196 |
120 // ----------------------------------------------------------------------------- |
197 // ----------------------------------------------------------------------------- |
121 // |
198 // |
122 // ----------------------------------------------------------------------------- |
199 // ----------------------------------------------------------------------------- |
123 // |
200 // |
127 |
204 |
128 __ASSERT_ALWAYS( iSipProfile != NULL, User::Leave( KErrNotReady ) ); |
205 __ASSERT_ALWAYS( iSipProfile != NULL, User::Leave( KErrNotReady ) ); |
129 |
206 |
130 const MDesC8Array* aors = NULL; |
207 const MDesC8Array* aors = NULL; |
131 User::LeaveIfError( iSipProfile->GetParameter( KSIPRegisteredAors, aors ) ); |
208 User::LeaveIfError( iSipProfile->GetParameter( KSIPRegisteredAors, aors ) ); |
132 __ASSERT_ALWAYS( aors && aors->MdcaCount() > 0, |
209 if( !aors || aors->MdcaCount() <= 0 ) |
133 User::Leave( KErrArgument ) ); |
210 { |
134 |
211 User::Leave( KErrArgument ); |
|
212 } |
135 TUriParser8 parser; |
213 TUriParser8 parser; |
136 User::LeaveIfError( parser.Parse( aors->MdcaPoint( 0 ) ) ); |
214 User::LeaveIfError( parser.Parse( aors->MdcaPoint( 0 ) ) ); |
137 MUS_LOG( "mus: [ENGINE] <- CMusSipProfileHandler::UserFromProfileLC()" ) |
215 MUS_LOG( "mus: [ENGINE] <- CMusSipProfileHandler::UserFromProfileLC()" ) |
138 |
216 |
139 return CUri8::NewLC( parser ); |
217 return CUri8::NewLC( parser ); |
149 TRAP_IGNORE( iProfileAlrController->RefreshIapAvailabilityL( ProfileId() ) ) |
227 TRAP_IGNORE( iProfileAlrController->RefreshIapAvailabilityL( ProfileId() ) ) |
150 } |
228 } |
151 |
229 |
152 |
230 |
153 // ----------------------------------------------------------------------------- |
231 // ----------------------------------------------------------------------------- |
154 // This function should never be called before creating a profile, but such |
|
155 // a situation will be considered as pending registration. |
|
156 // ----------------------------------------------------------------------------- |
|
157 // |
|
158 TBool CMusSipProfileHandler::IsRegistered() |
|
159 { |
|
160 MUS_LOG( "mus: [ENGINE] -> CMusSipProfileHandler::IsRegistered()" ) |
|
161 |
|
162 TBool profileRegistered = EFalse; |
|
163 if ( iSipProfile ) |
|
164 { |
|
165 iSipProfile->GetParameter( KSIPProfileRegistered, profileRegistered ); |
|
166 } |
|
167 |
|
168 MUS_LOG1( "mus: [ENGINE] <- CMusSipProfileHandler::IsRegistered( %d )", |
|
169 profileRegistered ) |
|
170 |
|
171 return profileRegistered; |
|
172 } |
|
173 |
|
174 |
|
175 // ----------------------------------------------------------------------------- |
|
176 // |
232 // |
177 // ----------------------------------------------------------------------------- |
233 // ----------------------------------------------------------------------------- |
178 // |
234 // |
179 void CMusSipProfileHandler::ProfileRegistryEventOccurred( |
235 void CMusSipProfileHandler::ProfileRegistryEventOccurred( |
180 TUint32 aProfileId, |
236 TUint32 /*aProfileId*/, |
181 MSIPProfileRegistryObserver::TEvent aEvent ) |
237 MSIPProfileRegistryObserver::TEvent /*aEvent*/ ) |
182 { |
238 { |
183 if ( iSipProfile && aProfileId == ProfileId() ) |
|
184 { |
|
185 switch ( aEvent ) |
|
186 { |
|
187 case MSIPProfileRegistryObserver::EProfileRegistered: |
|
188 { |
|
189 iUser.ProfileRegistered(); |
|
190 break; |
|
191 } |
|
192 default: |
|
193 { |
|
194 break; |
|
195 } |
|
196 } |
|
197 } |
|
198 } |
239 } |
199 |
240 |
200 |
241 |
201 // ----------------------------------------------------------------------------- |
242 // ----------------------------------------------------------------------------- |
202 // |
243 // |
254 { |
294 { |
255 // Ownership transferred, should not ever be called by SIP though |
295 // Ownership transferred, should not ever be called by SIP though |
256 delete aTransaction; |
296 delete aTransaction; |
257 } |
297 } |
258 |
298 |
|
299 |
259 // ----------------------------------------------------------------------------- |
300 // ----------------------------------------------------------------------------- |
260 // |
301 // |
261 // ----------------------------------------------------------------------------- |
302 // ----------------------------------------------------------------------------- |
262 // |
303 // |
263 void CMusSipProfileHandler::IncomingResponse( |
304 void CMusSipProfileHandler::IncomingResponse( |
264 CSIPClientTransaction& /*aTransaction*/) |
305 CSIPClientTransaction& /*aTransaction*/) |
265 { |
306 { |
266 } |
307 } |
|
308 |
267 |
309 |
268 // ----------------------------------------------------------------------------- |
310 // ----------------------------------------------------------------------------- |
269 // |
311 // |
270 // ----------------------------------------------------------------------------- |
312 // ----------------------------------------------------------------------------- |
271 // |
313 // |
285 { |
328 { |
286 // Ownership transferred, should not ever be called by SIP though |
329 // Ownership transferred, should not ever be called by SIP though |
287 delete aDialogAssoc; |
330 delete aDialogAssoc; |
288 } |
331 } |
289 |
332 |
|
333 |
290 // ----------------------------------------------------------------------------- |
334 // ----------------------------------------------------------------------------- |
291 // |
335 // |
292 // ----------------------------------------------------------------------------- |
336 // ----------------------------------------------------------------------------- |
293 // |
337 // |
294 void CMusSipProfileHandler::IncomingResponse( |
338 void CMusSipProfileHandler::IncomingResponse( |
295 CSIPClientTransaction& /*aTransaction*/, |
339 CSIPClientTransaction& /*aTransaction*/, |
296 CSIPRegistrationBinding& /*aRegistration*/ ) |
340 CSIPRegistrationBinding& /*aRegistration*/ ) |
297 { |
341 { |
298 } |
342 } |
|
343 |
299 |
344 |
300 // ----------------------------------------------------------------------------- |
345 // ----------------------------------------------------------------------------- |
301 // |
346 // |
302 // ----------------------------------------------------------------------------- |
347 // ----------------------------------------------------------------------------- |
303 // |
348 // |
304 void CMusSipProfileHandler::ErrorOccured( |
349 void CMusSipProfileHandler::ErrorOccured( |
305 TInt /*aError*/, |
350 TInt /*aError*/, |
306 CSIPTransactionBase& /*aTransaction*/ ) |
351 CSIPTransactionBase& /*aTransaction*/ ) |
307 { |
352 { |
308 } |
353 } |
|
354 |
309 |
355 |
310 // ----------------------------------------------------------------------------- |
356 // ----------------------------------------------------------------------------- |
311 // |
357 // |
312 // ----------------------------------------------------------------------------- |
358 // ----------------------------------------------------------------------------- |
313 // |
359 // |
327 CSIPTransactionBase& /*aTransaction*/, |
374 CSIPTransactionBase& /*aTransaction*/, |
328 CSIPDialogAssocBase& /*aDialogAssoc*/ ) |
375 CSIPDialogAssocBase& /*aDialogAssoc*/ ) |
329 { |
376 { |
330 } |
377 } |
331 |
378 |
|
379 |
332 // ----------------------------------------------------------------------------- |
380 // ----------------------------------------------------------------------------- |
333 // |
381 // |
334 // ----------------------------------------------------------------------------- |
382 // ----------------------------------------------------------------------------- |
335 // |
383 // |
336 void CMusSipProfileHandler::ErrorOccured( |
384 void CMusSipProfileHandler::ErrorOccured( |
337 TInt /*aError*/, |
385 TInt /*aError*/, |
338 CSIPRefresh& /*aSIPRefresh*/ ) |
386 CSIPRefresh& /*aSIPRefresh*/ ) |
339 { |
387 { |
340 } |
388 } |
341 |
389 |
|
390 |
342 // ----------------------------------------------------------------------------- |
391 // ----------------------------------------------------------------------------- |
343 // |
392 // |
344 // ----------------------------------------------------------------------------- |
393 // ----------------------------------------------------------------------------- |
345 // |
394 // |
346 void CMusSipProfileHandler::ErrorOccured( |
395 void CMusSipProfileHandler::ErrorOccured( |
347 TInt /*aError*/, |
396 TInt /*aError*/, |
348 CSIPRegistrationBinding& /*aRegistration*/ ) |
397 CSIPRegistrationBinding& /*aRegistration*/ ) |
349 { |
398 { |
350 } |
399 } |
351 |
400 |
|
401 |
352 // ----------------------------------------------------------------------------- |
402 // ----------------------------------------------------------------------------- |
353 // |
403 // |
354 // ----------------------------------------------------------------------------- |
404 // ----------------------------------------------------------------------------- |
355 // |
405 // |
356 void CMusSipProfileHandler::ErrorOccured( |
406 void CMusSipProfileHandler::ErrorOccured( |
357 TInt /*aError*/, |
407 TInt /*aError*/, |
358 CSIPDialogAssocBase& /*aDialogAssoc*/ ) |
408 CSIPDialogAssocBase& /*aDialogAssoc*/ ) |
359 { |
409 { |
360 } |
410 } |
361 |
411 |
|
412 |
362 // ----------------------------------------------------------------------------- |
413 // ----------------------------------------------------------------------------- |
363 // |
414 // |
364 // ----------------------------------------------------------------------------- |
415 // ----------------------------------------------------------------------------- |
365 // |
416 // |
366 void CMusSipProfileHandler::InviteCompleted( |
417 void CMusSipProfileHandler::InviteCompleted( |
367 CSIPClientTransaction& /*aTransaction*/ ) |
418 CSIPClientTransaction& /*aTransaction*/ ) |
368 { |
419 { |
369 } |
420 } |
370 |
421 |
|
422 |
371 // ----------------------------------------------------------------------------- |
423 // ----------------------------------------------------------------------------- |
372 // |
424 // |
373 // ----------------------------------------------------------------------------- |
425 // ----------------------------------------------------------------------------- |
374 // |
426 // |
375 void CMusSipProfileHandler::InviteCanceled( |
427 void CMusSipProfileHandler::InviteCanceled( |
376 CSIPServerTransaction& /*aTransaction*/ ) |
428 CSIPServerTransaction& /*aTransaction*/ ) |
377 { |
429 { |
378 } |
430 MUS_LOG( "mus: [ENGINE] CMusSipProfileHandler::CSIPServerTransaction") |
|
431 } |
|
432 |
379 |
433 |
380 // ----------------------------------------------------------------------------- |
434 // ----------------------------------------------------------------------------- |
381 // |
435 // |
382 // ----------------------------------------------------------------------------- |
436 // ----------------------------------------------------------------------------- |
383 // |
437 // |
384 void CMusSipProfileHandler::ConnectionStateChanged( |
438 void CMusSipProfileHandler::ConnectionStateChanged( |
385 CSIPConnection::TState /*aState*/ ) |
439 CSIPConnection::TState /*aState*/ ) |
386 { |
440 { |
387 } |
441 } |
|
442 |
388 |
443 |
389 // ----------------------------------------------------------------------------- |
444 // ----------------------------------------------------------------------------- |
390 // CMusSipProfileHandler::AlrEvent |
445 // CMusSipProfileHandler::AlrEvent |
391 // From MSipProfileAlrObserver |
446 // From MSipProfileAlrObserver |
392 // ----------------------------------------------------------------------------- |
447 // ----------------------------------------------------------------------------- |