|
1 /* |
|
2 * Copyright (c) 2005-2006 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: This observer is used to get function call from SIP Server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MUSAVASIPOBSERVER |
|
20 #define MUSAVASIPOBSERVER |
|
21 |
|
22 // INCLUDES |
|
23 #include "musunittesting.h" |
|
24 #include <sipobserver.h> |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <e32std.h> |
|
28 |
|
29 class CSIPServerTransaction; |
|
30 class MMusAvaSipAdapter; |
|
31 /** |
|
32 * SIP Observer class |
|
33 * |
|
34 * SIP Server Observer interface for MusAvailability Plug-in. |
|
35 * |
|
36 * @lib musavailabilityplugin.lib |
|
37 * @since S60 v3.2 |
|
38 */ |
|
39 |
|
40 |
|
41 class CMusAvaSipObserver : public CBase, |
|
42 public MSIPObserver |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Two-phased constructor |
|
47 * |
|
48 * @since S60 v3.2 |
|
49 * @param aObserver Pointer to observer intercase |
|
50 * @return Returns pointer to CMusAvaInterface object |
|
51 */ |
|
52 |
|
53 static CMusAvaSipObserver* NewL(); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 * |
|
58 * @since S60 v3.2 |
|
59 * @param |
|
60 * @return |
|
61 */ |
|
62 |
|
63 ~CMusAvaSipObserver(); |
|
64 |
|
65 protected: |
|
66 /** |
|
67 * Constructor |
|
68 * |
|
69 * @since S60 v3.2 |
|
70 * @return |
|
71 */ |
|
72 |
|
73 CMusAvaSipObserver(); |
|
74 |
|
75 /** |
|
76 * Perform the second phase construction of a |
|
77 * CMusAvaSipObserver object |
|
78 * |
|
79 * @since S60 v3.2 |
|
80 * @param |
|
81 * @return |
|
82 */ |
|
83 |
|
84 void ConstructL(); |
|
85 |
|
86 public: // new functions |
|
87 |
|
88 void AddObserverL( MMusAvaSipAdapter& aAdapter, TInt aIndex ); |
|
89 |
|
90 void RemoveObserver( MMusAvaSipAdapter& aAdapter ); |
|
91 |
|
92 public: // from base class MSIPObserver |
|
93 |
|
94 /** |
|
95 * A SIP request has been received from the network. |
|
96 * This function is called when the SIP request was received using such |
|
97 * an IAP, for which the application has not created a CSIPConnection |
|
98 * object. |
|
99 * |
|
100 * @since S60 v3.2 |
|
101 * @pre aTransaction != 0 |
|
102 * @param aIapId The IapId from which the SIP request was received. |
|
103 * @param aTransaction contains local address, remote address of a SIP |
|
104 * message, as well as optional SIP message method, headers and |
|
105 * body. The ownership is transferred. |
|
106 * @return |
|
107 */ |
|
108 void IncomingRequest(TUint32 aIapId, |
|
109 CSIPServerTransaction* aTransaction); |
|
110 |
|
111 /** |
|
112 * The received SIP request time-outed and it is invalid i.e. cannot be used |
|
113 * anymore. |
|
114 * This will be called if the user fails to create a SIP connection and |
|
115 * does not send an appropriate SIP response. |
|
116 * |
|
117 * @since S60 v3.2 |
|
118 * @param aTransaction The time-outed transaction. |
|
119 * @return |
|
120 */ |
|
121 void TimedOut(CSIPServerTransaction& aTransaction); |
|
122 |
|
123 private: |
|
124 |
|
125 RPointerArray<MMusAvaSipAdapter> iObservers; |
|
126 |
|
127 MUS_UNITTEST( UT_CMusAvaSipObserver ) |
|
128 |
|
129 }; |
|
130 |
|
131 |
|
132 #endif //MMUSAVASIPOBSERVER |