|
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: Implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "CMCETestUIEngineSipObserver.h" |
|
20 #include <sip.h> |
|
21 #include <sipconnection.h> |
|
22 #include <sipdialog.h> |
|
23 #include <sipprofile.h> |
|
24 #include <sipprofileregistry.h> |
|
25 #include <sipservertransaction.h> |
|
26 #include <sipclienttransaction.h> |
|
27 #include <sipdialogassocbase.h> |
|
28 #include <sipinvitedialogassoc.h> |
|
29 #include <sipregistrationbinding.h> |
|
30 #include <siprefresh.h> |
|
31 #include <sipstrings.h> |
|
32 #include <sipstrconsts.h> |
|
33 #include <sipresponseelements.h> |
|
34 #include <e32err.h> |
|
35 #include <e32debug.h> |
|
36 #include <stringpool.h> |
|
37 |
|
38 |
|
39 const TUint KNotImplemented = 501; |
|
40 const TUid KUIOptionsUid = { 0x10123F9E }; |
|
41 |
|
42 // ----------------------------------------------------------------------------- |
|
43 // CMCETestUIEngineSipObserver::NewL |
|
44 // ----------------------------------------------------------------------------- |
|
45 // |
|
46 CMCETestUIEngineSipObserver* CMCETestUIEngineSipObserver::NewL() |
|
47 { |
|
48 CMCETestUIEngineSipObserver* self = |
|
49 new( ELeave ) CMCETestUIEngineSipObserver(); |
|
50 |
|
51 CleanupStack::PushL( self ); |
|
52 self->ConstructL(); |
|
53 CleanupStack::Pop( self ); |
|
54 return self; |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CMCETestUIEngineSipObserver::~CMCETestUIEngineSipObserver |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 CMCETestUIEngineSipObserver::~CMCETestUIEngineSipObserver() |
|
62 { |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CMCETestUIEngineSipObserver::CMCETestUIEngineSipObserver |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 CMCETestUIEngineSipObserver::CMCETestUIEngineSipObserver() |
|
70 { |
|
71 |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CMCETestUIEngineSipObserver::ConstructL |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 void CMCETestUIEngineSipObserver::ConstructL( ) |
|
79 { |
|
80 iSip = CSIP::NewL( KUIOptionsUid, *this ); |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CMCETestUIEngineSipObserver::GetSipInstance |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 |
|
88 CSIP* CMCETestUIEngineSipObserver::GetSipInstance() |
|
89 { |
|
90 return iSip; |
|
91 } |
|
92 // -- from SIPObserver --------------------------------------------------------- |
|
93 |
|
94 void CMCETestUIEngineSipObserver::IncomingRequest( |
|
95 TUint32 aIapId, |
|
96 CSIPServerTransaction* aTransaction) |
|
97 { |
|
98 CSIPConnection* connection = NULL; |
|
99 TRAPD( err, connection = CSIPConnection::NewL( *iSip, aIapId, *this ) ); |
|
100 if ( aTransaction->Type() == SIPStrings::StringF( SipStrConsts::EOptions ) ) |
|
101 { |
|
102 RDebug::Print( _L( "SIPObserver-IncomingRequest-Options:Entry" )); |
|
103 RStringF phrase = SIPStrings::StringF( SipStrConsts::EPhraseNotImplemented ); |
|
104 CSIPResponseElements* response = |
|
105 CSIPResponseElements::NewLC( KNotImplemented, phrase ); |
|
106 aTransaction->SendResponseL( response ); |
|
107 CleanupStack::Pop( response ); |
|
108 RDebug::Print( _L( "Response to OPTIONS sent" )); |
|
109 } |
|
110 delete connection; |
|
111 } |
|
112 |
|
113 void CMCETestUIEngineSipObserver::TimedOut( |
|
114 CSIPServerTransaction& /*aTransaction*/) |
|
115 { |
|
116 // NOP, dummy |
|
117 } |
|
118 |
|
119 // |
|
120 // -- MSIPConnectionObserver dummy functions |
|
121 // |
|
122 |
|
123 void CMCETestUIEngineSipObserver::IncomingRequest (CSIPServerTransaction* /*aTransaction*/) |
|
124 { |
|
125 // NOP |
|
126 } |
|
127 void CMCETestUIEngineSipObserver::IncomingRequest (CSIPServerTransaction* /*aTransaction*/, |
|
128 CSIPDialog& /*aDialog*/) |
|
129 { |
|
130 // NOP |
|
131 } |
|
132 void CMCETestUIEngineSipObserver::IncomingResponse (CSIPClientTransaction& /*aTransaction*/) |
|
133 { |
|
134 // NOP |
|
135 } |
|
136 void CMCETestUIEngineSipObserver::IncomingResponse (CSIPClientTransaction& /*aTransaction*/, |
|
137 CSIPDialogAssocBase& /*aDialogAssoc*/) |
|
138 { |
|
139 // NOP |
|
140 } |
|
141 void CMCETestUIEngineSipObserver::IncomingResponse (CSIPClientTransaction& /*aTransaction*/, |
|
142 CSIPInviteDialogAssoc* /*aDialogAssoc*/) |
|
143 { |
|
144 // NOP |
|
145 } |
|
146 void CMCETestUIEngineSipObserver::IncomingResponse (CSIPClientTransaction& /*aTransaction*/, |
|
147 CSIPRegistrationBinding& /*aRegistration*/) |
|
148 { |
|
149 // NOP |
|
150 } |
|
151 void CMCETestUIEngineSipObserver::ErrorOccured (TInt /*aError*/, |
|
152 CSIPTransactionBase& /*aTransaction*/) |
|
153 { |
|
154 // NOP |
|
155 } |
|
156 void CMCETestUIEngineSipObserver::ErrorOccured (TInt /*aError*/, |
|
157 CSIPClientTransaction& /*aTransaction*/, |
|
158 CSIPRegistrationBinding& /*aRegistration*/) |
|
159 { |
|
160 // NOP |
|
161 } |
|
162 void CMCETestUIEngineSipObserver::ErrorOccured (TInt /*aError*/, |
|
163 CSIPTransactionBase& /*aTransaction*/, |
|
164 CSIPDialogAssocBase& /*aDialogAssoc*/) |
|
165 { |
|
166 // NOP |
|
167 } |
|
168 void CMCETestUIEngineSipObserver::ErrorOccured (TInt /*aError*/, CSIPRefresh& /*aSIPRefresh*/) |
|
169 { |
|
170 // NOP |
|
171 } |
|
172 void CMCETestUIEngineSipObserver::ErrorOccured (TInt /*aError*/, |
|
173 CSIPRegistrationBinding& /*aRegistration*/) |
|
174 { |
|
175 // NOP |
|
176 } |
|
177 void CMCETestUIEngineSipObserver::ErrorOccured (TInt /*aError*/, |
|
178 CSIPDialogAssocBase& /*aDialogAssoc*/) |
|
179 { |
|
180 // NOP |
|
181 } |
|
182 void CMCETestUIEngineSipObserver::InviteCompleted (CSIPClientTransaction& /*aTransaction*/) |
|
183 { |
|
184 // NOP |
|
185 } |
|
186 void CMCETestUIEngineSipObserver::InviteCanceled (CSIPServerTransaction& /*aTransaction*/) |
|
187 { |
|
188 // NOP |
|
189 } |
|
190 void CMCETestUIEngineSipObserver::ConnectionStateChanged (CSIPConnection::TState /*aState*/) |
|
191 { |
|
192 // NOP |
|
193 } |