|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Name : CancelUASStates.cpp |
|
15 // Part of : TransactionUser |
|
16 // Version : SIP/5.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include "siperr.h" |
|
22 #include "siprequest.h" |
|
23 #include "SipAssert.h" |
|
24 |
|
25 #include "CancelUAS.h" |
|
26 #include "CancelUASStates.h" |
|
27 |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CCancelUAS_Start::CCancelUAS_Start |
|
31 // ----------------------------------------------------------------------------- |
|
32 // |
|
33 CCancelUAS_Start::CCancelUAS_Start() |
|
34 { |
|
35 } |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CCancelUAS_Start::~CCancelUAS_Start |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 CCancelUAS_Start::~CCancelUAS_Start() |
|
42 { |
|
43 } |
|
44 |
|
45 // ----------------------------------------------------------------------------- |
|
46 // CCancelUAS_Start::SetNeighbourStates |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 void CCancelUAS_Start::SetNeighbourStates(CUserAgentState& aFinalRespSent) |
|
50 { |
|
51 iFinalRespSent = &aFinalRespSent; |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CCancelUAS_Start::TransactionEndsL |
|
56 // Happens if leave occurs while in this state. ConnectionMgr TRAPs the leave |
|
57 // and call LeaveOccurred causing transaction to end. |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 void |
|
61 CCancelUAS_Start::TransactionEndsL(CUserAgent& aUserAgent, TInt aReason) const |
|
62 { |
|
63 aUserAgent.Stop(aReason); |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CCancelUAS_Start::ReceiveL |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 void |
|
71 CCancelUAS_Start::ReceiveL(CUserAgent& aUserAgent, CSIPRequest* aRequest) const |
|
72 { |
|
73 __SIP_ASSERT_LEAVE(aRequest, KErrArgument); |
|
74 |
|
75 CCancelUAS::Ptr(aUserAgent).CancelReceivedL(aRequest, *iFinalRespSent); |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CCancelUAS_FinalRespSent::CCancelUAS_FinalRespSent |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 CCancelUAS_FinalRespSent::CCancelUAS_FinalRespSent() |
|
83 { |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CCancelUAS_FinalRespSent::~CCancelUAS_FinalRespSent |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 CCancelUAS_FinalRespSent::~CCancelUAS_FinalRespSent() |
|
91 { |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CCancelUAS_FinalRespSent::TransactionEndsL |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 void CCancelUAS_FinalRespSent::TransactionEndsL(CUserAgent& aUserAgent, |
|
99 TInt aReason) const |
|
100 { |
|
101 aUserAgent.Stop(aReason); |
|
102 } |
|
103 |
|
104 // ----------------------------------------------------------------------------- |
|
105 // CCancelUAS_FinalRespSent::SendResponseL |
|
106 // Application tries to send a response, but TU always sends the response to |
|
107 // CANCEL. |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 void CCancelUAS_FinalRespSent::SendResponseL(CUserAgent& /*aUserAgent*/, |
|
111 CSIPResponse* aResp, |
|
112 const TSIPTransportParams& /*aParams*/) const |
|
113 { |
|
114 __SIP_ASSERT_LEAVE(aResp, KErrArgument); |
|
115 |
|
116 User::Leave(KErrSIPInvalidTransactionState); |
|
117 } |