|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Initial state for MO refer. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <sipreferdialogassoc.h> |
|
24 #include "mceeventrefermoidlestate.h" |
|
25 #include "mcesipeventhelper.h" |
|
26 #include <sipmessageelements.h> |
|
27 #include "mceeventslogs.h" |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CMceEventReferMoIdleState::CMceEventReferMoIdleState |
|
33 // C++ default constructor can NOT contain any code, that |
|
34 // might leave. |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 CMceEventReferMoIdleState::CMceEventReferMoIdleState() |
|
38 { |
|
39 } |
|
40 |
|
41 // ----------------------------------------------------------------------------- |
|
42 // CMceEventReferMoIdleState::~CMceEventReferMoIdleState |
|
43 // Destructor |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 CMceEventReferMoIdleState::~CMceEventReferMoIdleState() |
|
47 { |
|
48 } |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CMceEventReferMoIdleState::ProcessReferStateL |
|
52 // Ápply concrete state. |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 void CMceEventReferMoIdleState::HandleL( CMceComEvent& aEvent ) |
|
56 { |
|
57 MCEEVENTS_DEBUG("CMceEventReferMoIdleState::HandleL, Entry"); |
|
58 User::LeaveIfError( aEvent.SIPEvent().Dialog() ? |
|
59 KErrNone : KMceEventStateError ); |
|
60 |
|
61 User::LeaveIfError( aEvent.SIPEvent().Dialog()->Type() == |
|
62 SIPStrings::StringF( SipStrConsts::ERefer ) ? |
|
63 KErrNone : KMceEventStateError ); |
|
64 |
|
65 CSIPMessageElements* msgElem = |
|
66 MCESIPEventHelper::CreateMessageElementsLC( |
|
67 aEvent, |
|
68 SipStrConsts::ERefer, |
|
69 aEvent.ReferType() ); |
|
70 // send Refer |
|
71 CSIPClientTransaction* transaction = |
|
72 static_cast< CSIPReferDialogAssoc* >( aEvent.SIPEvent().Dialog() )-> |
|
73 SendReferL( msgElem ); |
|
74 CleanupStack::Pop( msgElem ); |
|
75 CleanupStack::PushL( transaction ); |
|
76 |
|
77 // save the transaction |
|
78 aEvent.SIPEvent().SetPendingTransactionL( transaction ); |
|
79 CleanupStack::Pop( transaction ); |
|
80 |
|
81 // Set the next state |
|
82 aEvent.EventContext().SetCurrentStateL( |
|
83 aEvent, |
|
84 KMceEstablishingEventStateIndex ); |
|
85 MCEEVENTS_DEBUG("CMceEventReferMoIdleState::HandleL, Exit"); |
|
86 } |
|
87 |
|
88 // ----------------------------------------------------------------------------- |
|
89 // CMceEventReferMoIdleState::HandleReceiveRequestL |
|
90 // Ápply concrete state. |
|
91 // Be noticed that it will be also update, unRefer |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 void CMceEventReferMoIdleState::HandleReceiveRequestL( |
|
95 CMceComEvent& /*aEvent*/ ) |
|
96 { |
|
97 User::Leave( KMceEventStateError ); |
|
98 } |
|
99 |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CMceEventReferMoIdleState::HandleResponseReceivedL |
|
102 // Ápply concrete state. |
|
103 // Be noticed that it will be also update, unRefer |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 void CMceEventReferMoIdleState::HandleResponseReceivedL( |
|
107 CMceComEvent& /*aEvent*/ ) |
|
108 { |
|
109 User::Leave( KMceEventStateError ); |
|
110 } |
|
111 |
|
112 // End of File |