41 // ----------------------------------------------------------------------------- |
41 // ----------------------------------------------------------------------------- |
42 // CMceStateOffering::CMceStateOffering |
42 // CMceStateOffering::CMceStateOffering |
43 // ----------------------------------------------------------------------------- |
43 // ----------------------------------------------------------------------------- |
44 // |
44 // |
45 CMceStateOffering::CMceStateOffering () |
45 CMceStateOffering::CMceStateOffering () |
46 : CMceState( KMceStateOffering ) |
46 : CMceState( KMceStateOffering ), |
|
47 iLastResponse ( 0 ), |
|
48 iReadyToSendACK ( ETrue ) |
47 { |
49 { |
48 } |
50 } |
49 |
51 |
50 |
52 |
51 // ----------------------------------------------------------------------------- |
53 // ----------------------------------------------------------------------------- |
262 TMceStateTransitionEvent& aEvent ) |
264 TMceStateTransitionEvent& aEvent ) |
263 { |
265 { |
264 TInt status = KErrNone; |
266 TInt status = KErrNone; |
265 CMceSipSession& session = aEvent.Session(); |
267 CMceSipSession& session = aEvent.Session(); |
266 CSIPClientTransaction& response = session.Response(); |
268 CSIPClientTransaction& response = session.Response(); |
|
269 iLastResponse = MceSip::ResponseCode( response ); |
267 |
270 |
268 session.Extensions().UpdateL( response ); |
271 session.Extensions().UpdateL( response ); |
269 session.Actions().CheckContactIsSecureL( response ); |
272 session.Actions().CheckContactIsSecureL( response ); |
270 |
273 |
271 session.ActiveBody().AnswerType() = KMceNegotiationAnswerTypeIntermediate; |
274 session.ActiveBody().AnswerType() = KMceNegotiationAnswerTypeIntermediate; |
437 void CMceStateOffering::EntryResponseL( TMceStateTransitionEvent& aEvent ) |
440 void CMceStateOffering::EntryResponseL( TMceStateTransitionEvent& aEvent ) |
438 { |
441 { |
439 TInt status = KErrNone; |
442 TInt status = KErrNone; |
440 CMceSipSession& session = aEvent.Session(); |
443 CMceSipSession& session = aEvent.Session(); |
441 CMceSipSession::TSubState subState = session.SubState(); |
444 CMceSipSession::TSubState subState = session.SubState(); |
|
445 TInt currentResponse = MceSip::ResponseCode( session.Response() ); |
442 |
446 |
|
447 // If media handling is ongoing while 200OK arrives with certain SDP content |
|
448 // don't send ACK thus the UAS will retransmit 200OK untile pervious meida handling |
|
449 // finish. |
|
450 |
|
451 if ( KMceSipRinging == iLastResponse && |
|
452 KMceSipOK == currentResponse && |
|
453 MceSip::HasContent( session.Response() ) ) |
|
454 { |
|
455 if ( session.WaitingMediaCallback() ) |
|
456 { |
|
457 iReadyToSendACK = EFalse; |
|
458 MCESRV_DEBUG("Waiting media callback, do not send ACK for this 200OK") |
|
459 return; |
|
460 } |
|
461 else |
|
462 { |
|
463 iReadyToSendACK = ETrue; |
|
464 MCESRV_DEBUG("Ready to send ACK") |
|
465 } |
|
466 } |
443 //send ACK |
467 //send ACK |
444 session.Actions().SendACKL( session.Response() ); |
468 session.Actions().SendACKL( session.Response() ); |
445 session.Actions().CheckContactIsSecureL( session.Response() ); |
469 session.Actions().CheckContactIsSecureL( session.Response() ); |
446 session.ActiveBody().AnswerType() = KMceNegotiationAnswerTypeFinal; |
470 session.ActiveBody().AnswerType() = KMceNegotiationAnswerTypeFinal; |
447 |
471 |
448 // Handle the answer only if the media processing is not |
472 iLastResponse = currentResponse; |
449 // already ongoing |
473 |
450 if ( !session.WaitingMediaCallback() ) |
474 if ( !session.WaitingMediaCallback() ) |
451 { |
475 { |
452 if ( MceSip::HasContent( session.Response() ) ) |
476 if ( MceSip::HasContent( session.Response() ) ) |
453 { |
477 { |
454 //process session timer |
478 //process session timer |
765 // CMceStateOffering::ExitL |
789 // CMceStateOffering::ExitL |
766 // ----------------------------------------------------------------------------- |
790 // ----------------------------------------------------------------------------- |
767 // |
791 // |
768 void CMceStateOffering::ExitL( TMceStateTransitionEvent& aEvent ) |
792 void CMceStateOffering::ExitL( TMceStateTransitionEvent& aEvent ) |
769 { |
793 { |
|
794 if ( !iReadyToSendACK ) |
|
795 { |
|
796 MCESRV_DEBUG("Not ready, don't change any state"); |
|
797 return; |
|
798 } |
770 |
799 |
771 if ( IsExtensionRequestEvent( aEvent )) |
800 if ( IsExtensionRequestEvent( aEvent )) |
772 { |
801 { |
773 //Do Nothing; |
802 //Do Nothing; |
774 } |
803 } |