|
1 /* |
|
2 * Copyright (c) 2004 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 #include <sipregistrationbinding.h> |
|
19 #include <siprouteheader.h> |
|
20 |
|
21 #include "TCmdGetOutboundProxy.h" |
|
22 #include "SIPConstants.h" |
|
23 |
|
24 /** |
|
25 * INPUT: |
|
26 * Headers: - |
|
27 * Parameters: - |
|
28 * IDs: RegistrationId |
|
29 * |
|
30 * OUTPUT: |
|
31 * Parameters: - |
|
32 * IDs: Address* |
|
33 */ |
|
34 void TCmdGetOutboundProxy::ExecuteL() |
|
35 { |
|
36 // -- Setup --------------------------------------------------------------- |
|
37 |
|
38 // Get SIP objects from registry |
|
39 CSIPRegistrationBinding* registration = GetRegistrationL(); |
|
40 |
|
41 // -- Execution ----------------------------------------------------------- |
|
42 |
|
43 // Get proxy header, if present |
|
44 const CSIPRouteHeader* proxy = registration->OutboundProxy(); |
|
45 |
|
46 // Get proxy address, if present |
|
47 HBufC8* proxyAddress = NULL; |
|
48 if( proxy ) |
|
49 { |
|
50 proxyAddress = proxy->ToTextValueLC(); |
|
51 } |
|
52 |
|
53 // -- Response creation --------------------------------------------------- |
|
54 |
|
55 if( proxyAddress ) |
|
56 { |
|
57 AddTextResponseL( KParamAddress, proxyAddress->Des() ); |
|
58 CleanupStack::PopAndDestroy( proxyAddress ); |
|
59 } |
|
60 } |
|
61 |
|
62 TBool TCmdGetOutboundProxy::Match( const TTcIdentifier& aId ) |
|
63 { |
|
64 return TTcSIPCommandBase::Match( aId, _L8("GetOutboundProxy") ); |
|
65 } |
|
66 |
|
67 TTcCommandBase* TCmdGetOutboundProxy::CreateL( MTcTestContext& aContext ) |
|
68 { |
|
69 return new( ELeave ) TCmdGetOutboundProxy( aContext ); |
|
70 } |